Skip to content

Commit 500368f

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

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

fs/splice.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,10 +1115,7 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
11151115
else
11161116
splice_write = default_file_splice_write;
11171117

1118-
file_start_write(out);
1119-
ret = splice_write(pipe, out, ppos, len, flags);
1120-
file_end_write(out);
1121-
return ret;
1118+
return splice_write(pipe, out, ppos, len, flags);
11221119
}
11231120

11241121
/*
@@ -1306,9 +1303,11 @@ long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
13061303
};
13071304
long ret;
13081305

1306+
file_start_write(out);
13091307
ret = splice_direct_to_actor(in, &sd, direct_splice_actor);
13101308
if (ret > 0)
13111309
*ppos = sd.pos;
1310+
file_end_write(out);
13121311

13131312
return ret;
13141313
}
@@ -1361,7 +1360,9 @@ static long do_splice(struct file *in, loff_t __user *off_in,
13611360
offset = out->f_pos;
13621361
}
13631362

1363+
file_start_write(out);
13641364
ret = do_splice_from(ipipe, out, &offset, len, flags);
1365+
file_end_write(out);
13651366

13661367
if (!off_out)
13671368
out->f_pos = offset;

0 commit comments

Comments
 (0)