diff options
author | Bruce Korb <bruce.korb@gmail.com> | 2016-04-27 18:20:57 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-28 21:51:58 -0700 |
commit | 5a9a80baa78e730a27ea68e9ac8adbd86a23ec22 (patch) | |
tree | b567a0de166a08a612f985d14497943b164b3580 /drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | |
parent | 0fdd2b8d7cec9fc4e4b6d0e7db2de98148ca37ba (diff) | |
download | op-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_internal.h')
-rw-r--r-- | drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h index ba643e6..32f227f 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h @@ -305,9 +305,10 @@ static inline int is_granted_or_cancelled(struct ldlm_lock *lock) int ret = 0; lock_res_and_lock(lock); - if (((lock->l_req_mode == lock->l_granted_mode) && - !(lock->l_flags & LDLM_FL_CP_REQD)) || - (lock->l_flags & (LDLM_FL_FAILED | LDLM_FL_CANCEL))) + if ((lock->l_req_mode == lock->l_granted_mode) && + !ldlm_is_cp_reqd(lock)) + ret = 1; + else if (ldlm_is_failed(lock) || ldlm_is_cancel(lock)) ret = 1; unlock_res_and_lock(lock); |