mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 09:16:33 +00:00
backing-file: convert to using fops->splice_write
Filesystems may define their own splice write. Therefore, use the file
fops instead of invoking iter_file_splice_write() directly.
Signed-off-by: Ed Tsai <ed.tsai@mediatek.com>
Link: https://lore.kernel.org/r/20240708072208.25244-1-ed.tsai@mediatek.com
Fixes: 5ca7346861
("fuse: implement splice read/write passthrough")
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
232590ea7f
commit
996b37da1e
@ -303,13 +303,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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user