diff options
author | bp <bp@FreeBSD.org> | 2001-05-17 04:40:01 +0000 |
---|---|---|
committer | bp <bp@FreeBSD.org> | 2001-05-17 04:40:01 +0000 |
commit | f9fd9a4dce87ebe23043530f9aca27bd327cf131 (patch) | |
tree | 434cac0d8d65876d0953ff5da537b461e681270f /sys | |
parent | 9a2404aa1f29493c17a310b6aff2e2cf01242433 (diff) | |
download | FreeBSD-src-f9fd9a4dce87ebe23043530f9aca27bd327cf131.zip FreeBSD-src-f9fd9a4dce87ebe23043530f9aca27bd327cf131.tar.gz |
Do not leave an extra reference on vnode.
PR: kern/27250
Submitted by: "Vladimir B. Grebenschikov" <vova@express.ru>
MFC after: 2 weeks
Diffstat (limited to 'sys')
-rw-r--r-- | sys/fs/unionfs/union_subr.c | 8 | ||||
-rw-r--r-- | sys/miscfs/union/union_subr.c | 8 |
2 files changed, 4 insertions, 12 deletions
diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index b4f2802..c59a41f 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -304,7 +304,7 @@ union_newsize(vp, uppersz, lowersz) * not locked, and will be dereferenced on return. * * lowervp Holds the new lowervp vnode to be stored in the - * union_node we are allocating. uppervp is referenced but + * union_node we are allocating. lowervp is referenced but * not locked, and will be dereferenced on return. * * cnp Holds path component information to be coupled with @@ -346,7 +346,6 @@ union_allocvp(vpp, mp, dvp, upperdvp, cnp, uppervp, lowervp, docache) { int error; struct union_node *un = 0; - struct vnode *xlowervp = NULLVP; struct union_mount *um = MOUNTTOUNIONMOUNT(mp); struct proc *p = (cnp) ? cnp->cn_proc : curproc; int hash = 0; @@ -357,7 +356,7 @@ union_allocvp(vpp, mp, dvp, upperdvp, cnp, uppervp, lowervp, docache) panic("union: unidentifiable allocation"); if (uppervp && lowervp && (uppervp->v_type != lowervp->v_type)) { - xlowervp = lowervp; + vrele(lowervp); lowervp = NULLVP; } @@ -599,9 +598,6 @@ loop: } out: - if (xlowervp) - vrele(xlowervp); - if (docache) union_list_unlock(hash); diff --git a/sys/miscfs/union/union_subr.c b/sys/miscfs/union/union_subr.c index b4f2802..c59a41f 100644 --- a/sys/miscfs/union/union_subr.c +++ b/sys/miscfs/union/union_subr.c @@ -304,7 +304,7 @@ union_newsize(vp, uppersz, lowersz) * not locked, and will be dereferenced on return. * * lowervp Holds the new lowervp vnode to be stored in the - * union_node we are allocating. uppervp is referenced but + * union_node we are allocating. lowervp is referenced but * not locked, and will be dereferenced on return. * * cnp Holds path component information to be coupled with @@ -346,7 +346,6 @@ union_allocvp(vpp, mp, dvp, upperdvp, cnp, uppervp, lowervp, docache) { int error; struct union_node *un = 0; - struct vnode *xlowervp = NULLVP; struct union_mount *um = MOUNTTOUNIONMOUNT(mp); struct proc *p = (cnp) ? cnp->cn_proc : curproc; int hash = 0; @@ -357,7 +356,7 @@ union_allocvp(vpp, mp, dvp, upperdvp, cnp, uppervp, lowervp, docache) panic("union: unidentifiable allocation"); if (uppervp && lowervp && (uppervp->v_type != lowervp->v_type)) { - xlowervp = lowervp; + vrele(lowervp); lowervp = NULLVP; } @@ -599,9 +598,6 @@ loop: } out: - if (xlowervp) - vrele(xlowervp); - if (docache) union_list_unlock(hash); |