[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0a104644108c624457e4311facf0a2a3c109f718.camel@mediatek.com>
Date: Fri, 5 Jul 2024 08:20:17 +0000
From: Ed Tsai (蔡宗軒) <Ed.Tsai@...iatek.com>
To: "viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>, "miklos@...redi.hu"
<miklos@...redi.hu>, "amir73il@...il.com" <amir73il@...il.com>,
"matthias.bgg@...il.com" <matthias.bgg@...il.com>, "jack@...e.cz"
<jack@...e.cz>, "brauner@...nel.org" <brauner@...nel.org>,
"angelogioacchino.delregno@...labora.com"
<angelogioacchino.delregno@...labora.com>
CC: "linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, wsd_upstream
<wsd_upstream@...iatek.com>, Casper Li (李中榮)
<casper.li@...iatek.com>, Chun-Hung Wu (巫駿宏)
<Chun-hung.Wu@...iatek.com>, "linux-unionfs@...r.kernel.org"
<linux-unionfs@...r.kernel.org>, "linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "linux-fsdevel@...r.kernel.org"
<linux-fsdevel@...r.kernel.org>
Subject: Re: [PATCH 1/1] backing-file: covert to using fops->splice_write
On Fri, 2024-07-05 at 16:16 +0800, ed.tsai@...iatek.com wrote:
> From: Ed Tsai <ed.tsai@...iatek.com>
>
> Filesystems may define their own splice write. Therefore, use file
> fops instead of invoking iter_file_splice_write() directly.
>
> Signed-off-by: Ed Tsai <ed.tsai@...iatek.com>
> ---
> fs/backing-file.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/backing-file.c b/fs/backing-file.c
> index 740185198db3..687a7fae7d25 100644
> --- a/fs/backing-file.c
> +++ b/fs/backing-file.c
> @@ -280,13 +280,16 @@ ssize_t backing_file_splice_write(struct
> pipe_inode_info *pipe,
> if (WARN_ON_ONCE(!(out->f_mode & FMODE_BACKING)))
> return -EIO;
>
> + if (out->f_op->splice_write)
> + return -EINVAL;
> +
> ret = file_remove_privs(ctx->user_file);
> if (ret)
> return ret;
>
> old_cred = override_creds(ctx->cred);
> file_start_write(out);
> - ret = iter_file_splice_write(pipe, out, ppos, len, flags);
> + ret = out->f_op->splice_write(pipe, out, ppos, len, flags);
> file_end_write(out);
> revert_creds(old_cred);
>
s/covert/convert/ for subject
Powered by blists - more mailing lists