xfs: more lockdep whackamole with kmem_alloc*
[linux-2.6-microblaze.git] / fs / xfs / kmem.h
index 6143117..34cbcfd 100644 (file)
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (c) 2000-2005 Silicon Graphics, Inc.
  * All Rights Reserved.
@@ -19,6 +19,7 @@ typedef unsigned __bitwise xfs_km_flags_t;
 #define KM_NOFS                ((__force xfs_km_flags_t)0x0004u)
 #define KM_MAYFAIL     ((__force xfs_km_flags_t)0x0008u)
 #define KM_ZERO                ((__force xfs_km_flags_t)0x0010u)
+#define KM_NOLOCKDEP   ((__force xfs_km_flags_t)0x0020u)
 
 /*
  * We use a special process flag to avoid recursive callbacks into
@@ -30,7 +31,7 @@ kmem_flags_convert(xfs_km_flags_t flags)
 {
        gfp_t   lflags;
 
-       BUG_ON(flags & ~(KM_NOFS|KM_MAYFAIL|KM_ZERO));
+       BUG_ON(flags & ~(KM_NOFS | KM_MAYFAIL | KM_ZERO | KM_NOLOCKDEP));
 
        lflags = GFP_KERNEL | __GFP_NOWARN;
        if (flags & KM_NOFS)
@@ -49,6 +50,9 @@ kmem_flags_convert(xfs_km_flags_t flags)
        if (flags & KM_ZERO)
                lflags |= __GFP_ZERO;
 
+       if (flags & KM_NOLOCKDEP)
+               lflags |= __GFP_NOLOCKDEP;
+
        return lflags;
 }