aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2012-07-04 11:13:33 -0400
committerBen Myers <bpm@sgi.com>2012-07-29 17:23:51 -0400
commit4f59af758f9092bc7b266ca919ce6067170e5172 (patch)
tree1d406a2762a20ee23bf2acd41202ff0e8b350cc8 /fs/xfs
parent5a15322da1a51ad8f3af1962de355885b6c606f2 (diff)
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>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_iget.c15
-rw-r--r--fs/xfs/xfs_inode.h2
-rw-r--r--fs/xfs/xfs_super.c18
3 files changed, 2 insertions, 33 deletions
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
index 1bb4365e8c25..784a803383ec 100644
--- a/fs/xfs/xfs_iget.c
+++ b/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 */
51static struct lock_class_key xfs_iolock_active;
52struct lock_class_key xfs_iolock_reclaimable;
53
54/*
55 * Allocate and initialise an xfs_inode. 44 * Allocate and initialise an xfs_inode.
56 */ 45 */
57STATIC struct xfs_inode * 46STATIC struct xfs_inode *
@@ -80,8 +69,6 @@ xfs_inode_alloc(
80 ASSERT(ip->i_ino == 0); 69 ASSERT(ip->i_ino == 0);
81 70
82 mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino); 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 /* initialise the xfs inode */ 73 /* initialise the xfs inode */
87 ip->i_ino = ino; 74 ip->i_ino = ino;
@@ -250,8 +237,6 @@ xfs_iget_cache_hit(
250 237
251 ASSERT(!rwsem_is_locked(&ip->i_iolock.mr_lock)); 238 ASSERT(!rwsem_is_locked(&ip->i_iolock.mr_lock));
252 mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino); 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 spin_unlock(&ip->i_flags_lock); 241 spin_unlock(&ip->i_flags_lock);
257 spin_unlock(&pag->pag_ici_lock); 242 spin_unlock(&pag->pag_ici_lock);
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 04d2fe421b97..94b32f906e79 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -487,8 +487,6 @@ static inline int xfs_isiflocked(struct xfs_inode *ip)
487#define XFS_IOLOCK_DEP(flags) (((flags) & XFS_IOLOCK_DEP_MASK) >> XFS_IOLOCK_SHIFT) 487#define XFS_IOLOCK_DEP(flags) (((flags) & XFS_IOLOCK_DEP_MASK) >> XFS_IOLOCK_SHIFT)
488#define XFS_ILOCK_DEP(flags) (((flags) & XFS_ILOCK_DEP_MASK) >> XFS_ILOCK_SHIFT) 488#define XFS_ILOCK_DEP(flags) (((flags) & XFS_ILOCK_DEP_MASK) >> XFS_ILOCK_SHIFT)
489 489
490extern struct lock_class_key xfs_iolock_reclaimable;
491
492/* 490/*
493 * For multiple groups support: if S_ISGID bit is set in the parent 491 * For multiple groups support: if S_ISGID bit is set in the parent
494 * directory, group of new file is set to that of the parent, and 492 * directory, group of new file is set to that of the parent, and
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index cb2deb13b063..bdaf4cb9f4a2 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -874,6 +874,8 @@ xfs_fs_evict_inode(
874{ 874{
875 xfs_inode_t *ip = XFS_I(inode); 875 xfs_inode_t *ip = XFS_I(inode);
876 876
877 ASSERT(!rwsem_is_locked(&ip->i_iolock.mr_lock));
878
877 trace_xfs_evict_inode(ip); 879 trace_xfs_evict_inode(ip);
878 880
879 truncate_inode_pages(&inode->i_data, 0); 881 truncate_inode_pages(&inode->i_data, 0);
@@ -882,22 +884,6 @@ xfs_fs_evict_inode(
882 XFS_STATS_INC(vn_remove); 884 XFS_STATS_INC(vn_remove);
883 XFS_STATS_DEC(vn_active); 885 XFS_STATS_DEC(vn_active);
884 886
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
901 xfs_inactive(ip); 887 xfs_inactive(ip);
902} 888}
903 889