lift file_*_write out of do_splice_direct()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
diff --git a/fs/read_write.c b/fs/read_write.c
index 2cefa41..abca743 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -1129,7 +1129,9 @@
if (in.file->f_flags & O_NONBLOCK)
fl = SPLICE_F_NONBLOCK;
#endif
+ file_start_write(out.file);
retval = do_splice_direct(in.file, &pos, out.file, &out_pos, count, fl);
+ file_end_write(out.file);
if (retval > 0) {
add_rchar(current, retval);
diff --git a/fs/splice.c b/fs/splice.c
index fed5134..78b3d12 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1303,11 +1303,9 @@
};
long ret;
- file_start_write(out);
ret = splice_direct_to_actor(in, &sd, direct_splice_actor);
if (ret > 0)
*ppos = sd.pos;
- file_end_write(out);
return ret;
}