lift file_*_write out of do_splice_direct()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 24 May 2013 00:10:34 +0000 (20:10 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 29 Jun 2013 08:57:08 +0000 (12:57 +0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/read_write.c
fs/splice.c

index 2cefa417be349b0016ffa8606635db9e85751015..abca7437d192434dfd99325531544525fe7779d7 100644 (file)
@@ -1129,7 +1129,9 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos,
        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);
index fed5134f761cf401cfacd3ab1c0b63fe057a37aa..78b3d12046e79ebb4bf1f7da9075104a46db7e5c 100644 (file)
@@ -1303,11 +1303,9 @@ long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
        };
        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;
 }