diff options
Diffstat (limited to 'sys/fs/unionfs')
-rw-r--r-- | sys/fs/unionfs/union_subr.c | 16 | ||||
-rw-r--r-- | sys/fs/unionfs/union_vfsops.c | 14 | ||||
-rw-r--r-- | sys/fs/unionfs/union_vnops.c | 15 |
3 files changed, 26 insertions, 19 deletions
diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index e90a91c..02f7a10 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_subr.c 8.4 (Berkeley) 2/17/94 - * $Id: union_subr.c,v 1.3 1994/08/02 07:45:44 davidg Exp $ + * $Id: union_subr.c,v 1.4 1994/10/06 21:06:48 davidg Exp $ */ #include <sys/param.h> @@ -224,7 +224,6 @@ union_allocvp(vpp, mp, undvp, dvp, cnp, uppervp, lowervp) { int error; struct union_node *un = 0; - struct union_node **pp; struct vnode *xlowervp = NULLVP; int hash = 0; int try; @@ -594,7 +593,8 @@ union_mkshadow(um, dvp, cnp, vpp) cn.cn_consume = cnp->cn_consume; VREF(dvp); - if (error = relookup(dvp, vpp, &cn)) + error = relookup(dvp, vpp, &cn); + if (error) return (error); vrele(dvp); @@ -638,7 +638,6 @@ union_vn_create(vpp, un, p) int fmode = FFLAGS(O_WRONLY|O_CREAT|O_TRUNC|O_EXCL); int error; int cmode = UN_FILEMODE & ~p->p_fd->fd_cmask; - char *cp; struct componentname cn; *vpp = NULLVP; @@ -664,7 +663,8 @@ union_vn_create(vpp, un, p) cn.cn_consume = 0; VREF(un->un_dirvp); - if (error = relookup(un->un_dirvp, &vp, &cn)) + error = relookup(un->un_dirvp, &vp, &cn); + if (error) return (error); vrele(un->un_dirvp); @@ -692,10 +692,12 @@ union_vn_create(vpp, un, p) vap->va_type = VREG; vap->va_mode = cmode; LEASE_CHECK(un->un_dirvp, p, cred, LEASE_WRITE); - if (error = VOP_CREATE(un->un_dirvp, &vp, &cn, vap)) + error = VOP_CREATE(un->un_dirvp, &vp, &cn, vap); + if (error) return (error); - if (error = VOP_OPEN(vp, fmode, cred, p)) { + error = VOP_OPEN(vp, fmode, cred, p); + if (error) { vput(vp); return (error); } diff --git a/sys/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c index 3cfbd69..580941e 100644 --- a/sys/fs/unionfs/union_vfsops.c +++ b/sys/fs/unionfs/union_vfsops.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vfsops.c 8.7 (Berkeley) 3/5/94 - * $Id: union_vfsops.c,v 1.4 1994/09/21 03:47:13 wollman Exp $ + * $Id: union_vfsops.c,v 1.5 1994/09/22 19:38:20 wollman Exp $ */ /* @@ -127,7 +127,8 @@ union_mount(mp, path, data, ndp, p) /* * Get argument */ - if (error = copyin(data, (caddr_t)&args, sizeof(struct union_args))) + error = copyin(data, (caddr_t)&args, sizeof(struct union_args)); + if (error) goto bad; lowerrootvp = mp->mnt_vnodecovered; @@ -147,7 +148,8 @@ union_mount(mp, path, data, ndp, p) UIO_USERSPACE, args.target, p); p->p_ucred = scred; - if (error = namei(ndp)) + error = namei(ndp); + if (error) goto bad; upperrootvp = ndp->ni_vp; @@ -317,13 +319,15 @@ union_unmount(mp, mntflags, p) flags |= FORCECLOSE; } - if (error = union_root(mp, &um_rootvp)) + error = union_root(mp, &um_rootvp); + if (error) return (error); if (um_rootvp->v_usecount > 1) { vput(um_rootvp); return (EBUSY); } - if (error = vflush(mp, um_rootvp, flags)) { + error = vflush(mp, um_rootvp, flags); + if (error) { vput(um_rootvp); return (error); } diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index b47ba48..decf8f3 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vnops.c 8.6 (Berkeley) 2/17/94 - * $Id: union_vnops.c,v 1.5 1994/09/21 23:22:45 wollman Exp $ + * $Id: union_vnops.c,v 1.6 1994/10/06 21:06:49 davidg Exp $ */ #include <sys/param.h> @@ -132,7 +132,8 @@ union_lookup1(udvp, dvp, vpp, cnp) continue; } - if (error = VFS_ROOT(mp, &tdvp)) { + error = VFS_ROOT(mp, &tdvp); + if (error) { vput(dvp); return (error); } @@ -162,7 +163,6 @@ union_lookup(ap) struct union_node *dun = VTOUNION(dvp); struct componentname *cnp = ap->a_cnp; int lockparent = cnp->cn_flags & LOCKPARENT; - int rdonly = cnp->cn_flags & RDONLY; struct union_mount *um = MOUNTTOUNIONMOUNT(dvp->v_mount); struct ucred *saved_cred = 0; @@ -574,12 +574,14 @@ union_access(ap) int error = EACCES; struct vnode *vp; - if (vp = un->un_uppervp) { + vp = un->un_uppervp; + if (vp) { FIXUP(un); return (VOP_ACCESS(vp, ap->a_mode, ap->a_cred, ap->a_p)); } - if (vp = un->un_lowervp) { + vp = un->un_lowervp; + if (vp) { VOP_LOCK(vp); error = VOP_ACCESS(vp, ap->a_mode, ap->a_cred, ap->a_p); if (error == 0) { @@ -1109,7 +1111,6 @@ union_symlink(ap) if (dvp) { int error; struct vnode *vp; - struct mount *mp = ap->a_dvp->v_mount; FIXUP(un); VREF(dvp); @@ -1357,7 +1358,7 @@ union_print(ap) { struct vnode *vp = ap->a_vp; - printf("\ttag VT_UNION, vp=%x, uppervp=%x, lowervp=%x\n", + printf("\ttag VT_UNION, vp=%p, uppervp=%p, lowervp=%p\n", vp, UPPERVP(vp), LOWERVP(vp)); return (0); } |