summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
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/ldlm/ldlm_resource.c
parent0fdd2b8d7cec9fc4e4b6d0e7db2de98148ca37ba (diff)
downloadop-kernel-dev-5a9a80baa78e730a27ea68e9ac8adbd86a23ec22.zip
op-kernel-dev-5a9a80baa78e730a27ea68e9ac8adbd86a23ec22.tar.gz
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/ldlm/ldlm_resource.c')
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_resource.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index 242a664..475fabb 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -758,12 +758,12 @@ static void cleanup_resource(struct ldlm_resource *res, struct list_head *q,
list_for_each(tmp, q) {
lock = list_entry(tmp, struct ldlm_lock,
l_res_link);
- if (lock->l_flags & LDLM_FL_CLEANED) {
+ if (ldlm_is_cleaned(lock)) {
lock = NULL;
continue;
}
LDLM_LOCK_GET(lock);
- lock->l_flags |= LDLM_FL_CLEANED;
+ ldlm_set_cleaned(lock);
break;
}
@@ -775,13 +775,13 @@ static void cleanup_resource(struct ldlm_resource *res, struct list_head *q,
/* Set CBPENDING so nothing in the cancellation path
* can match this lock.
*/
- lock->l_flags |= LDLM_FL_CBPENDING;
- lock->l_flags |= LDLM_FL_FAILED;
+ ldlm_set_cbpending(lock);
+ ldlm_set_failed(lock);
lock->l_flags |= flags;
/* ... without sending a CANCEL message for local_only. */
if (local_only)
- lock->l_flags |= LDLM_FL_LOCAL_ONLY;
+ ldlm_set_local_only(lock);
if (local_only && (lock->l_readers || lock->l_writers)) {
/* This is a little bit gross, but much better than the
@@ -1275,7 +1275,7 @@ void ldlm_resource_add_lock(struct ldlm_resource *res, struct list_head *head,
LDLM_DEBUG(lock, "About to add this lock:\n");
- if (lock->l_flags & LDLM_FL_DESTROYED) {
+ if (ldlm_is_destroyed(lock)) {
CDEBUG(D_OTHER, "Lock destroyed, not adding to resource\n");
return;
}
OpenPOWER on IntegriCloud