diff options
author | Christoph Hellwig <hch@lst.de> | 2016-11-29 22:33:25 -0500 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-11-29 22:33:25 -0500 |
commit | 6552321831dce87ff5c466a55b58d472732caadc (patch) | |
tree | 84f3de7b89690c84fd13e2efa7a85d4918d342e3 /fs/xfs/xfs_icache.c | |
parent | f8319483f57f1ca22370f4150bb990aca7728a67 (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_icache.c')
-rw-r--r-- | fs/xfs/xfs_icache.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 9c3e5c6ddf20..ff4d6311c7f4 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c | |||
@@ -70,8 +70,6 @@ xfs_inode_alloc( | |||
70 | ASSERT(!xfs_isiflocked(ip)); | 70 | ASSERT(!xfs_isiflocked(ip)); |
71 | ASSERT(ip->i_ino == 0); | 71 | ASSERT(ip->i_ino == 0); |
72 | 72 | ||
73 | mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino); | ||
74 | |||
75 | /* initialise the xfs inode */ | 73 | /* initialise the xfs inode */ |
76 | ip->i_ino = ino; | 74 | ip->i_ino = ino; |
77 | ip->i_mount = mp; | 75 | ip->i_mount = mp; |
@@ -394,8 +392,8 @@ xfs_iget_cache_hit( | |||
394 | xfs_inode_clear_reclaim_tag(pag, ip->i_ino); | 392 | xfs_inode_clear_reclaim_tag(pag, ip->i_ino); |
395 | inode->i_state = I_NEW; | 393 | inode->i_state = I_NEW; |
396 | 394 | ||
397 | ASSERT(!rwsem_is_locked(&ip->i_iolock.mr_lock)); | 395 | ASSERT(!rwsem_is_locked(&inode->i_rwsem)); |
398 | mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino); | 396 | init_rwsem(&inode->i_rwsem); |
399 | 397 | ||
400 | spin_unlock(&ip->i_flags_lock); | 398 | spin_unlock(&ip->i_flags_lock); |
401 | spin_unlock(&pag->pag_ici_lock); | 399 | spin_unlock(&pag->pag_ici_lock); |