if (!res)
LBUG();
+ l_lock(&res->lr_namespace->ns_lock);
policy_internal(&res->lr_granted, req_ex, &new_ex, mode);
policy_internal(&res->lr_converting, req_ex, &new_ex, mode);
policy_internal(&res->lr_waiting, req_ex, &new_ex, mode);
+ l_unlock(&res->lr_namespace->ns_lock);
memcpy(&lock->l_extent, &new_ex, sizeof(new_ex));
lock->l_cookie = cookie;
lock->l_cookie_len = cookie_len;
+ l_lock(&res->lr_namespace->ns_lock);
if (local && lock->l_req_mode == lock->l_granted_mode) {
/* The server returned a blocked lock, but it was granted before
* we got a chance to actually enqueue it. We don't need to do
ldlm_grant_lock(lock);
EXIT;
out:
+ l_unlock(&res->lr_namespace->ns_lock);
/* Don't set 'completion_ast' until here so that if the lock is granted
* immediately we don't do an unnecessary completion call. */
lock->l_completion_ast = completion;
} else {
/* FIXME: We should try the conversion right away and possibly
* return success without the need for an extra AST */
- list_add_tail(&lock->l_res_link, &res->lr_converting);
+ ldlm_resource_add_lock(res, res->lr_converting.prev, lock);
*flags |= LDLM_FL_BLOCK_CONV;
}