Skip to content

Commit 996b37d

Browse files
Ed Tsaibrauner
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Fixes: 5ca7346 ("fuse: implement splice read/write passthrough") Reviewed-by: Amir Goldstein <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 232590e commit 996b37d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/backing-file.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,13 +303,16 @@ ssize_t backing_file_splice_write(struct pipe_inode_info *pipe,
303303
if (WARN_ON_ONCE(!(out->f_mode & FMODE_BACKING)))
304304
return -EIO;
305305

306+
if (!out->f_op->splice_write)
307+
return -EINVAL;
308+
306309
ret = file_remove_privs(ctx->user_file);
307310
if (ret)
308311
return ret;
309312

310313
old_cred = override_creds(ctx->cred);
311314
file_start_write(out);
312-
ret = iter_file_splice_write(pipe, out, ppos, len, flags);
315+
ret = out->f_op->splice_write(pipe, out, ppos, len, flags);
313316
file_end_write(out);
314317
revert_creds(old_cred);
315318

0 commit comments

Comments
 (0)