Commit 50cd2c57 authored by Al Viro's avatar Al Viro

lift file_*_write out of do_splice_direct()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 500368f7
...@@ -1129,7 +1129,9 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, ...@@ -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) if (in.file->f_flags & O_NONBLOCK)
fl = SPLICE_F_NONBLOCK; fl = SPLICE_F_NONBLOCK;
#endif #endif
file_start_write(out.file);
retval = do_splice_direct(in.file, &pos, out.file, &out_pos, count, fl); retval = do_splice_direct(in.file, &pos, out.file, &out_pos, count, fl);
file_end_write(out.file);
if (retval > 0) { if (retval > 0) {
add_rchar(current, retval); add_rchar(current, retval);
......
...@@ -1303,11 +1303,9 @@ long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, ...@@ -1303,11 +1303,9 @@ long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
}; };
long ret; long ret;
file_start_write(out);
ret = splice_direct_to_actor(in, &sd, direct_splice_actor); ret = splice_direct_to_actor(in, &sd, direct_splice_actor);
if (ret > 0) if (ret > 0)
*ppos = sd.pos; *ppos = sd.pos;
file_end_write(out);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment