Whamcloud - gitweb
- don't forget to pass data and data_len on to the local enqueue
authorbraam <braam>
Sat, 14 Sep 2002 07:02:20 +0000 (07:02 +0000)
committerbraam <braam>
Sat, 14 Sep 2002 07:02:20 +0000 (07:02 +0000)
  functions.
- do directory truncations when the clients don't modify directory
  data and change the dcache.

lustre/ldlm/ldlm_lockd.c
lustre/ldlm/ldlm_request.c
lustre/llite/namei.c

index b16cdf4..de84253 100644 (file)
@@ -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,
index 3731f7d..400da08 100644 (file)
@@ -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");
index ba77204..fb5e36e 100644 (file)
@@ -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);
         }