diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2009-01-07 12:44:03 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2009-01-07 12:44:03 +0000 |
| commit | f224d7f8e0d272e97b2208c102e720d4ebfafb69 (patch) | |
| tree | 79d80321c5c007df5e78b10eefa2726f21807b42 | |
| parent | 13f1fb21d8f75529eb69c6a63df1e1ab6178f156 (diff) | |
Notes
| -rw-r--r-- | sys/kern/vfs_cache.c | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index b6b8d4cd88ea..4787f3358fc2 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -511,28 +511,18 @@ cache_enter(dvp, vp, cnp) CACHE_LOCK(); /* - * See if this vnode is already in the cache with this name. - * This can happen with concurrent lookups of the same path - * name. + * See if this vnode or negative entry is already in the cache + * with this name. This can happen with concurrent lookups of + * the same path name. */ - if (vp) { - TAILQ_FOREACH(n2, &vp->v_cache_dst, nc_dst) { - if (n2->nc_dvp == dvp && - n2->nc_nlen == cnp->cn_namelen && - !bcmp(n2->nc_name, cnp->cn_nameptr, n2->nc_nlen)) { - CACHE_UNLOCK(); - cache_free(ncp); - return; - } - } - } else { - TAILQ_FOREACH(n2, &ncneg, nc_dst) { - if (n2->nc_nlen == cnp->cn_namelen && - !bcmp(n2->nc_name, cnp->cn_nameptr, n2->nc_nlen)) { - CACHE_UNLOCK(); - cache_free(ncp); - return; - } + ncpp = NCHHASH(hash); + LIST_FOREACH(n2, ncpp, nc_hash) { + if (n2->nc_dvp == dvp && + n2->nc_nlen == cnp->cn_namelen && + !bcmp(n2->nc_name, cnp->cn_nameptr, n2->nc_nlen)) { + CACHE_UNLOCK(); + cache_free(ncp); + return; } } @@ -550,7 +540,6 @@ cache_enter(dvp, vp, cnp) * Insert the new namecache entry into the appropriate chain * within the cache entries table. */ - ncpp = NCHHASH(hash); LIST_INSERT_HEAD(ncpp, ncp, nc_hash); if (LIST_EMPTY(&dvp->v_cache_src)) { hold = 1; |
