Re: namei caching of newly created files?
Havard Eidnes <[email protected]> Thu, 20 Jan 2005 01:43:55 +0100 (CET)
| Newsgroups | gmane.os.netbsd.devel.performance,gmane.os.netbsd.devel.kernel |
|---|---|
| Message-ID | <[email protected]> |
> cache_enter() should not be used by file system independent code.
> ufs_makeinode() looks like (no warranty - you need to check) the right
> place to add the call.
OK, does this look any better?
Index: ufs_vnops.c
===================================================================
RCS file: /cvsroot/src/sys/ufs/ufs/ufs_vnops.c,v
retrieving revision 1.123
diff -u -u -1 -0 -r1.123 ufs_vnops.c
--- ufs_vnops.c 21 Sep 2004 03:10:36 -0000 1.123
+++ ufs_vnops.c 20 Jan 2005 00:42:19 -0000
@@ -2107,20 +2107,21 @@
* Make sure inode goes to disk before directory entry.
*/
if ((error = VOP_UPDATE(tvp, NULL, NULL, UPDATE_DIROP)) != 0)
goto bad;
newdir = pool_get(&ufs_direct_pool, PR_WAITOK);
ufs_makedirentry(ip, cnp, newdir);
error = ufs_direnter(dvp, tvp, newdir, cnp, NULL);
pool_put(&ufs_direct_pool, newdir);
if (error)
goto bad;
+ cache_enter(dvp, tvp, cnp);
if ((cnp->cn_flags & SAVESTART) == 0)
PNBUF_PUT(cnp->cn_pnbuf);
vput(dvp);
*vpp = tvp;
return (0);
bad:
/*
* Write error occurred trying to update the inode
* or the directory so must deallocate the inode.
Regards,
- HÃ¥vard