From 06eb6144d7ce9fa6fcbe3a4d6a666daab28252b8 Mon Sep 17 00:00:00 2001 From: braam Date: Sat, 14 Sep 2002 07:02:20 +0000 Subject: [PATCH] - don't forget to pass data and data_len on to the local enqueue functions. - do directory truncations when the clients don't modify directory data and change the dcache. --- lustre/ldlm/ldlm_lockd.c | 2 ++ lustre/ldlm/ldlm_request.c | 2 +- lustre/llite/namei.c | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index b16cdf4..de84253 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -208,6 +208,8 @@ int ldlm_handle_enqueue(struct ptlrpc_request *req) } } + /* XXX notice that this lock has no callback data: of course the + export would be exactly what we may want to use here... */ lock = ldlm_lock_create(obddev->obd_namespace, &dlm_req->lock_handle2, dlm_req->lock_desc.l_resource.lr_name, diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 3731f7d..400da08 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -60,7 +60,7 @@ static int ldlm_cli_enqueue_local(struct ldlm_namespace *ns, LBUG(); } - lock = ldlm_lock_create(ns, parent_lockh, res_id, type, mode, NULL, 0); + lock = ldlm_lock_create(ns, parent_lockh, res_id, type, mode, data, data_len); if (!lock) GOTO(out_nolock, err = -ENOMEM); LDLM_DEBUG(lock, "client-side local enqueue handler, new lock created"); diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index ba77204..fb5e36e 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -323,6 +323,7 @@ static struct inode *ll_create_node(struct inode *dir, const char *name, lic.lic_lmm = NULL; } else { + invalidate_inode_pages(dir); request = it->it_data; body = lustre_msg_buf(request->rq_repmsg, 1); lic.lic_lmm = NULL; @@ -616,6 +617,7 @@ static int ll_common_unlink(struct inode *dir, struct dentry *dentry, if (dentry->d_it && dentry->d_it->it_disposition) { err = dentry->d_it->it_status; + invalidate_inode_pages(dir); GOTO(out, err); } @@ -652,7 +654,6 @@ static int ll_rmdir(struct inode *dir, struct dentry *dentry) if (!dentry->d_it || dentry->d_it->it_disposition == 0) { if (!ext2_empty_dir(inode)) LBUG(); - err = ll_common_unlink(dir, dentry, S_IFDIR); } else err = dentry->d_it->it_status; @@ -680,6 +681,8 @@ static int ll_rename(struct inode * old_dir, struct dentry * old_dentry, new_inode->i_ctime = CURRENT_TIME; new_inode->i_nlink--; } + invalidate_inode_pages(old_dir); + invalidate_inode_pages(new_dir); GOTO(out, err = new_dentry->d_it->it_status); } -- 1.8.3.1