Whamcloud - gitweb
b=311
authorpschwan <pschwan>
Thu, 7 Nov 2002 03:25:43 +0000 (03:25 +0000)
committerpschwan <pschwan>
Thu, 7 Nov 2002 03:25:43 +0000 (03:25 +0000)
- Drop unused data locks in clear_inode
- Fix for directory and inode counts and link counts

lustre/llite/namei.c
lustre/llite/super.c

index e1e020a..e690251 100644 (file)
@@ -384,8 +384,10 @@ struct dentry *ll_find_alias(struct inode *inode, struct dentry *de)
                 if (dentry == de)
                         continue;
 
-                if (!atomic_read(&dentry->d_count))
+                if (!atomic_read(&dentry->d_count)) {
+                        iput(inode);
                         continue;
+                }
 
                 if (!list_empty(&dentry->d_lru))
                         continue;
@@ -787,14 +789,14 @@ static int ll_mkdir(struct inode *dir, struct dentry *dentry, int mode)
         if (IS_ERR(inode))
                 goto out_dir;
 
-        ext2_inc_count(inode);
-
         err = ext2_make_empty(inode, dir);
         if (err)
                 goto out_fail;
 
         /* no directory data updates when intents rule */
         if (!it || !it->it_disposition) {
+                /* XXX FIXME This code needs re-checked for non-intents */
+                ext2_inc_count(inode);
                 err = ll_add_link(dentry, inode);
                 if (err)
                         goto out_fail;
index 4074ab6..4a13a11 100644 (file)
@@ -361,6 +361,12 @@ static void ll_clear_inode(struct inode *inode)
                 /* XXX FIXME do something dramatic */
         }
 
+        rc = obd_cancel_unused(&sbi->ll_osc_conn, inode, LDLM_FL_NO_CALLBACK);
+        if (rc < 0) {
+                CERROR("obd_cancel_unused: %d\n", rc);
+                /* XXX FIXME do something dramatic */
+        }
+
         if (atomic_read(&inode->i_count) == 0) {
                 struct ll_inode_info *lli = ll_i2info(inode);
                 struct lov_stripe_md *lsm = lli->lli_smd;