Whamcloud - gitweb
LU-11359 mdt: fix mdt_dom_discard_data() timeouts
[fs/lustre-release.git] / lustre / ldlm / ldlm_request.c
index bfbf599..ac63e69 100644 (file)
@@ -150,6 +150,19 @@ int ldlm_expired_completion_wait(void *data)
        RETURN(0);
 }
 
+int is_granted_or_cancelled_nolock(struct ldlm_lock *lock)
+{
+       int ret = 0;
+
+       check_res_locked(lock->l_resource);
+       if (ldlm_is_granted(lock) && !ldlm_is_cp_reqd(lock))
+               ret = 1;
+       else if (ldlm_is_failed(lock) || ldlm_is_cancel(lock))
+               ret = 1;
+       return ret;
+}
+EXPORT_SYMBOL(is_granted_or_cancelled_nolock);
+
 /**
  * Calculate the Completion timeout (covering enqueue, BL AST, data flush,
  * lock cancel, and their replies). Used for lock completion timeout on the