From 174b5a991e51ed1f22b9c444374130766d5b2511 Mon Sep 17 00:00:00 2001 From: pschwan Date: Mon, 24 Jun 2002 05:52:20 +0000 Subject: [PATCH] compilation cleanups --- lustre/include/linux/lustre_dlm.h | 13 +++++++------ lustre/ldlm/ldlm_lockd.c | 22 ++++++++++------------ lustre/ldlm/ldlm_request.c | 13 ++++++------- lustre/ldlm/ldlm_resource.c | 4 +++- lustre/ldlm/ldlm_test.c | 4 ++-- lustre/llite/file.c | 4 +++- 6 files changed, 31 insertions(+), 29 deletions(-) diff --git a/lustre/include/linux/lustre_dlm.h b/lustre/include/linux/lustre_dlm.h index 00393dd..9f416e3 100644 --- a/lustre/include/linux/lustre_dlm.h +++ b/lustre/include/linux/lustre_dlm.h @@ -32,7 +32,7 @@ typedef enum { #define LDLM_FL_BLOCK_WAIT (1 << 3) #define LDLM_FL_CBPENDING (1 << 4) #define LDLM_FL_AST_SENT (1 << 5) -#define LDLM_FL_DESTROYED (1 << 6) +#define LDLM_FL_DESTROYED (1 << 6) #define L2B(c) (1 << c) @@ -203,15 +203,16 @@ int ldlm_extent_policy(struct ldlm_lock *, void *, ldlm_mode_t, void *); /* ldlm_lock.c */ struct ldlm_lock *ldlm_handle2lock(struct lustre_handle *handle); +void ldlm_lock2handle(struct ldlm_lock *lock, struct lustre_handle *lockh); void ldlm_lock_put(struct ldlm_lock *lock); void ldlm_lock_free(struct ldlm_lock *lock); void ldlm_lock2desc(struct ldlm_lock *lock, struct ldlm_lock_desc *desc); void ldlm_lock_addref(struct ldlm_lock *lock, __u32 mode); void ldlm_lock_decref(struct ldlm_lock *lock, __u32 mode); void ldlm_grant_lock(struct ldlm_lock *lock); -int ldlm_match(struct ldlm_namespace *ns, __u64 *res_id, __u32 type, - void *cookie, int cookielen, ldlm_mode_t mode, - struct lustre_handle *lockh); +int ldlm_lock_match(struct ldlm_namespace *ns, __u64 *res_id, __u32 type, + void *cookie, int cookielen, ldlm_mode_t mode, + struct lustre_handle *lockh); struct ldlm_lock * ldlm_lock_create(struct ldlm_namespace *ns, struct lustre_handle *parent_lock_handle, @@ -262,11 +263,11 @@ int ldlm_cli_enqueue(struct ptlrpc_client *cl, void *data, __u32 data_len, struct lustre_handle *lockh); -int ldlm_cli_callback(struct ldlm_lock *lock, struct ldlm_lock *new, +int ldlm_cli_callback(struct ldlm_lock *lock, struct ldlm_lock_desc *new, void *data, __u32 data_len, struct ptlrpc_request **reqp); int ldlm_cli_convert(struct ptlrpc_client *, struct lustre_handle *, int new_mode, int *flags); -int ldlm_cli_cancel(struct ptlrpc_client *, struct ldlm_lock *); +int ldlm_cli_cancel(struct ptlrpc_client *, struct lustre_handle *); #endif /* __KERNEL__ */ diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index da992b6..f81a7a2 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -54,12 +54,11 @@ static int ldlm_handle_enqueue(struct obd_device *obddev, struct ptlrpc_service } } - lock = ldlm_local_lock_create(obddev->obd_namespace, - &dlm_req->lock_handle2, - dlm_req->lock_desc.l_resource.lr_name, - dlm_req->lock_desc.l_resource.lr_type, - dlm_req->lock_desc.l_req_mode, - NULL, 0); + lock = ldlm_lock_create(obddev->obd_namespace, + &dlm_req->lock_handle2, + dlm_req->lock_desc.l_resource.lr_name, + dlm_req->lock_desc.l_resource.lr_type, + dlm_req->lock_desc.l_req_mode, NULL, 0); if (!lock) GOTO(out, -ENOMEM); @@ -69,7 +68,7 @@ static int ldlm_handle_enqueue(struct obd_device *obddev, struct ptlrpc_service flags = dlm_req->lock_flags; err = ldlm_lock_enqueue(lock, cookie, cookielen, &flags, - ldlm_cli_callback, ldlm_cli_callback); + ldlm_cli_callback, ldlm_cli_callback); if (err != ELDLM_OK) GOTO(out, err); @@ -127,8 +126,7 @@ static int ldlm_handle_convert(struct ptlrpc_service *svc, struct ptlrpc_request req->rq_status = EINVAL; } else { LDLM_DEBUG(lock, "server-side convert handler START"); - ldlm_lock_convert(&dlm_req->lock_handle1, - dlm_req->lock_desc.l_req_mode, + ldlm_lock_convert(lock, dlm_req->lock_desc.l_req_mode, &dlm_rep->lock_flags); req->rq_status = 0; } @@ -161,7 +159,7 @@ static int ldlm_handle_cancel(struct ptlrpc_service *svc, struct ptlrpc_request req->rq_status = ESTALE; } else { LDLM_DEBUG(lock, "server-side cancel handler START"); - ldlm_local_lock_cancel(lock); + ldlm_lock_cancel(lock); req->rq_status = 0; } @@ -252,7 +250,7 @@ static int ldlm_handle_callback(struct ptlrpc_service *svc, } LDLM_DEBUG_NOLOCK("client %s callback handler END (lock: %p)", - new == NULL ? "completion" : "blocked", lock); + is_blocking_ast ? "blocked" : "completion", lock); RETURN(0); } @@ -458,7 +456,7 @@ static void __exit ldlm_exit(void) CERROR("couldn't free ldlm lock slab\n"); } -EXPORT_SYMBOL(ldlm_local_lock_match); +EXPORT_SYMBOL(ldlm_lock_match); EXPORT_SYMBOL(ldlm_lock_addref); EXPORT_SYMBOL(ldlm_lock_decref); EXPORT_SYMBOL(ldlm_cli_convert); diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 0917dd1..ef99903 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -34,8 +34,8 @@ int ldlm_cli_enqueue(struct ptlrpc_client *cl, struct ptlrpc_connection *conn, ENTRY; *flags = 0; - lock = ldlm_local_lock_create(ns, parent_lock_handle, res_id, type, - mode, data, data_len); + lock = ldlm_lock_create(ns, parent_lock_handle, res_id, type, mode, + data, data_len); if (lock == NULL) GOTO(out, rc = -ENOMEM); @@ -139,7 +139,7 @@ int ldlm_cli_enqueue(struct ptlrpc_client *cl, struct ptlrpc_connection *conn, return rc; } -int ldlm_cli_callback(struct ldlm_lock *lock, struct ldlm_lock *new, +int ldlm_cli_callback(struct ldlm_lock *lock, struct ldlm_lock_desc *new, void *data, __u32 data_len, struct ptlrpc_request **reqp) { struct ldlm_request *body; @@ -163,8 +163,7 @@ int ldlm_cli_callback(struct ldlm_lock *lock, struct ldlm_lock *new, ldlm_lock2desc(lock, &body->lock_desc); } else { CDEBUG(D_NET, "Sending blocked AST\n"); - ldlm_lock2desc(new, &body->lock_desc); - ldlm_object2handle(new, &body->lock_handle2); + memcpy(&body->lock_desc, new, sizeof(*new)); } LDLM_DEBUG(lock, "server preparing %s AST", @@ -224,7 +223,7 @@ int ldlm_cli_convert(struct ptlrpc_client *cl, struct lustre_handle *lockh, GOTO(out, rc); reply = lustre_msg_buf(req->rq_repmsg, 0); - res = ldlm_local_lock_convert(lockh, new_mode, &reply->lock_flags); + res = ldlm_lock_convert(lock, new_mode, &reply->lock_flags); if (res != NULL) ldlm_reprocess_all(res); if (lock->l_req_mode != lock->l_granted_mode) { @@ -236,7 +235,7 @@ int ldlm_cli_convert(struct ptlrpc_client *cl, struct lustre_handle *lockh, lock->l_granted_mode); CDEBUG(D_NET, "waking up, the lock must be granted.\n"); } - ldlm_put_lock(lock); + ldlm_lock_put(lock); EXIT; out: ptlrpc_free_req(req); diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index 51fc3d2..a8148f5 100644 --- a/lustre/ldlm/ldlm_resource.c +++ b/lustre/ldlm/ldlm_resource.c @@ -73,7 +73,9 @@ static int cleanup_resource(struct ldlm_resource *res, struct list_head *q) lock = list_entry(tmp, struct ldlm_lock, l_res_link); if (client) { - rc = ldlm_cli_cancel(lock->l_client, lock); + struct lustre_handle lockh; + ldlm_lock2handle(lock, &lockh); + rc = ldlm_cli_cancel(lock->l_client, &lockh); if (rc < 0) { CERROR("ldlm_cli_cancel: %d\n", rc); LBUG(); diff --git a/lustre/ldlm/ldlm_test.c b/lustre/ldlm/ldlm_test.c index c763090..16b10f9 100644 --- a/lustre/ldlm/ldlm_test.c +++ b/lustre/ldlm/ldlm_test.c @@ -128,11 +128,11 @@ int ldlm_test_extents(struct obd_device *obddev) /* Convert/cancel blocking locks */ flags = 0; - res = ldlm_convert(lock1, LCK_NL, &flags); + res = ldlm_lock_convert(lock1, LCK_NL, &flags); if (res != NULL) ldlm_reprocess_all(res); - res = ldlm_cancel(lock2); + ldlm_lock_cancel(lock2); if (res != NULL) ldlm_reprocess_all(res); diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 740d4b9..1fe90c5 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -201,6 +201,7 @@ static int ll_lock_callback(struct ldlm_lock *lock, struct ldlm_lock *new, struct ptlrpc_request **reqp) { struct inode *inode = lock->l_data; + struct lustre_handle lockh; ENTRY; if (new == NULL) { @@ -219,7 +220,8 @@ static int ll_lock_callback(struct ldlm_lock *lock, struct ldlm_lock *new, invalidate_inode_pages(inode); up(&inode->i_sem); - if (ldlm_cli_cancel(lock->l_client, lock) < 0) + ldlm_lock2handle(lock, &lockh); + if (ldlm_cli_cancel(lock->l_client, &lockh) < 0) LBUG(); RETURN(0); } -- 1.8.3.1