patch-2.1.37 linux/fs/dcache.c
Next file: linux/fs/dquot.c
Previous file: linux/fs/buffer.c
Back to the patch index
Back to the overall index
- Lines: 45
- Date:
Mon May 12 10:35:42 1997
- Orig file:
v2.1.36/linux/fs/dcache.c
- Orig date:
Wed Apr 23 19:01:22 1997
diff -u --recursive --new-file v2.1.36/linux/fs/dcache.c linux/fs/dcache.c
@@ -153,17 +153,24 @@
/*
* Find a directory cache entry given all the necessary info.
*/
-static inline struct dir_cache_entry * find_entry(struct inode * dir, const char * name, int len, struct dir_cache_entry ** hash)
+static inline struct dir_cache_entry * find_entry(struct inode * dir, const char * name, unsigned char len, struct dir_cache_entry ** hash)
{
struct dir_cache_entry *de;
- for(de = *hash; de; de = de->next)
+ de = *hash;
+ goto inside;
+ for (;;) {
+ de = de->next;
+inside:
+ if (!de)
+ break;
if((de->name_len == (unsigned char) len) &&
(de->dc_dev == dir->i_dev) &&
(de->dir == dir->i_ino) &&
(de->version == dir->i_version) &&
(!memcmp(de->name, name, len)))
break;
+ }
return de;
}
@@ -195,7 +202,7 @@
struct dir_cache_entry *de;
spin_lock(&dcache_lock);
- de = find_entry(dir, name, len, hash);
+ de = find_entry(dir, name, (unsigned char) len, hash);
if(de) {
*ino = de->ino;
move_to_level2(de, hash);
@@ -213,7 +220,7 @@
struct dir_cache_entry *de;
spin_lock(&dcache_lock);
- de = find_entry(dir, name, len, hash);
+ de = find_entry(dir, name, (unsigned char) len, hash);
if (de) {
de->ino = ino;
update_lru(de);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov