- /* If either of the compat_queue()s returned 0, then we
- * have ASTs to send and must go onto the waiting list.
- *
- * bug 2322: we used to unlink and re-add here, which was a
- * terrible folly -- if we goto restart, we could get
- * re-ordered! Causes deadlock, because ASTs aren't sent! */
- if (cfs_list_empty(&lock->l_res_link))
- ldlm_resource_add_lock(res, &res->lr_waiting, lock);
- unlock_res(res);
- rc = ldlm_run_ast_work(&rpc_list, LDLM_WORK_BL_AST);
- lock_res(res);
- if (rc == -ERESTART)
- GOTO(restart, -ERESTART);
- *flags |= LDLM_FL_BLOCK_GRANTED;
- } else {
- ldlm_resource_unlink_lock(lock);
- ldlm_grant_lock(lock, NULL);
- }
- RETURN(0);
+ rc = ldlm_handle_conflict_lock(lock, flags, &rpc_list, 0);
+ if (rc == -ERESTART)
+ GOTO(restart, rc);
+ *err = rc;
+ } else {
+ ldlm_resource_unlink_lock(lock);
+ ldlm_grant_lock(lock, work_list);
+ rc = 0;
+ }
+
+ if (!list_empty(&rpc_list))
+ ldlm_discard_bl_list(&rpc_list);
+
+ RETURN(rc);
+}
+#endif /* HAVE_SERVER_SUPPORT */
+
+void ldlm_plain_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy,
+ union ldlm_policy_data *lpolicy)
+{
+ /* No policy for plain locks */
+}
+
+void ldlm_plain_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
+ union ldlm_wire_policy_data *wpolicy)
+{
+ /* No policy for plain locks */