]> git.hungrycats.org Git - linux/commitdiff
[XFS] Fix up mrlock debug code, and ensure its only built under DEBUG.
authorNathan Scott <nathans@sgi.com>
Thu, 1 Apr 2004 20:35:23 +0000 (06:35 +1000)
committerNathan Scott <nathans@sgi.com>
Thu, 1 Apr 2004 20:35:23 +0000 (06:35 +1000)
SGI Modid: xfs-linux:xfs-kern:167944a

fs/xfs/linux/mrlock.h

index 14aeeef3b23b47feeb98f10f010b7403f77fb6ff..d2c11a098ff26cf2364bac11126d32b76084e0bd 100644 (file)
@@ -88,6 +88,7 @@ static inline void mrdemote(mrlock_t *mrp)
        downgrade_write(&mrp->mr_lock);
 }
 
+#ifdef DEBUG
 /*
  * Debug-only routine, without some platform-specific asm code, we can
  * now only answer requests regarding whether we hold the lock for write
@@ -96,9 +97,10 @@ static inline void mrdemote(mrlock_t *mrp)
  */
 static inline int ismrlocked(mrlock_t *mrp, int type)
 {
-       if (type == MR_UPDATE)
+       if (mrp && type == MR_UPDATE)
                return mrp->mr_writer;
        return 1;
 }
+#endif
 
 #endif /* __XFS_SUPPORT_MRLOCK_H__ */