Whamcloud - gitweb
- Rename ldlm_namespace_cleanup's "local" parameter to "local_only" for clarity.
authorshaver <shaver>
Sat, 19 Oct 2002 11:09:16 +0000 (11:09 +0000)
committershaver <shaver>
Sat, 19 Oct 2002 11:09:16 +0000 (11:09 +0000)
- Remove spurious LBUG() or two.
- Export the cleanup and dump symbols we use in recovery.

lustre/include/linux/lustre_dlm.h
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_lockd.c
lustre/ldlm/ldlm_request.c
lustre/ldlm/ldlm_resource.c

index 454b589..3bd8320 100644 (file)
@@ -338,7 +338,7 @@ int ldlm_regression_stop(void);
 
 /* resource.c */
 struct ldlm_namespace *ldlm_namespace_new(char *name, __u32 local);
-int ldlm_namespace_cleanup(struct ldlm_namespace *ns, int local);
+int ldlm_namespace_cleanup(struct ldlm_namespace *ns, int local_only);
 int ldlm_namespace_free(struct ldlm_namespace *ns);
 int ldlm_proc_setup(struct obd_device *obd);
 void ldlm_proc_cleanup(struct obd_device *obd);
index b6df7fe..065edd9 100644 (file)
@@ -192,7 +192,6 @@ void ldlm_lock_destroy(struct ldlm_lock *lock)
         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)) {
@@ -862,7 +861,7 @@ void ldlm_cancel_locks_for_export(struct obd_export *exp)
                 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);
index 1f7b0dd..a6abc5e 100644 (file)
@@ -56,8 +56,8 @@ static void waiting_locks_callback(unsigned long unused)
                                                  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);
@@ -707,7 +707,9 @@ EXPORT_SYMBOL(ldlm_regression_start);
 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);
index af7f9a9..90ca711 100644 (file)
@@ -49,23 +49,6 @@ static int expired_completion_wait(void *data)
         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 =
index 5434363..b7f386a 100644 (file)
@@ -120,9 +120,9 @@ struct ldlm_namespace *ldlm_namespace_new(char *name, __u32 client)
 
 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;
@@ -136,13 +136,13 @@ static void cleanup_resource(struct ldlm_resource *res, struct list_head *q,
                 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 "
@@ -155,7 +155,7 @@ static void cleanup_resource(struct ldlm_resource *res, struct list_head *q,
         }
 }
 
-int ldlm_namespace_cleanup(struct ldlm_namespace *ns, int local)
+int ldlm_namespace_cleanup(struct ldlm_namespace *ns, int local_only)
 {
         int i;
 
@@ -167,11 +167,11 @@ int ldlm_namespace_cleanup(struct ldlm_namespace *ns, int local)
                         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));