Slight cleanup of code resurected for union mounts..

Submitted by: Tony Finch <dot@dotat.at>
This commit is contained in:
julian 1999-03-03 02:35:51 +00:00
parent 9e3d479b9d
commit caaaa6363b
2 changed files with 70 additions and 66 deletions

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
* $Id: vfs_syscalls.c,v 1.118 1999/02/25 15:54:06 bde Exp $ * $Id: vfs_syscalls.c,v 1.119 1999/02/27 07:06:05 julian Exp $
*/ */
/* For 4.3 integer FS ID compatibility */ /* For 4.3 integer FS ID compatibility */
@ -2749,15 +2749,15 @@ unionread:
VOP_UNLOCK(vp, 0, p); VOP_UNLOCK(vp, 0, p);
if (error) if (error)
return (error); return (error);
if (union_dircheckp && SCARG(uap, count) == auio.uio_resid) { if (SCARG(uap, count) == auio.uio_resid) {
if (union_dircheckp) {
error = union_dircheckp(p, &vp, fp); error = union_dircheckp(p, &vp, fp);
if (error == -1) if (error == -1)
goto unionread; goto unionread;
if (error) if (error)
return (error); return (error);
} }
if ((SCARG(uap, count) == auio.uio_resid) && if ((vp->v_flag & VROOT) &&
(vp->v_flag & VROOT) &&
(vp->v_mount->mnt_flag & MNT_UNION)) { (vp->v_mount->mnt_flag & MNT_UNION)) {
struct vnode *tvp = vp; struct vnode *tvp = vp;
vp = vp->v_mount->mnt_vnodecovered; vp = vp->v_mount->mnt_vnodecovered;
@ -2767,6 +2767,7 @@ unionread:
vrele(tvp); vrele(tvp);
goto unionread; goto unionread;
} }
}
error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep), error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep),
sizeof(long)); sizeof(long));
p->p_retval[0] = SCARG(uap, count) - auio.uio_resid; p->p_retval[0] = SCARG(uap, count) - auio.uio_resid;
@ -2826,15 +2827,15 @@ unionread:
VOP_UNLOCK(vp, 0, p); VOP_UNLOCK(vp, 0, p);
if (error) if (error)
return (error); return (error);
if (union_dircheckp && SCARG(uap, count) == auio.uio_resid) { if (SCARG(uap, count) == auio.uio_resid) {
if (union_dircheckp) {
error = union_dircheckp(p, &vp, fp); error = union_dircheckp(p, &vp, fp);
if (error == -1) if (error == -1)
goto unionread; goto unionread;
if (error) if (error)
return (error); return (error);
} }
if ((SCARG(uap, count) == auio.uio_resid) && if ((vp->v_flag & VROOT) &&
(vp->v_flag & VROOT) &&
(vp->v_mount->mnt_flag & MNT_UNION)) { (vp->v_mount->mnt_flag & MNT_UNION)) {
struct vnode *tvp = vp; struct vnode *tvp = vp;
vp = vp->v_mount->mnt_vnodecovered; vp = vp->v_mount->mnt_vnodecovered;
@ -2844,6 +2845,7 @@ unionread:
vrele(tvp); vrele(tvp);
goto unionread; goto unionread;
} }
}
if (SCARG(uap, basep) != NULL) { if (SCARG(uap, basep) != NULL) {
error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep), error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep),
sizeof(long)); sizeof(long));

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
* $Id: vfs_syscalls.c,v 1.118 1999/02/25 15:54:06 bde Exp $ * $Id: vfs_syscalls.c,v 1.119 1999/02/27 07:06:05 julian Exp $
*/ */
/* For 4.3 integer FS ID compatibility */ /* For 4.3 integer FS ID compatibility */
@ -2749,15 +2749,15 @@ unionread:
VOP_UNLOCK(vp, 0, p); VOP_UNLOCK(vp, 0, p);
if (error) if (error)
return (error); return (error);
if (union_dircheckp && SCARG(uap, count) == auio.uio_resid) { if (SCARG(uap, count) == auio.uio_resid) {
if (union_dircheckp) {
error = union_dircheckp(p, &vp, fp); error = union_dircheckp(p, &vp, fp);
if (error == -1) if (error == -1)
goto unionread; goto unionread;
if (error) if (error)
return (error); return (error);
} }
if ((SCARG(uap, count) == auio.uio_resid) && if ((vp->v_flag & VROOT) &&
(vp->v_flag & VROOT) &&
(vp->v_mount->mnt_flag & MNT_UNION)) { (vp->v_mount->mnt_flag & MNT_UNION)) {
struct vnode *tvp = vp; struct vnode *tvp = vp;
vp = vp->v_mount->mnt_vnodecovered; vp = vp->v_mount->mnt_vnodecovered;
@ -2767,6 +2767,7 @@ unionread:
vrele(tvp); vrele(tvp);
goto unionread; goto unionread;
} }
}
error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep), error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep),
sizeof(long)); sizeof(long));
p->p_retval[0] = SCARG(uap, count) - auio.uio_resid; p->p_retval[0] = SCARG(uap, count) - auio.uio_resid;
@ -2826,15 +2827,15 @@ unionread:
VOP_UNLOCK(vp, 0, p); VOP_UNLOCK(vp, 0, p);
if (error) if (error)
return (error); return (error);
if (union_dircheckp && SCARG(uap, count) == auio.uio_resid) { if (SCARG(uap, count) == auio.uio_resid) {
if (union_dircheckp) {
error = union_dircheckp(p, &vp, fp); error = union_dircheckp(p, &vp, fp);
if (error == -1) if (error == -1)
goto unionread; goto unionread;
if (error) if (error)
return (error); return (error);
} }
if ((SCARG(uap, count) == auio.uio_resid) && if ((vp->v_flag & VROOT) &&
(vp->v_flag & VROOT) &&
(vp->v_mount->mnt_flag & MNT_UNION)) { (vp->v_mount->mnt_flag & MNT_UNION)) {
struct vnode *tvp = vp; struct vnode *tvp = vp;
vp = vp->v_mount->mnt_vnodecovered; vp = vp->v_mount->mnt_vnodecovered;
@ -2844,6 +2845,7 @@ unionread:
vrele(tvp); vrele(tvp);
goto unionread; goto unionread;
} }
}
if (SCARG(uap, basep) != NULL) { if (SCARG(uap, basep) != NULL) {
error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep), error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep),
sizeof(long)); sizeof(long));