Skip to content

Commit c1442d2

Browse files
author
Darrick J. Wong
committed
xfs: remove XFS_ILOCK_RT*
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent ae897e0 commit c1442d2

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

fs/xfs/xfs_inode.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,7 @@ xfs_lock_inumorder(
342342
{
343343
uint class = 0;
344344

345-
ASSERT(!(lock_mode & (XFS_ILOCK_PARENT | XFS_ILOCK_RTBITMAP |
346-
XFS_ILOCK_RTSUM)));
345+
ASSERT(!(lock_mode & XFS_ILOCK_PARENT));
347346
ASSERT(xfs_lockdep_subclass_ok(subclass));
348347

349348
if (lock_mode & (XFS_IOLOCK_SHARED|XFS_IOLOCK_EXCL)) {

fs/xfs/xfs_inode.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,8 @@ static inline bool xfs_inode_has_bigrtalloc(const struct xfs_inode *ip)
448448
* However, MAX_LOCKDEP_SUBCLASSES == 8, which means we are greatly
449449
* limited to the subclasses we can represent via nesting. We need at least
450450
* 5 inodes nest depth for the ILOCK through rename, and we also have to support
451-
* XFS_ILOCK_PARENT, which gives 6 subclasses. Then we have XFS_ILOCK_RTBITMAP
452-
* and XFS_ILOCK_RTSUM, which are another 2 unique subclasses, so that's all
453-
* 8 subclasses supported by lockdep.
451+
* XFS_ILOCK_PARENT, which gives 6 subclasses. That's 6 of the 8 subclasses
452+
* supported by lockdep.
454453
*
455454
* This also means we have to number the sub-classes in the lowest bits of
456455
* 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)
476475
* ILOCK values
477476
* 0-4 subclass values
478477
* 5 PARENT subclass (not nestable)
479-
* 6 RTBITMAP subclass (not nestable)
480-
* 7 RTSUM subclass (not nestable)
478+
* 6 unused
479+
* 7 unused
481480
*
482481
*/
483482
#define XFS_IOLOCK_SHIFT 16
@@ -492,12 +491,8 @@ static inline bool xfs_inode_has_bigrtalloc(const struct xfs_inode *ip)
492491
#define XFS_ILOCK_SHIFT 24
493492
#define XFS_ILOCK_PARENT_VAL 5u
494493
#define XFS_ILOCK_MAX_SUBCLASS (XFS_ILOCK_PARENT_VAL - 1)
495-
#define XFS_ILOCK_RTBITMAP_VAL 6u
496-
#define XFS_ILOCK_RTSUM_VAL 7u
497494
#define XFS_ILOCK_DEP_MASK 0xff000000u
498495
#define XFS_ILOCK_PARENT (XFS_ILOCK_PARENT_VAL << XFS_ILOCK_SHIFT)
499-
#define XFS_ILOCK_RTBITMAP (XFS_ILOCK_RTBITMAP_VAL << XFS_ILOCK_SHIFT)
500-
#define XFS_ILOCK_RTSUM (XFS_ILOCK_RTSUM_VAL << XFS_ILOCK_SHIFT)
501496

502497
#define XFS_LOCK_SUBCLASS_MASK (XFS_IOLOCK_DEP_MASK | \
503498
XFS_MMAPLOCK_DEP_MASK | \

fs/xfs/xfs_rtalloc.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,12 +1189,11 @@ xfs_rtalloc_reinit_frextents(
11891189
static inline int
11901190
xfs_rtmount_iread_extents(
11911191
struct xfs_trans *tp,
1192-
struct xfs_inode *ip,
1193-
unsigned int lock_class)
1192+
struct xfs_inode *ip)
11941193
{
11951194
int error;
11961195

1197-
xfs_ilock(ip, XFS_ILOCK_EXCL | lock_class);
1196+
xfs_ilock(ip, XFS_ILOCK_EXCL);
11981197

11991198
error = xfs_iread_extents(tp, ip, XFS_DATA_FORK);
12001199
if (error)
@@ -1207,7 +1206,7 @@ xfs_rtmount_iread_extents(
12071206
}
12081207

12091208
out_unlock:
1210-
xfs_iunlock(ip, XFS_ILOCK_EXCL | lock_class);
1209+
xfs_iunlock(ip, XFS_ILOCK_EXCL);
12111210
return error;
12121211
}
12131212

@@ -1228,7 +1227,7 @@ xfs_rtmount_rtg(
12281227

12291228
if (rtg->rtg_inodes[i]) {
12301229
error = xfs_rtmount_iread_extents(tp,
1231-
rtg->rtg_inodes[i], 0);
1230+
rtg->rtg_inodes[i]);
12321231
if (error)
12331232
return error;
12341233
}

0 commit comments

Comments
 (0)