summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/fs/cd9660/cd9660_vfsops.c4
-rw-r--r--sys/fs/hpfs/hpfs_vfsops.c4
-rw-r--r--sys/fs/msdosfs/msdosfs_denode.c2
-rw-r--r--sys/fs/udf/udf_vfsops.c4
-rw-r--r--sys/gnu/ext2fs/ext2_vfsops.c4
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vfsops.c4
-rw-r--r--sys/isofs/cd9660/cd9660_vfsops.c4
-rw-r--r--sys/kern/vfs_hash.c8
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c4
9 files changed, 11 insertions, 27 deletions
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c
index 169df65..2e2f776 100644
--- a/sys/fs/cd9660/cd9660_vfsops.c
+++ b/sys/fs/cd9660/cd9660_vfsops.c
@@ -681,10 +681,8 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, isodir)
ip->i_number = ino;
error = vfs_hash_insert(vp, ino, flags, curthread, vpp);
- if (error || *vpp != NULL) {
- vput(vp);
+ if (error || *vpp != NULL)
return (error);
- }
if (isodir == 0) {
int lbn, off;
diff --git a/sys/fs/hpfs/hpfs_vfsops.c b/sys/fs/hpfs/hpfs_vfsops.c
index c14fa4b..d4bd57f 100644
--- a/sys/fs/hpfs/hpfs_vfsops.c
+++ b/sys/fs/hpfs/hpfs_vfsops.c
@@ -514,10 +514,8 @@ hpfs_vget(
hp->h_devvp = hpmp->hpm_devvp;
error = vfs_hash_insert(vp, ino, flags, curthread, vpp);
- if (error || *vpp != NULL) {
- vput(vp);
+ if (error || *vpp != NULL)
return (error);
- }
VREF(hp->h_devvp);
diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c
index d582a36..043e8e6 100644
--- a/sys/fs/msdosfs/msdosfs_denode.c
+++ b/sys/fs/msdosfs/msdosfs_denode.c
@@ -162,13 +162,11 @@ deget(pmp, dirclust, diroffset, depp)
error = vfs_hash_insert(nvp, hash, 0, curthread, &xvp);
if (error) {
- vput(nvp);
*depp = NULL;
return (error);
}
if (xvp != NULL) {
/* XXX: Not sure this is right */
- vput(nvp);
nvp = xvp;
ldep->de_vnode = nvp;
}
diff --git a/sys/fs/udf/udf_vfsops.c b/sys/fs/udf/udf_vfsops.c
index 60eaa7b..0fa8a69 100644
--- a/sys/fs/udf/udf_vfsops.c
+++ b/sys/fs/udf/udf_vfsops.c
@@ -604,10 +604,8 @@ udf_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
vp->v_data = unode;
error = vfs_hash_insert(vp, ino, flags, curthread, vpp);
- if (error || *vpp != NULL) {
- vput(vp);
+ if (error || *vpp != NULL)
return (error);
- }
/*
* Copy in the file entry. Per the spec, the size can only be 1 block.
diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c
index 5c2fed4..295accb 100644
--- a/sys/gnu/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/ext2fs/ext2_vfsops.c
@@ -944,10 +944,8 @@ ext2_vget(mp, ino, flags, vpp)
ip->i_number = ino;
error = vfs_hash_insert(vp, ino, flags, curthread, vpp);
- if (error || *vpp != NULL) {
- vput(vp);
+ if (error || *vpp != NULL)
return (error);
- }
/* Read in the disk contents for the inode, copy into the inode. */
#if 0
diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c
index 5c2fed4..295accb 100644
--- a/sys/gnu/fs/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c
@@ -944,10 +944,8 @@ ext2_vget(mp, ino, flags, vpp)
ip->i_number = ino;
error = vfs_hash_insert(vp, ino, flags, curthread, vpp);
- if (error || *vpp != NULL) {
- vput(vp);
+ if (error || *vpp != NULL)
return (error);
- }
/* Read in the disk contents for the inode, copy into the inode. */
#if 0
diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c
index 169df65..2e2f776 100644
--- a/sys/isofs/cd9660/cd9660_vfsops.c
+++ b/sys/isofs/cd9660/cd9660_vfsops.c
@@ -681,10 +681,8 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, isodir)
ip->i_number = ino;
error = vfs_hash_insert(vp, ino, flags, curthread, vpp);
- if (error || *vpp != NULL) {
- vput(vp);
+ if (error || *vpp != NULL)
return (error);
- }
if (isodir == 0) {
int lbn, off;
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;
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 950f14e..686bba9 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1226,10 +1226,8 @@ ffs_vget(mp, ino, flags, vpp)
#endif
error = vfs_hash_insert(vp, ino, flags, curthread, vpp);
- if (error || *vpp != NULL) {
- vput(vp);
+ if (error || *vpp != NULL)
return (error);
- }
/* Read in the disk contents for the inode, copy into the inode. */
error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)),
OpenPOWER on IntegriCloud