Commit 4f59af758f9092bc7b266ca919ce6067170e5172
Committed by
Ben Myers
1 parent
5a15322da1
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
xfs: remove iolock lock classes
Content-Disposition: inline; filename=xfs-remove-iolock-classes Now that we never take the iolock during inode reclaim we don't need to play games with lock classes. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Rich Johnston <rjohnston@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Showing 3 changed files with 2 additions and 33 deletions Side-by-side Diff
fs/xfs/xfs_iget.c
... | ... | @@ -41,17 +41,6 @@ |
41 | 41 | |
42 | 42 | |
43 | 43 | /* |
44 | - * Define xfs inode iolock lockdep classes. We need to ensure that all active | |
45 | - * inodes are considered the same for lockdep purposes, including inodes that | |
46 | - * are recycled through the XFS_IRECLAIMABLE state. This is the the only way to | |
47 | - * guarantee the locks are considered the same when there are multiple lock | |
48 | - * initialisation siteѕ. Also, define a reclaimable inode class so it is | |
49 | - * obvious in lockdep reports which class the report is against. | |
50 | - */ | |
51 | -static struct lock_class_key xfs_iolock_active; | |
52 | -struct lock_class_key xfs_iolock_reclaimable; | |
53 | - | |
54 | -/* | |
55 | 44 | * Allocate and initialise an xfs_inode. |
56 | 45 | */ |
57 | 46 | STATIC struct xfs_inode * |
... | ... | @@ -80,8 +69,6 @@ |
80 | 69 | ASSERT(ip->i_ino == 0); |
81 | 70 | |
82 | 71 | mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino); |
83 | - lockdep_set_class_and_name(&ip->i_iolock.mr_lock, | |
84 | - &xfs_iolock_active, "xfs_iolock_active"); | |
85 | 72 | |
86 | 73 | /* initialise the xfs inode */ |
87 | 74 | ip->i_ino = ino; |
... | ... | @@ -250,8 +237,6 @@ |
250 | 237 | |
251 | 238 | ASSERT(!rwsem_is_locked(&ip->i_iolock.mr_lock)); |
252 | 239 | mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino); |
253 | - lockdep_set_class_and_name(&ip->i_iolock.mr_lock, | |
254 | - &xfs_iolock_active, "xfs_iolock_active"); | |
255 | 240 | |
256 | 241 | spin_unlock(&ip->i_flags_lock); |
257 | 242 | spin_unlock(&pag->pag_ici_lock); |
fs/xfs/xfs_inode.h
... | ... | @@ -487,8 +487,6 @@ |
487 | 487 | #define XFS_IOLOCK_DEP(flags) (((flags) & XFS_IOLOCK_DEP_MASK) >> XFS_IOLOCK_SHIFT) |
488 | 488 | #define XFS_ILOCK_DEP(flags) (((flags) & XFS_ILOCK_DEP_MASK) >> XFS_ILOCK_SHIFT) |
489 | 489 | |
490 | -extern struct lock_class_key xfs_iolock_reclaimable; | |
491 | - | |
492 | 490 | /* |
493 | 491 | * For multiple groups support: if S_ISGID bit is set in the parent |
494 | 492 | * directory, group of new file is set to that of the parent, and |
fs/xfs/xfs_super.c
... | ... | @@ -874,6 +874,8 @@ |
874 | 874 | { |
875 | 875 | xfs_inode_t *ip = XFS_I(inode); |
876 | 876 | |
877 | + ASSERT(!rwsem_is_locked(&ip->i_iolock.mr_lock)); | |
878 | + | |
877 | 879 | trace_xfs_evict_inode(ip); |
878 | 880 | |
879 | 881 | truncate_inode_pages(&inode->i_data, 0); |
... | ... | @@ -881,22 +883,6 @@ |
881 | 883 | XFS_STATS_INC(vn_rele); |
882 | 884 | XFS_STATS_INC(vn_remove); |
883 | 885 | XFS_STATS_DEC(vn_active); |
884 | - | |
885 | - /* | |
886 | - * The iolock is used by the file system to coordinate reads, | |
887 | - * writes, and block truncates. Up to this point the lock | |
888 | - * protected concurrent accesses by users of the inode. But | |
889 | - * from here forward we're doing some final processing of the | |
890 | - * inode because we're done with it, and although we reuse the | |
891 | - * iolock for protection it is really a distinct lock class | |
892 | - * (in the lockdep sense) from before. To keep lockdep happy | |
893 | - * (and basically indicate what we are doing), we explicitly | |
894 | - * re-init the iolock here. | |
895 | - */ | |
896 | - ASSERT(!rwsem_is_locked(&ip->i_iolock.mr_lock)); | |
897 | - mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino); | |
898 | - lockdep_set_class_and_name(&ip->i_iolock.mr_lock, | |
899 | - &xfs_iolock_reclaimable, "xfs_iolock_reclaimable"); | |
900 | 886 | |
901 | 887 | xfs_inactive(ip); |
902 | 888 | } |