diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2009-04-14 13:48:39 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-04-15 06:10:12 -0400 |
commit | 328eaaba4e41a04c1dc4679d65bea3fee4349d86 (patch) | |
tree | 171bf86b590a841729bab11feec874869bcab49e /fs/splice.c | |
parent | eb443e5a25d43996deb62b9bcee1a4ce5dea2ead (diff) |
ocfs2: fix i_mutex locking in ocfs2_splice_to_file()
Rearrange locking of i_mutex on destination and call to
ocfs2_rw_lock() so locks are only held while buffers are copied with
the pipe_to_file() actor, and not while waiting for more data on the
pipe.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs/splice.c')
-rw-r--r-- | fs/splice.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/splice.c b/fs/splice.c index a1f595b9db40..584b2b7a1dbe 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -555,8 +555,8 @@ static int pipe_to_sendpage(struct pipe_inode_info *pipe, | |||
555 | * SPLICE_F_MOVE isn't set, or we cannot move the page, we simply create | 555 | * SPLICE_F_MOVE isn't set, or we cannot move the page, we simply create |
556 | * a new page in the output file page cache and fill/dirty that. | 556 | * a new page in the output file page cache and fill/dirty that. |
557 | */ | 557 | */ |
558 | static int pipe_to_file(struct pipe_inode_info *pipe, struct pipe_buffer *buf, | 558 | int pipe_to_file(struct pipe_inode_info *pipe, struct pipe_buffer *buf, |
559 | struct splice_desc *sd) | 559 | struct splice_desc *sd) |
560 | { | 560 | { |
561 | struct file *file = sd->u.file; | 561 | struct file *file = sd->u.file; |
562 | struct address_space *mapping = file->f_mapping; | 562 | struct address_space *mapping = file->f_mapping; |
@@ -600,6 +600,7 @@ static int pipe_to_file(struct pipe_inode_info *pipe, struct pipe_buffer *buf, | |||
600 | out: | 600 | out: |
601 | return ret; | 601 | return ret; |
602 | } | 602 | } |
603 | EXPORT_SYMBOL(pipe_to_file); | ||
603 | 604 | ||
604 | static void wakeup_pipe_writers(struct pipe_inode_info *pipe) | 605 | static void wakeup_pipe_writers(struct pipe_inode_info *pipe) |
605 | { | 606 | { |