if (lock->l_readers || lock->l_writers) {
LDLM_DEBUG(lock, "lock still has references");
ldlm_lock_dump(lock);
- LBUG();
}
if (!list_empty(&lock->l_res_link)) {
struct ldlm_resource *res;
lock = list_entry(iter, struct ldlm_lock, l_export_chain);
res = ldlm_resource_getref(lock->l_resource);
- LDLM_DEBUG(lock, "cancelling lock for export %p", exp);
+ LDLM_DEBUG(lock, "export %p", exp);
ldlm_lock_cancel(lock);
ldlm_reprocess_all(res);
ldlm_resource_put(res);
l_pending_chain);
if (l->l_callback_timeout > jiffies)
break;
- LDLM_DEBUG(l, "timer expired, recovering conn %p",
- l->l_export->exp_connection);
+ LDLM_DEBUG(l, "timer expired, recovering exp %p on conn %p",
+ l->l_export, l->l_export->exp_connection);
recovd_conn_fail(l->l_export->exp_connection);
}
spin_unlock_bh(&waiting_locks_spinlock);
EXPORT_SYMBOL(ldlm_regression_stop);
EXPORT_SYMBOL(ldlm_lock_dump);
EXPORT_SYMBOL(ldlm_namespace_new);
+EXPORT_SYMBOL(ldlm_namespace_cleanup);
EXPORT_SYMBOL(ldlm_namespace_free);
+EXPORT_SYMBOL(ldlm_namespace_dump);
EXPORT_SYMBOL(ldlm_cancel_locks_for_export);
EXPORT_SYMBOL(l_lock);
EXPORT_SYMBOL(l_unlock);
RETURN(0);
}
-#if 0
-static int expired_completion_wait(void *data)
-{
- struct ldlm_lock *lock = data;
- struct ptlrpc_connection *conn =
- class_conn2cliimp(lock->l_connh)->imp_connection;
-
- if (!conn) {
- CERROR("lock %p has NULL import connection\n", lock);
- RETURN(1);
- }
-
- class_signal_connection_failure(conn);
- RETURN(0);
-}
-#endif
-
int ldlm_completion_ast(struct ldlm_lock *lock, int flags)
{
struct l_wait_info lwi =
extern struct ldlm_lock *ldlm_lock_get(struct ldlm_lock *lock);
-/* If 'local' is true, don't try to tell the server, just cleanup. */
+/* If 'local_only' is true, don't try to tell the server, just cleanup. */
static void cleanup_resource(struct ldlm_resource *res, struct list_head *q,
- int local)
+ int local_only)
{
struct list_head *tmp, *pos;
int rc = 0, client = res->lr_namespace->ns_client;
if (client) {
struct lustre_handle lockh;
ldlm_lock2handle(lock, &lockh);
- if (!local) {
+ if (!local_only) {
rc = ldlm_cli_cancel(&lockh);
if (rc)
CERROR("ldlm_cli_cancel: %d\n", rc);
}
/* Force local cleanup on errors, too. */
- if (local || rc != ELDLM_OK)
+ if (local_only || rc != ELDLM_OK)
ldlm_lock_cancel(lock);
} else {
LDLM_DEBUG(lock, "Freeing a lock still held by a "
}
}
-int ldlm_namespace_cleanup(struct ldlm_namespace *ns, int local)
+int ldlm_namespace_cleanup(struct ldlm_namespace *ns, int local_only)
{
int i;
res = list_entry(tmp, struct ldlm_resource, lr_hash);
ldlm_resource_getref(res);
- cleanup_resource(res, &res->lr_granted, local);
- cleanup_resource(res, &res->lr_converting, local);
- cleanup_resource(res, &res->lr_waiting, local);
+ cleanup_resource(res, &res->lr_granted, local_only);
+ cleanup_resource(res, &res->lr_converting, local_only);
+ cleanup_resource(res, &res->lr_waiting, local_only);
- if (!ldlm_resource_put(res)) {
+ if (!ldlm_resource_put(res) && !local_only) {
CERROR("Resource refcount nonzero (%d) after "
"lock cleanup; forcing cleanup.\n",
atomic_read(&res->lr_refcount));