patch-2.1.61 linux/fs/dcache.c

Next file: linux/fs/isofs/dir.c
Previous file: linux/fs/autofs/root.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.60/linux/fs/dcache.c linux/fs/dcache.c
@@ -465,12 +465,13 @@
 	return dentry_hashtable + (hash & D_HASHMASK);
 }
 
-static inline struct dentry * __dlookup(struct list_head *head, struct dentry * parent, struct qstr * name)
+struct dentry * d_lookup(struct dentry * parent, struct qstr * name)
 {
-	struct list_head *tmp = head->next;
-	int len = name->len;
-	int hash = name->hash;
+	unsigned int len = name->len;
+	unsigned int hash = name->hash;
 	const unsigned char *str = name->name;
+	struct list_head *head = d_hash(parent,hash);
+	struct list_head *tmp = head->next;
 
 	while (tmp != head) {
 		struct dentry * dentry = list_entry(tmp, struct dentry, d_hash);
@@ -489,14 +490,9 @@
 			if (memcmp(dentry->d_name.name, str, len))
 				continue;
 		}
-		return dget(dentry->d_mounts);
+		return dget(dentry);
 	}
 	return NULL;
-}
-
-struct dentry * d_lookup(struct dentry * dir, struct qstr * name)
-{
-	return __dlookup(d_hash(dir, name->hash), dir, name);
 }
 
 /*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov