aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/include/lustre_dlm_flags.h
diff options
context:
space:
mode:
authorBruce Korb <bruce.korb@gmail.com>2016-04-27 18:20:57 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-04-28 21:51:58 -0700
commit5a9a80baa78e730a27ea68e9ac8adbd86a23ec22 (patch)
treeb567a0de166a08a612f985d14497943b164b3580 /drivers/staging/lustre/lustre/include/lustre_dlm_flags.h
parentstaging: lustre: lmv: kernel crash due to misconfigured MDT (diff)
downloadlinux-dev-5a9a80baa78e730a27ea68e9ac8adbd86a23ec22.tar.xz
linux-dev-5a9a80baa78e730a27ea68e9ac8adbd86a23ec22.zip
staging: lustre: ldlm: use accessor macros for l_flags
Convert most of the ldlm lock's l_flags references from direct bit twiddling to using bit specific macros. A few multi-bit operations are left as an exercise for the reader. The changes are mostly in ldlm, but also in llite, osc and quota. Also add a multi-bit (mask) test. Signed-off-by: Bruce Korb <bruce.korb@gmail.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2906 Reviewed-by: Keith Mannthey <Keith.Mannthey@intel.com> Reviewed-on: http://review.whamcloud.com/7963 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/include/lustre_dlm_flags.h')
-rw-r--r--drivers/staging/lustre/lustre/include/lustre_dlm_flags.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm_flags.h b/drivers/staging/lustre/lustre/include/lustre_dlm_flags.h
index 7f2ba2ffe0eb..aff09049e8cd 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm_flags.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm_flags.h
@@ -381,6 +381,9 @@
/** test for ldlm_lock flag bit set */
#define LDLM_TEST_FLAG(_l, _b) (((_l)->l_flags & (_b)) != 0)
+/** multi-bit test: are any of mask bits set? */
+#define LDLM_HAVE_MASK(_l, _m) ((_l)->l_flags & LDLM_FL_##_m##_MASK)
+
/** set a ldlm_lock flag bit */
#define LDLM_SET_FLAG(_l, _b) ((_l)->l_flags |= (_b))