Skip to content

Commit 50cd2c5

Browse files
author
Al Viro
committed
lift file_*_write out of do_splice_direct()
Signed-off-by: Al Viro <[email protected]>
1 parent 500368f commit 50cd2c5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

fs/read_write.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,9 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos,
11291129
if (in.file->f_flags & O_NONBLOCK)
11301130
fl = SPLICE_F_NONBLOCK;
11311131
#endif
1132+
file_start_write(out.file);
11321133
retval = do_splice_direct(in.file, &pos, out.file, &out_pos, count, fl);
1134+
file_end_write(out.file);
11331135

11341136
if (retval > 0) {
11351137
add_rchar(current, retval);

fs/splice.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,11 +1303,9 @@ long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
13031303
};
13041304
long ret;
13051305

1306-
file_start_write(out);
13071306
ret = splice_direct_to_actor(in, &sd, direct_splice_actor);
13081307
if (ret > 0)
13091308
*ppos = sd.pos;
1310-
file_end_write(out);
13111309

13121310
return ret;
13131311
}

0 commit comments

Comments
 (0)