From: Matthew Dillon Date: Fri, 24 Aug 2012 23:29:49 +0000 (-0700) Subject: kernel - Adjust devfs, hammer, and puffs to use the new cache_unlink() X-Git-Tag: v3.2.0~264 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/5323ed62048a8d506c864f61c5c2e913cd378c61 kernel - Adjust devfs, hammer, and puffs to use the new cache_unlink() * Adjust devfs, hammer, and puffs to use the new cache_unlink() mechanic. --- diff --git a/sys/vfs/devfs/devfs_vnops.c b/sys/vfs/devfs/devfs_vnops.c index 31716adddf..6a51c94933 100644 --- a/sys/vfs/devfs/devfs_vnops.c +++ b/sys/vfs/devfs/devfs_vnops.c @@ -783,9 +783,7 @@ devfs_vop_nrmdir(struct vop_nrmdir_args *ap) } } - cache_setunresolved(ap->a_nch); - cache_setvp(ap->a_nch, NULL); - + cache_unlink(ap->a_nch); out: lockmgr(&devfs_lock, LK_RELEASE); return error; @@ -833,9 +831,7 @@ devfs_vop_nremove(struct vop_nremove_args *ap) } } - cache_setunresolved(ap->a_nch); - cache_setvp(ap->a_nch, NULL); - + cache_unlink(ap->a_nch); out: lockmgr(&devfs_lock, LK_RELEASE); return error; diff --git a/sys/vfs/hammer/hammer_vnops.c b/sys/vfs/hammer/hammer_vnops.c index 5422aebd40..22f49d6c9c 100644 --- a/sys/vfs/hammer/hammer_vnops.c +++ b/sys/vfs/hammer/hammer_vnops.c @@ -3539,8 +3539,10 @@ retry: } hammer_done_cursor(&cursor); if (error == 0) { - cache_setunresolved(nch); - cache_setvp(nch, NULL); + /* + * Tell the namecache that we are now unlinked. + */ + cache_unlink(nch); /* * NOTE: ip->vp, if non-NULL, cannot be directly diff --git a/sys/vfs/puffs/puffs_vnops.c b/sys/vfs/puffs/puffs_vnops.c index d6113f2d0d..7504bf5f7b 100644 --- a/sys/vfs/puffs/puffs_vnops.c +++ b/sys/vfs/puffs/puffs_vnops.c @@ -969,10 +969,8 @@ puffs_vnop_remove(struct vop_nremove_args *ap) out: vput(dvp); vn_unlock(vp); - if (!error) { - cache_setunresolved(nch); - cache_setvp(nch, NULL); - } + if (error == 0) + cache_unlink(nch); vrele(vp); return error; } @@ -1099,10 +1097,8 @@ puffs_vnop_rmdir(struct vop_nrmdir_args *ap) out: vput(dvp); vn_unlock(vp); - if (!error) { - cache_setunresolved(nch); - cache_setvp(nch, NULL); - } + if (error == 0) + cache_unlink(nch); vrele(vp); return error; }