From: pschwan Date: Mon, 24 Jun 2002 06:13:37 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: 0.4.2~50 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=8a673d48ea575a405a9bf7131a8977bc6be44b12;p=fs%2Flustre-release.git *** empty log message *** --- diff --git a/lustre/include/linux/lustre_dlm.h b/lustre/include/linux/lustre_dlm.h index df22674..af9a2f6 100644 --- a/lustre/include/linux/lustre_dlm.h +++ b/lustre/include/linux/lustre_dlm.h @@ -100,7 +100,7 @@ struct ldlm_namespace { struct ldlm_lock; -typedef int (*ldlm_lock_callback)(struct ldlm_lock *lock, +typedef int (*ldlm_lock_callback)(struct lustre_handle *lockh, struct ldlm_lock_desc *new, void *data, __u32 data_len, struct ptlrpc_request **req); @@ -268,7 +268,7 @@ 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 lustre_handle *); +int ldlm_cli_cancel(struct lustre_handle *); #endif /* __KERNEL__ */ diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index e709a2e..8490a47 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -357,6 +357,7 @@ void ldlm_lock2desc(struct ldlm_lock *lock, struct ldlm_lock_desc *desc) static int ldlm_send_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock *new) { + struct lustre_handle lockh; struct ldlm_lock_desc desc; struct ptlrpc_request *req = NULL; ENTRY; @@ -370,8 +371,10 @@ static int ldlm_send_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock *new) lock->l_flags |= LDLM_FL_AST_SENT; /* FIXME: this should merely add the lock to the lr_tmp list */ - ldlm_lock2desc(lock, &desc); - lock->l_blocking_ast(lock, &desc, lock->l_data, lock->l_data_len, &req); + ldlm_lock2handle(lock, &lockh); + ldlm_lock2desc(new, &desc); + lock->l_blocking_ast(&lockh, &desc, lock->l_data, lock->l_data_len, + &req); l_unlock(&lock->l_resource->lr_namespace->ns_lock); if (req != NULL) { @@ -411,6 +414,8 @@ void ldlm_lock_decref(struct ldlm_lock *lock, __u32 mode) * run the callback. */ if (!lock->l_readers && !lock->l_writers && (lock->l_flags & LDLM_FL_CBPENDING)) { + struct lustre_handle lockh; + if (!lock->l_resource->lr_namespace->ns_client) { CERROR("LDLM_FL_CBPENDING set on non-local lock!\n"); LBUG(); @@ -420,7 +425,8 @@ void ldlm_lock_decref(struct ldlm_lock *lock, __u32 mode) "calling callback.\n"); l_unlock(&lock->l_resource->lr_namespace->ns_lock); - lock->l_blocking_ast(lock, NULL, lock->l_data, + ldlm_lock2handle(lock, &lockh); + lock->l_blocking_ast(&lockh, NULL, lock->l_data, lock->l_data_len, NULL); } else l_unlock(&lock->l_resource->lr_namespace->ns_lock); @@ -505,8 +511,11 @@ void ldlm_grant_lock(struct ldlm_lock *lock) res->lr_most_restr = lock->l_granted_mode; if (lock->l_completion_ast) { + struct lustre_handle *lockh; + /* FIXME: this should merely add lock to lr_tmp list */ - lock->l_completion_ast(lock, NULL, lock->l_data, + ldlm_lock2handle(lock, &lockh); + lock->l_completion_ast(&lockh, NULL, lock->l_data, lock->l_data_len, &req); if (req != NULL) { struct list_head *list = res->lr_tmp; diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index d8784ce..e6d77c0 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -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_desc *desc, +int ldlm_cli_callback(struct lustre_handle *lockh, struct ldlm_lock_desc *desc, void *data, __u32 data_len, struct ptlrpc_request **reqp) { struct ldlm_request *body; @@ -242,7 +242,7 @@ int ldlm_cli_convert(struct ptlrpc_client *cl, struct lustre_handle *lockh, return rc; } -int ldlm_cli_cancel(struct ptlrpc_client *cl, struct lustre_handle *lockh) +int ldlm_cli_cancel(struct lustre_handle *lockh) { struct ptlrpc_request *req; struct ldlm_lock *lock; @@ -256,8 +256,8 @@ int ldlm_cli_cancel(struct ptlrpc_client *cl, struct lustre_handle *lockh) LBUG(); LDLM_DEBUG(lock, "client-side cancel"); - req = ptlrpc_prep_req(cl, lock->l_connection, LDLM_CANCEL, 1, &size, - NULL); + req = ptlrpc_prep_req(lock->l_client, lock->l_connection, LDLM_CANCEL, + 1, &size, NULL); if (!req) GOTO(out, rc = -ENOMEM); diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index 3704474..54614fb 100644 --- a/lustre/ldlm/ldlm_resource.c +++ b/lustre/ldlm/ldlm_resource.c @@ -75,7 +75,7 @@ static int cleanup_resource(struct ldlm_resource *res, struct list_head *q) if (client) { struct lustre_handle lockh; ldlm_lock2handle(lock, &lockh); - rc = ldlm_cli_cancel(lock->l_client, &lockh); + rc = ldlm_cli_cancel(&lockh); if (rc < 0) { CERROR("ldlm_cli_cancel: %d\n", rc); LBUG(); diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 1fe90c5..81f879d 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -196,12 +196,12 @@ static void ll_update_atime(struct inode *inode) ll_inode_setattr(inode, &attr, 0); } -static int ll_lock_callback(struct ldlm_lock *lock, struct ldlm_lock *new, +static int ll_lock_callback(struct lustre_handle *lockh, + struct ldlm_lock_desc *new, void *data, __u32 data_len, struct ptlrpc_request **reqp) { - struct inode *inode = lock->l_data; - struct lustre_handle lockh; + struct inode *inode = data; ENTRY; if (new == NULL) { @@ -220,8 +220,7 @@ static int ll_lock_callback(struct ldlm_lock *lock, struct ldlm_lock *new, invalidate_inode_pages(inode); up(&inode->i_sem); - ldlm_lock2handle(lock, &lockh); - if (ldlm_cli_cancel(lock->l_client, &lockh) < 0) + if (ldlm_cli_cancel(lockh) < 0) LBUG(); RETURN(0); }