EXIT;
}
+#ifdef HAVE_SERVER_SUPPORT
/**
* POSIX locks deadlock detection code.
*
struct obd_export *exp;
};
-static int ldlm_flock_lookup_cb(struct cfs_hash *hs, struct cfs_hash_bd *bd,
- struct hlist_node *hnode, void *data)
+static int ldlm_flock_lookup_cb(struct obd_export *exp, void *data)
{
struct ldlm_flock_lookup_cb_data *cb_data = data;
- struct obd_export *exp = cfs_hash_object(hs, hnode);
struct ldlm_lock *lock;
+ if (exp->exp_failed)
+ return 0;
+
lock = cfs_hash_lookup(exp->exp_flock_hash, cb_data->bl_owner);
if (lock == NULL)
return 0;
.lock = NULL,
.exp = NULL,
};
+ struct ptlrpc_connection *bl_exp_conn;
struct obd_export *bl_exp_new;
struct ldlm_lock *lock = NULL;
struct ldlm_flock *flock;
+ bl_exp_conn = bl_exp->exp_connection;
if (bl_exp->exp_flock_hash != NULL) {
- cfs_hash_for_each_key(
- bl_exp->exp_obd->obd_nid_hash,
- &bl_exp->exp_connection->c_peer.nid,
- ldlm_flock_lookup_cb, &cb_data);
- lock = cb_data.lock;
+ int found;
+
+ found = obd_nid_export_for_each(bl_exp->exp_obd,
+ bl_exp_conn->c_peer.nid,
+ ldlm_flock_lookup_cb,
+ &cb_data);
+ if (found)
+ lock = cb_data.lock;
}
if (lock == NULL)
break;
break;
if (bl_owner == req_owner &&
- (bl_exp->exp_connection->c_peer.nid ==
+ (bl_exp_conn->c_peer.nid ==
req_exp->exp_connection->c_peer.nid)) {
class_export_put(bl_exp);
return 1;
ldlm_add_ast_work_item(lock, NULL, work_list);
}
}
+#endif /* HAVE_SERVER_SUPPORT */
/**
* Process a granting attempt for flock lock.
int overlaps = 0;
int splitted = 0;
const struct ldlm_callback_suite null_cbs = { NULL };
+#ifdef HAVE_SERVER_SUPPORT
struct list_head *grant_work = (intention == LDLM_PROCESS_ENQUEUE ?
NULL : work_list);
+#endif
ENTRY;
CDEBUG(D_DLMTRACE, "flags %#llx owner %llu pid %u mode %u start "
break;
}
}
- } else {
+ }
+#ifdef HAVE_SERVER_SUPPORT
+ else {
int reprocess_failed = 0;
lockmode_verify(mode);
* deadlock detection hash list.
*/
ldlm_flock_blocking_unlink(req);
+#endif /* HAVE_SERVER_SUPPORT */
/* Scan the locks owned by this process that overlap this request.
* We may have to merge or split existing locks.
*/
-
if (!ownlocks)
ownlocks = &res->lr_granted;
* LDLM_PROCESS_ENQUEUE from ldlm_reprocess_queue.
*/
if ((mode == LCK_NL) && overlaps) {
- struct list_head rpc_list;
+ LIST_HEAD(rpc_list);
int rc;
- INIT_LIST_HEAD(&rpc_list);
restart:
ldlm_reprocess_queue(res, &res->lr_waiting,
&rpc_list,
if (ldlm_is_test_lock(lock) || ldlm_is_flock_deadlock(lock))
mode = getlk->fl_type;
else
- mode = lock->l_granted_mode;
+ mode = lock->l_req_mode;
if (ldlm_is_flock_deadlock(lock)) {
LDLM_DEBUG(lock, "client-side enqueue deadlock "