Whamcloud - gitweb
another shot at managing dentries
authorbraam <braam>
Thu, 7 Nov 2002 04:03:40 +0000 (04:03 +0000)
committerbraam <braam>
Thu, 7 Nov 2002 04:03:40 +0000 (04:03 +0000)
lustre/llite/namei.c

index e690251..ec8dae8 100644 (file)
@@ -381,17 +381,11 @@ struct dentry *ll_find_alias(struct inode *inode, struct dentry *de)
                struct dentry *dentry = list_entry(tmp, struct dentry, d_alias);
 
                 /* We are called here with 'de' already on the aliases list. */
-                if (dentry == de)
-                        continue;
-
-                if (!atomic_read(&dentry->d_count)) {
-                        iput(inode);
+                if (dentry == de) { 
+                        CERROR("whoops\n");
                         continue;
                 }
 
-                if (!list_empty(&dentry->d_lru))
-                        continue;
-
                 if (dentry->d_parent != de->d_parent)
                         continue;
 
@@ -402,8 +396,10 @@ struct dentry *ll_find_alias(struct inode *inode, struct dentry *de)
                            de->d_name.len) != 0)
                         continue;
 
-                list_del_init(&dentry->d_hash);
+                if (!list_empty(&dentry->d_lru))
+                        list_del_init(&dentry->d_lru);
 
+                list_del_init(&dentry->d_hash);
                 spin_unlock(&dcache_lock);
                 d_rehash(dentry);
                atomic_inc(&dentry->d_count);