xfs: remove XFS_ILOCK_RT*
authorDarrick J. Wong <djwong@kernel.org>
Mon, 4 Nov 2024 04:19:11 +0000 (20:19 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 5 Nov 2024 21:38:37 +0000 (13:38 -0800)
Now that we've centralized the realtime metadata locking routines, get
rid of the ILOCK subclasses since we now use explicit lockdep classes.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_inode.c
fs/xfs/xfs_inode.h
fs/xfs/xfs_rtalloc.c

index 103cf8b..c8ad260 100644 (file)
@@ -342,8 +342,7 @@ xfs_lock_inumorder(
 {
        uint    class = 0;
 
-       ASSERT(!(lock_mode & (XFS_ILOCK_PARENT | XFS_ILOCK_RTBITMAP |
-                             XFS_ILOCK_RTSUM)));
+       ASSERT(!(lock_mode & XFS_ILOCK_PARENT));
        ASSERT(xfs_lockdep_subclass_ok(subclass));
 
        if (lock_mode & (XFS_IOLOCK_SHARED|XFS_IOLOCK_EXCL)) {
index b6e9595..2a4485f 100644 (file)
@@ -448,9 +448,8 @@ static inline bool xfs_inode_has_bigrtalloc(const struct xfs_inode *ip)
  * However, MAX_LOCKDEP_SUBCLASSES == 8, which means we are greatly
  * limited to the subclasses we can represent via nesting. We need at least
  * 5 inodes nest depth for the ILOCK through rename, and we also have to support
- * XFS_ILOCK_PARENT, which gives 6 subclasses. Then we have XFS_ILOCK_RTBITMAP
- * and XFS_ILOCK_RTSUM, which are another 2 unique subclasses, so that's all
- * 8 subclasses supported by lockdep.
+ * XFS_ILOCK_PARENT, which gives 6 subclasses.  That's 6 of the 8 subclasses
+ * supported by lockdep.
  *
  * This also means we have to number the sub-classes in the lowest bits of
  * the mask we keep, and we have to ensure we never exceed 3 bits of lockdep
@@ -476,8 +475,8 @@ static inline bool xfs_inode_has_bigrtalloc(const struct xfs_inode *ip)
  * ILOCK values
  * 0-4         subclass values
  * 5           PARENT subclass (not nestable)
- * 6           RTBITMAP subclass (not nestable)
- * 7           RTSUM subclass (not nestable)
+ * 6           unused
+ * 7           unused
  * 
  */
 #define XFS_IOLOCK_SHIFT               16
@@ -492,12 +491,8 @@ static inline bool xfs_inode_has_bigrtalloc(const struct xfs_inode *ip)
 #define XFS_ILOCK_SHIFT                        24
 #define XFS_ILOCK_PARENT_VAL           5u
 #define XFS_ILOCK_MAX_SUBCLASS         (XFS_ILOCK_PARENT_VAL - 1)
-#define XFS_ILOCK_RTBITMAP_VAL         6u
-#define XFS_ILOCK_RTSUM_VAL            7u
 #define XFS_ILOCK_DEP_MASK             0xff000000u
 #define        XFS_ILOCK_PARENT                (XFS_ILOCK_PARENT_VAL << XFS_ILOCK_SHIFT)
-#define        XFS_ILOCK_RTBITMAP              (XFS_ILOCK_RTBITMAP_VAL << XFS_ILOCK_SHIFT)
-#define        XFS_ILOCK_RTSUM                 (XFS_ILOCK_RTSUM_VAL << XFS_ILOCK_SHIFT)
 
 #define XFS_LOCK_SUBCLASS_MASK (XFS_IOLOCK_DEP_MASK | \
                                 XFS_MMAPLOCK_DEP_MASK | \
index 5c1df67..7f3b5e2 100644 (file)
@@ -1189,12 +1189,11 @@ xfs_rtalloc_reinit_frextents(
 static inline int
 xfs_rtmount_iread_extents(
        struct xfs_trans        *tp,
-       struct xfs_inode        *ip,
-       unsigned int            lock_class)
+       struct xfs_inode        *ip)
 {
        int                     error;
 
-       xfs_ilock(ip, XFS_ILOCK_EXCL | lock_class);
+       xfs_ilock(ip, XFS_ILOCK_EXCL);
 
        error = xfs_iread_extents(tp, ip, XFS_DATA_FORK);
        if (error)
@@ -1207,7 +1206,7 @@ xfs_rtmount_iread_extents(
        }
 
 out_unlock:
-       xfs_iunlock(ip, XFS_ILOCK_EXCL | lock_class);
+       xfs_iunlock(ip, XFS_ILOCK_EXCL);
        return error;
 }
 
@@ -1228,7 +1227,7 @@ xfs_rtmount_rtg(
 
                if (rtg->rtg_inodes[i]) {
                        error = xfs_rtmount_iread_extents(tp,
-                                       rtg->rtg_inodes[i], 0);
+                                       rtg->rtg_inodes[i]);
                        if (error)
                                return error;
                }