Whamcloud - gitweb
Replace ldlm_lock's connection handle with an export handle. (Always
authorshaver <shaver>
Mon, 19 Aug 2002 21:18:28 +0000 (21:18 +0000)
committershaver <shaver>
Mon, 19 Aug 2002 21:18:28 +0000 (21:18 +0000)
NULL on the client side.)

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

index 2efb93e..5c3413c 100644 (file)
@@ -126,7 +126,7 @@ struct ldlm_lock {
         ldlm_completion_callback    l_completion_ast;
         ldlm_blocking_callback    l_blocking_ast;
 
-        struct ptlrpc_connection *l_connection;
+        struct obd_export    *l_export;
         struct ptlrpc_client *l_client;
         struct lustre_handle *l_connh;
         __u32                 l_flags;
index 80a6fcf..ed5a3c3 100644 (file)
@@ -151,8 +151,8 @@ void ldlm_lock_put(struct ldlm_lock *lock)
         if (lock->l_refc == 0 && (lock->l_flags & LDLM_FL_DESTROYED)) {
                 lock->l_resource = NULL;
                 LDLM_DEBUG(lock, "final lock_put on destroyed lock, freeing");
-                if (lock->l_connection)
-                        ptlrpc_put_connection(lock->l_connection);
+                if (lock->l_export && lock->l_export->exp_connection)
+                        ptlrpc_put_connection(lock->l_export->exp_connection);
                 CDEBUG(D_MALLOC, "kfreed 'lock': %d at %p (tot 1).\n",
                        sizeof(*lock), lock);
                 kmem_cache_free(ldlm_lock_slab, lock);
@@ -845,9 +845,9 @@ void ldlm_lock_dump(struct ldlm_lock *lock)
                  lock->l_version[2], lock->l_version[3]);
 
         CDEBUG(D_OTHER, "  -- Lock dump: %p (%s)\n", lock, ver);
-        if (lock->l_connection)
+        if (lock->l_export && lock->l_export->exp_connection)
                 CDEBUG(D_OTHER, "  Node: NID %x (rhandle: %Lx)\n",
-                       lock->l_connection->c_peer.peer_nid,
+                       lock->l_export->exp_connection->c_peer.peer_nid,
                        lock->l_remote_handle.addr);
         else
                 CDEBUG(D_OTHER, "  Node: local\n");
index 5d0c92f..0fca880 100644 (file)
@@ -46,8 +46,8 @@ static int ldlm_server_blocking_ast(struct ldlm_lock *lock,
         ENTRY;
 
         cl = &lock->l_resource->lr_namespace->ns_rpc_client;
-        req = ptlrpc_prep_req(cl, lock->l_connection, LDLM_BL_CALLBACK, 1,
-                              &size, NULL);
+        req = ptlrpc_prep_req(cl, lock->l_export->exp_connection,
+                              LDLM_BL_CALLBACK, 1, &size, NULL);
         if (!req)
                 RETURN(-ENOMEM);
 
@@ -80,8 +80,8 @@ static int ldlm_server_completion_ast(struct ldlm_lock *lock, int flags)
         }
 
         cl = &lock->l_resource->lr_namespace->ns_rpc_client;
-        req = ptlrpc_prep_req(cl, lock->l_connection, LDLM_CP_CALLBACK, 1,
-                              &size, NULL);
+        req = ptlrpc_prep_req(cl, lock->l_export->exp_connection,
+                              LDLM_CP_CALLBACK, 1, &size, NULL);
         if (!req)
                 RETURN(-ENOMEM);
 
@@ -165,7 +165,8 @@ int ldlm_handle_enqueue(struct ptlrpc_request *req)
                 dlm_rep->lock_mode = lock->l_req_mode;
         }
 
-        lock->l_connection = ptlrpc_connection_addref(req->rq_connection);
+        lock->l_export = req->rq_export;
+        ptlrpc_connection_addref(req->rq_connection);
         EXIT;
  out:
         if (lock)
index 2b83255..c50bb47 100644 (file)
@@ -107,7 +107,6 @@ int ldlm_cli_enqueue(struct lustre_handle *connh,
                      __u32 data_len,
                      struct lustre_handle *lockh)
 {
-        struct ptlrpc_connection *connection;
         struct ldlm_lock *lock;
         struct ldlm_request *body;
         struct ldlm_reply *reply;
@@ -119,7 +118,6 @@ int ldlm_cli_enqueue(struct lustre_handle *connh,
                                               type, cookie, cookielen, mode,
                                               flags, completion, blocking, data,
                                               data_len, lockh);
-        connection = client_conn2cli(connh)->cl_conn;
 
         *flags = 0;
         lock = ldlm_lock_create(ns, parent_lock_handle, res_id, type, mode,
@@ -159,7 +157,7 @@ int ldlm_cli_enqueue(struct lustre_handle *connh,
                 req->rq_replen = lustre_msg_size(1, &size);
         }
         lock->l_connh = connh;
-        lock->l_connection = ptlrpc_connection_addref(connection);
+        lock->l_export = NULL;
         lock->l_client = client_conn2cli(connh)->cl_client;
 
         rc = ptlrpc_queue_wait(req);