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
LDLM_DEBUG(lock,
"client-side enqueue returned a blocked lock, going forward");
- ldlm_reprocess_all(lock->l_resource);
+ ldlm_reprocess_all(lock->l_resource, NULL);
RETURN(0);
}
EXPORT_SYMBOL(ldlm_completion_ast_async);
}
LDLM_DEBUG(lock, "server-side local cancel");
ldlm_lock_cancel(lock);
- ldlm_reprocess_all(lock->l_resource);
+ ldlm_reprocess_all(lock->l_resource, lock);
}
RETURN(rc);
*/
if (!(cancel_flags & LCF_BL_AST) && (rc == LDLM_FL_BL_AST)) {
LDLM_DEBUG(lock, "Cancel lock separately");
- list_del_init(&lock->l_bl_ast);
- list_add(&lock->l_bl_ast, &head);
+ list_move(&lock->l_bl_ast, &head);
bl_ast++;
continue;
}
/*
* If policy is given and this is IBITS lock, add to list only
* those locks that match by policy.
- * Skip locks with DoM bit always to don't flush data.
*/
- if (policy && (lock->l_resource->lr_type == LDLM_IBITS) &&
- (!(lock->l_policy_data.l_inodebits.bits &
- policy->l_inodebits.bits) || ldlm_has_dom(lock)))
- continue;
+ if (policy && (lock->l_resource->lr_type == LDLM_IBITS)) {
+ if (!(lock->l_policy_data.l_inodebits.bits &
+ policy->l_inodebits.bits))
+ continue;
+ /* Skip locks with DoM bit if it is not set in policy
+ * to don't flush data by side-bits. Lock convert will
+ * drop those bits separately.
+ */
+ if (ldlm_has_dom(lock) &&
+ !(policy->l_inodebits.bits & MDS_INODELOCK_DOM))
+ continue;
+ }
/* See CBPENDING comment in ldlm_cancel_lru */
lock->l_flags |= LDLM_FL_CBPENDING | LDLM_FL_CANCELING |