From 435d260547ad9cc81c1f800a025f541d74dcc363 Mon Sep 17 00:00:00 2001 From: shaver Date: Mon, 19 Aug 2002 21:18:28 +0000 Subject: [PATCH] Replace ldlm_lock's connection handle with an export handle. (Always NULL on the client side.) --- lustre/include/linux/lustre_dlm.h | 2 +- lustre/ldlm/ldlm_lock.c | 8 ++++---- lustre/ldlm/ldlm_lockd.c | 11 ++++++----- lustre/ldlm/ldlm_request.c | 4 +--- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/lustre/include/linux/lustre_dlm.h b/lustre/include/linux/lustre_dlm.h index 2efb93e..5c3413c 100644 --- a/lustre/include/linux/lustre_dlm.h +++ b/lustre/include/linux/lustre_dlm.h @@ -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; diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index 80a6fcf..ed5a3c3 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -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"); diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 5d0c92f..0fca880 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -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) diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 2b83255..c50bb47 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -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); -- 1.8.3.1