Skip to content

Commit

Permalink
lift sb_start_write out of ->splice_write()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Apr 9, 2013
1 parent 17338fc commit 2dd8c9a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,8 +1000,6 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out,
};
ssize_t ret;

sb_start_write(inode->i_sb);

pipe_lock(pipe);

splice_from_pipe_begin(&sd);
Expand Down Expand Up @@ -1037,7 +1035,6 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out,
*ppos += ret;
balance_dirty_pages_ratelimited(mapping);
}
sb_end_write(inode->i_sb);

return ret;
}
Expand All @@ -1064,9 +1061,7 @@ static ssize_t default_file_splice_write(struct pipe_inode_info *pipe,
{
ssize_t ret;

file_start_write(out);
ret = splice_from_pipe(pipe, out, ppos, len, flags, write_pipe_buf);
file_end_write(out);
if (ret > 0)
*ppos += ret;

Expand Down Expand Up @@ -1119,7 +1114,10 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
else
splice_write = default_file_splice_write;

return splice_write(pipe, out, ppos, len, flags);
file_start_write(out);
ret = splice_write(pipe, out, ppos, len, flags);
file_end_write(out);
return ret;
}

/*
Expand Down

0 comments on commit 2dd8c9a

Please sign in to comment.