X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fldlm%2Fldlm_internal.h;h=c01a7022542dc72be231cbddff60656c10e3381e;hb=510b04494f3271675da53048f5987867e507f083;hp=5332b2f66096d1cd832b6812b620c773e0f528a2;hpb=fbf5870b9848929d352460f1f005b79c0b5ccc5a;p=fs%2Flustre-release.git diff --git a/lustre/ldlm/ldlm_internal.h b/lustre/ldlm/ldlm_internal.h index 5332b2f..c01a702 100644 --- a/lustre/ldlm/ldlm_internal.h +++ b/lustre/ldlm/ldlm_internal.h @@ -79,8 +79,6 @@ int ldlm_cancel_lru(struct ldlm_namespace *ns, int nr, ldlm_sync_t sync, int flags); int ldlm_cancel_lru_local(struct ldlm_namespace *ns, struct list_head *cancels, int count, int max, int cancel_flags, int flags); -int ldlm_cancel_lru_estimate(struct ldlm_namespace *ns, int count, int max, - int flags); extern int ldlm_enqueue_min; int ldlm_get_enq_timeout(struct ldlm_lock *lock); @@ -239,3 +237,17 @@ typedef enum ldlm_policy_res ldlm_policy_res_t; return rc; \ } \ struct __##var##__dummy_write {;} /* semicolon catcher */ + +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)) + ret = 1; + unlock_res_and_lock(lock); + + return ret; +}