patch-2.4.0-test5 linux/fs/namei.c
Next file: linux/fs/ncpfs/ncplib_kernel.c
Previous file: linux/fs/msdos/namei.c
Back to the patch index
Back to the overall index
- Lines: 50
- Date:
Thu Jul 27 16:47:16 2000
- Orig file:
v2.4.0-test4/linux/fs/namei.c
- Orig date:
Mon Jul 10 16:47:26 2000
diff -u --recursive --new-file v2.4.0-test4/linux/fs/namei.c linux/fs/namei.c
@@ -292,20 +292,22 @@
/*
* Uhhuh! Nasty case: the cache was re-populated while
- * we waited on the semaphore. Need to revalidate, but
- * we're going to return this entry regardless (same
- * as if it was busy).
+ * we waited on the semaphore. Need to revalidate.
*/
up(&dir->i_sem);
- if (result->d_op && result->d_op->d_revalidate)
- result->d_op->d_revalidate(result, flags);
+ if (result->d_op && result->d_op->d_revalidate) {
+ if (!result->d_op->d_revalidate(result, flags) && !d_invalidate(result)) {
+ dput(result);
+ result = ERR_PTR(-ENOENT);
+ }
+ }
return result;
}
static inline int do_follow_link(struct dentry *dentry, struct nameidata *nd)
{
int err;
- if (current->link_count >= 32)
+ if (current->link_count >= 8)
goto loop;
current->link_count++;
UPDATE_ATIME(dentry->d_inode);
@@ -1952,20 +1954,3 @@
readlink: page_readlink,
follow_link: page_follow_link,
};
-
-/* SLAB cache for name blocks */
-kmem_cache_t *names_cachep;
-
-static int __init namecache_init(void)
-{
- names_cachep = kmem_cache_create("names_cache",
- PAGE_SIZE,
- 0,
- SLAB_HWCACHE_ALIGN,
- NULL, NULL);
- if (!names_cachep)
- panic("Cannot create names cache");
- return 0;
-}
-
-module_init(namecache_init)
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)