[PATCH 1/4] xfs: change xfs_isilocked() to always use lockdep()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mr_writer is obsolete and the information it contains is accesible
from mr_lock.

Signed-off-by: Pavel Reichl <preichl@xxxxxxxxxx>
---
 fs/xfs/xfs_inode.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index c5077e6326c7..32fac6152dc3 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -352,13 +352,17 @@ xfs_isilocked(
 {
 	if (lock_flags & (XFS_ILOCK_EXCL|XFS_ILOCK_SHARED)) {
 		if (!(lock_flags & XFS_ILOCK_SHARED))
-			return !!ip->i_lock.mr_writer;
+			return !debug_locks ||
+				lockdep_is_held_type(&ip->i_lock.mr_lock, 0);
 		return rwsem_is_locked(&ip->i_lock.mr_lock);
 	}
 
 	if (lock_flags & (XFS_MMAPLOCK_EXCL|XFS_MMAPLOCK_SHARED)) {
 		if (!(lock_flags & XFS_MMAPLOCK_SHARED))
-			return !!ip->i_mmaplock.mr_writer;
+			return !debug_locks ||
+				lockdep_is_held_type(
+					&ip->i_mmaplock.mr_lock,
+					0);
 		return rwsem_is_locked(&ip->i_mmaplock.mr_lock);
 	}
 
-- 
2.24.1




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux