summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_hash.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2005-03-15 20:00:03 +0000
committerphk <phk@FreeBSD.org>2005-03-15 20:00:03 +0000
commitd043926750bb71ad425d59da99871a7e3dc660ff (patch)
tree0df7ee974522d53324dfa9c6197c29fa4c9ee7c8 /sys/kern/vfs_hash.c
parent9251389b0e2e8cb1b090c6e3a47fc1619a1aef4c (diff)
downloadFreeBSD-src-d043926750bb71ad425d59da99871a7e3dc660ff.zip
FreeBSD-src-d043926750bb71ad425d59da99871a7e3dc660ff.tar.gz
Improve the vfs_hash() API: vput() the unneeded vnode centrally to
avoid replicating the vput in all the filesystems.
Diffstat (limited to 'sys/kern/vfs_hash.c')
-rw-r--r--sys/kern/vfs_hash.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/vfs_hash.c b/sys/kern/vfs_hash.c
index 5b77b1f..72a0278 100644
--- a/sys/kern/vfs_hash.c
+++ b/sys/kern/vfs_hash.c
@@ -117,10 +117,10 @@ vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, stru
error = vget(vp2, flags | LK_INTERLOCK, td);
if (error == ENOENT)
break;
- if (error)
- return (error);
- *vpp = vp2;
- return (0);
+ vput(vp);
+ if (!error)
+ *vpp = vp2;
+ return (error);
}
if (vp2 == NULL)
break;
OpenPOWER on IntegriCloud