diff options
author | Semen Ustimenko <semenu@FreeBSD.org> | 2002-06-13 21:49:09 +0000 |
---|---|---|
committer | Semen Ustimenko <semenu@FreeBSD.org> | 2002-06-13 21:49:09 +0000 |
commit | 1cfdefbb9f162da9aa9c045f07394f49aaef1db8 (patch) | |
tree | 6951958eefa7c3d066580c5bb379863dacb57268 /sys/fs/nullfs/null_vfsops.c | |
parent | 9b838be73bbb4276c3e6be5d51e4f2ce65ec4035 (diff) | |
download | src-1cfdefbb9f162da9aa9c045f07394f49aaef1db8.tar.gz src-1cfdefbb9f162da9aa9c045f07394f49aaef1db8.zip |
Fix a race during null node creation between relookuping the hash and
adding vnode to hash. The fix is to use atomic hash-lookup-and-add-if-
not-found operation. The odd thing is that this race can't happen
actually because the lowervp vnode is locked exclusively now during the
whole process of null node creation. This must be thought as a step
toward shared lookups.
Also remove vp->v_mount checks when looking for a match in the hash,
as this is the vestige.
Also add comments and cosmetic changes.
Notes
Notes:
svn path=/head/; revision=98183
Diffstat (limited to 'sys/fs/nullfs/null_vfsops.c')
-rw-r--r-- | sys/fs/nullfs/null_vfsops.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index a9ec22e45bfa..a218bf08ba6a 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -169,7 +169,7 @@ nullfs_mount(mp, ndp, td) * Save reference. Each mount also holds * a reference on the root vnode. */ - error = null_node_create(mp, lowerrootvp, &vp); + error = null_nodeget(mp, lowerrootvp, &vp); /* * Unlock the node (either the lower or the alias) */ @@ -354,7 +354,7 @@ nullfs_vget(mp, ino, flags, vpp) if (error) return (error); - return (null_node_create(mp, *vpp, vpp)); + return (null_nodeget(mp, *vpp, vpp)); } static int @@ -368,7 +368,7 @@ nullfs_fhtovp(mp, fidp, vpp) if (error) return (error); - return (null_node_create(mp, *vpp, vpp)); + return (null_nodeget(mp, *vpp, vpp)); } static int |