summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorEd Tsai <ed.tsai@mediatek.com>2024-07-08 09:22:06 +0200
committerChristian Brauner <brauner@kernel.org>2024-08-23 13:08:31 +0200
commit996b37da1e0f51314d4186b326742c2a95a9f0dd (patch)
tree6240af521dc61483ca6d83513131dff8604a3538 /fs
parentRevert "pidfd: prevent creation of pidfds for kthreads" (diff)
downloadlinux-996b37da1e0f51314d4186b326742c2a95a9f0dd.tar.xz
linux-996b37da1e0f51314d4186b326742c2a95a9f0dd.zip
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: 5ca73468612d ("fuse: implement splice read/write passthrough") Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/backing-file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/backing-file.c b/fs/backing-file.c
index afb557446c27..8860dac58c37 100644
--- a/fs/backing-file.c
+++ b/fs/backing-file.c
@@ -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);