summaryrefslogtreecommitdiffstats
path: root/sys/fs/udf
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2005-03-15 08:07:07 +0000
committerphk <phk@FreeBSD.org>2005-03-15 08:07:07 +0000
commit124bf5e823dfe2ddde94c57660a3beffc2f99b57 (patch)
tree222a537cdd030d8083d8dae9e650ae3be7de0573 /sys/fs/udf
parenta7b3bd456408d157545ff8c8ffd7060ae2070886 (diff)
downloadFreeBSD-src-124bf5e823dfe2ddde94c57660a3beffc2f99b57.zip
FreeBSD-src-124bf5e823dfe2ddde94c57660a3beffc2f99b57.tar.gz
Simplify the vfs_hash calling convention.
Diffstat (limited to 'sys/fs/udf')
-rw-r--r--sys/fs/udf/udf_vfsops.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/sys/fs/udf/udf_vfsops.c b/sys/fs/udf/udf_vfsops.c
index 6a9f9e7..60eaa7b 100644
--- a/sys/fs/udf/udf_vfsops.c
+++ b/sys/fs/udf/udf_vfsops.c
@@ -582,10 +582,8 @@ udf_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
int error, sector, size;
error = vfs_hash_get(mp, ino, flags, curthread, vpp);
- if (error)
+ if (error || *vpp != NULL)
return (error);
- if (*vpp != NULL)
- return (0);
td = curthread;
udfmp = VFSTOUDFFS(mp);
@@ -605,30 +603,12 @@ udf_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
unode->udfmp = udfmp;
vp->v_data = unode;
- /*
- * Exclusively lock the vnode before adding to hash. Note, that we
- * must not release nor downgrade the lock (despite flags argument
- * says) till it is fully initialized.
- */
- lockmgr(vp->v_vnlock, LK_EXCLUSIVE, (struct mtx *)0, td);
-
- /*
- * Atomicaly (in terms of vfs_hash operations) check the hash for
- * duplicate of vnode being created and add it to the hash. If a
- * duplicate vnode was found, it will be vget()ed from hash for us.
- */
- if ((error = vfs_hash_insert(vp, ino, flags, curthread, vpp)) != 0) {
+ error = vfs_hash_insert(vp, ino, flags, curthread, vpp);
+ if (error || *vpp != NULL) {
vput(vp);
- *vpp = NULL;
return (error);
}
- /* We lost the race, then throw away our vnode and return existing */
- if (*vpp != NULL) {
- vput(vp);
- return (0);
- }
-
/*
* Copy in the file entry. Per the spec, the size can only be 1 block.
*/
OpenPOWER on IntegriCloud