diff options
| -rw-r--r-- | fs/xfs/xfs_iget.c | 15 | ||||
| -rw-r--r-- | fs/xfs/xfs_inode.h | 2 | ||||
| -rw-r--r-- | fs/xfs/xfs_super.c | 18 |
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 | */ | ||
| 51 | static struct lock_class_key xfs_iolock_active; | ||
| 52 | struct lock_class_key xfs_iolock_reclaimable; | ||
| 53 | |||
| 54 | /* | ||
| 55 | * Allocate and initialise an xfs_inode. | 44 | * Allocate and initialise an xfs_inode. |
| 56 | */ | 45 | */ |
| 57 | STATIC struct xfs_inode * | 46 | STATIC 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 | ||
| 490 | extern 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 | ||
