aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-11-29 22:33:25 -0500
committerDave Chinner <david@fromorbit.com>2016-11-29 22:33:25 -0500
commit6552321831dce87ff5c466a55b58d472732caadc (patch)
tree84f3de7b89690c84fd13e2efa7a85d4918d342e3 /fs/xfs/xfs_inode.h
parentf8319483f57f1ca22370f4150bb990aca7728a67 (diff)
xfs: remove i_iolock and use i_rwsem in the VFS inode instead
This patch drops the XFS-own i_iolock and uses the VFS i_rwsem which recently replaced i_mutex instead. This means we only have to take one lock instead of two in many fast path operations, and we can also shrink the xfs_inode structure. Thanks to the xfs_ilock family there is very little churn, the only thing of note is that we need to switch to use the lock_two_directory helper for taking the i_rwsem on two inodes in a few places to make sure our lock order matches the one used in the VFS. Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Jens Axboe <axboe@fb.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_inode.h')
-rw-r--r--fs/xfs/xfs_inode.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 71e8a81c91a3..10dcf27b4c85 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -56,7 +56,6 @@ typedef struct xfs_inode {
56 /* Transaction and locking information. */ 56 /* Transaction and locking information. */
57 struct xfs_inode_log_item *i_itemp; /* logging information */ 57 struct xfs_inode_log_item *i_itemp; /* logging information */
58 mrlock_t i_lock; /* inode lock */ 58 mrlock_t i_lock; /* inode lock */
59 mrlock_t i_iolock; /* inode IO lock */
60 mrlock_t i_mmaplock; /* inode mmap IO lock */ 59 mrlock_t i_mmaplock; /* inode mmap IO lock */
61 atomic_t i_pincount; /* inode pin count */ 60 atomic_t i_pincount; /* inode pin count */
62 spinlock_t i_flags_lock; /* inode i_flags lock */ 61 spinlock_t i_flags_lock; /* inode i_flags lock */
@@ -333,7 +332,7 @@ static inline void xfs_ifunlock(struct xfs_inode *ip)
333 * IOLOCK values 332 * IOLOCK values
334 * 333 *
335 * 0-3 subclass value 334 * 0-3 subclass value
336 * 4-7 PARENT subclass values 335 * 4-7 unused
337 * 336 *
338 * MMAPLOCK values 337 * MMAPLOCK values
339 * 338 *
@@ -348,10 +347,8 @@ static inline void xfs_ifunlock(struct xfs_inode *ip)
348 * 347 *
349 */ 348 */
350#define XFS_IOLOCK_SHIFT 16 349#define XFS_IOLOCK_SHIFT 16
351#define XFS_IOLOCK_PARENT_VAL 4 350#define XFS_IOLOCK_MAX_SUBCLASS 3
352#define XFS_IOLOCK_MAX_SUBCLASS (XFS_IOLOCK_PARENT_VAL - 1)
353#define XFS_IOLOCK_DEP_MASK 0x000f0000 351#define XFS_IOLOCK_DEP_MASK 0x000f0000
354#define XFS_IOLOCK_PARENT (XFS_IOLOCK_PARENT_VAL << XFS_IOLOCK_SHIFT)
355 352
356#define XFS_MMAPLOCK_SHIFT 20 353#define XFS_MMAPLOCK_SHIFT 20
357#define XFS_MMAPLOCK_NUMORDER 0 354#define XFS_MMAPLOCK_NUMORDER 0