]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: introduce xfs_rw_lock() helpers for locking the inode
authorDave Chinner <dchinner@redhat.com>
Wed, 12 Jan 2011 00:37:10 +0000 (11:37 +1100)
committerDave Chinner <david@fromorbit.com>
Wed, 12 Jan 2011 00:37:10 +0000 (11:37 +1100)
commitf49a003824ff1ad12152418bc06b66b9d445ffd6
treed84117b479269b0a96a3041f67006d25b44300c3
parent73d2db7ef901c7030c13e3700ded3a4e39fd8d65
xfs: introduce xfs_rw_lock() helpers for locking the inode

We need to obtain the i_mutex, i_iolock and i_ilock during the read
and write paths. Add a set of wrapper functions to neatly
encapsulate the lock ordering and shared/exclusive semantics to make
the locking easier to follow and get right.

Note that this changes some of the exclusive locking serialisation in
that serialisation will occur against the i_mutex instead of the
XFS_IOLOCK_EXCL. This does not change any behaviour, and it is
arguably more efficient to use the mutex for such serialisation than
the rw_sem.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/linux-2.6/xfs_file.c