diff options
author | Mark Fasheh <mark.fasheh@oracle.com> | 2006-10-17 04:31:38 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-10-19 14:53:08 -0400 |
commit | 62752ee198dca9209b7dee504763e51b11e9e0ca (patch) | |
tree | 5e340a4c690851dadc3a8aa395e4c0d14b4837eb /include/linux/fs.h | |
parent | ce9e3d9953c8cb67001719b5516da2928e956be4 (diff) |
[PATCH] Take i_mutex in splice_from_pipe()
The splice_actor may be calling ->prepare_write() and ->commit_write(). We
want i_mutex on the inode being written to before calling those so that we
don't race i_size changes.
The double locking behavior is done elsewhere in splice.c, and if we
eventually want _nolock variants of generic_file_splice_write(), fs modules
might have to replicate the nasty locking code. We introduce
inode_double_lock() and inode_double_unlock() to consolidate the locking
rules into one set of functions.
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 661c7c572149..853a02f23936 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -623,6 +623,9 @@ enum inode_i_mutex_lock_class | |||
623 | I_MUTEX_QUOTA | 623 | I_MUTEX_QUOTA |
624 | }; | 624 | }; |
625 | 625 | ||
626 | extern void inode_double_lock(struct inode *inode1, struct inode *inode2); | ||
627 | extern void inode_double_unlock(struct inode *inode1, struct inode *inode2); | ||
628 | |||
626 | /* | 629 | /* |
627 | * NOTE: in a 32bit arch with a preemptable kernel and | 630 | * NOTE: in a 32bit arch with a preemptable kernel and |
628 | * an UP compile the i_size_read/write must be atomic | 631 | * an UP compile the i_size_read/write must be atomic |