Slight cleanup of code resurected for union mounts..

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

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)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 */
@ -2749,23 +2749,24 @@ ogetdirentries(p, uap)
VOP_UNLOCK(vp, 0, p);
if (error)
return (error);
if (union_dircheckp && SCARG(uap, count) == auio.uio_resid) {
error = union_dircheckp(p, &vp, fp);
if (error == -1)
if (SCARG(uap, count) == auio.uio_resid) {
if (union_dircheckp) {
error = union_dircheckp(p, &vp, fp);
if (error == -1)
goto unionread;
if (error)
return (error);
}
if ((vp->v_flag & VROOT) &&
(vp->v_mount->mnt_flag & MNT_UNION)) {
struct vnode *tvp = vp;
vp = vp->v_mount->mnt_vnodecovered;
VREF(vp);
fp->f_data = (caddr_t) vp;
fp->f_offset = 0;
vrele(tvp);
goto unionread;
if (error)
return (error);
}
if ((SCARG(uap, count) == auio.uio_resid) &&
(vp->v_flag & VROOT) &&
(vp->v_mount->mnt_flag & MNT_UNION)) {
struct vnode *tvp = vp;
vp = vp->v_mount->mnt_vnodecovered;
VREF(vp);
fp->f_data = (caddr_t) vp;
fp->f_offset = 0;
vrele(tvp);
goto unionread;
}
}
error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep),
sizeof(long));
@ -2826,23 +2827,24 @@ getdirentries(p, uap)
VOP_UNLOCK(vp, 0, p);
if (error)
return (error);
if (union_dircheckp && SCARG(uap, count) == auio.uio_resid) {
error = union_dircheckp(p, &vp, fp);
if (error == -1)
if (SCARG(uap, count) == auio.uio_resid) {
if (union_dircheckp) {
error = union_dircheckp(p, &vp, fp);
if (error == -1)
goto unionread;
if (error)
return (error);
}
if ((vp->v_flag & VROOT) &&
(vp->v_mount->mnt_flag & MNT_UNION)) {
struct vnode *tvp = vp;
vp = vp->v_mount->mnt_vnodecovered;
VREF(vp);
fp->f_data = (caddr_t) vp;
fp->f_offset = 0;
vrele(tvp);
goto unionread;
if (error)
return (error);
}
if ((SCARG(uap, count) == auio.uio_resid) &&
(vp->v_flag & VROOT) &&
(vp->v_mount->mnt_flag & MNT_UNION)) {
struct vnode *tvp = vp;
vp = vp->v_mount->mnt_vnodecovered;
VREF(vp);
fp->f_data = (caddr_t) vp;
fp->f_offset = 0;
vrele(tvp);
goto unionread;
}
}
if (SCARG(uap, basep) != NULL) {
error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep),

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)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 */
@ -2749,23 +2749,24 @@ ogetdirentries(p, uap)
VOP_UNLOCK(vp, 0, p);
if (error)
return (error);
if (union_dircheckp && SCARG(uap, count) == auio.uio_resid) {
error = union_dircheckp(p, &vp, fp);
if (error == -1)
if (SCARG(uap, count) == auio.uio_resid) {
if (union_dircheckp) {
error = union_dircheckp(p, &vp, fp);
if (error == -1)
goto unionread;
if (error)
return (error);
}
if ((vp->v_flag & VROOT) &&
(vp->v_mount->mnt_flag & MNT_UNION)) {
struct vnode *tvp = vp;
vp = vp->v_mount->mnt_vnodecovered;
VREF(vp);
fp->f_data = (caddr_t) vp;
fp->f_offset = 0;
vrele(tvp);
goto unionread;
if (error)
return (error);
}
if ((SCARG(uap, count) == auio.uio_resid) &&
(vp->v_flag & VROOT) &&
(vp->v_mount->mnt_flag & MNT_UNION)) {
struct vnode *tvp = vp;
vp = vp->v_mount->mnt_vnodecovered;
VREF(vp);
fp->f_data = (caddr_t) vp;
fp->f_offset = 0;
vrele(tvp);
goto unionread;
}
}
error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep),
sizeof(long));
@ -2826,23 +2827,24 @@ getdirentries(p, uap)
VOP_UNLOCK(vp, 0, p);
if (error)
return (error);
if (union_dircheckp && SCARG(uap, count) == auio.uio_resid) {
error = union_dircheckp(p, &vp, fp);
if (error == -1)
if (SCARG(uap, count) == auio.uio_resid) {
if (union_dircheckp) {
error = union_dircheckp(p, &vp, fp);
if (error == -1)
goto unionread;
if (error)
return (error);
}
if ((vp->v_flag & VROOT) &&
(vp->v_mount->mnt_flag & MNT_UNION)) {
struct vnode *tvp = vp;
vp = vp->v_mount->mnt_vnodecovered;
VREF(vp);
fp->f_data = (caddr_t) vp;
fp->f_offset = 0;
vrele(tvp);
goto unionread;
if (error)
return (error);
}
if ((SCARG(uap, count) == auio.uio_resid) &&
(vp->v_flag & VROOT) &&
(vp->v_mount->mnt_flag & MNT_UNION)) {
struct vnode *tvp = vp;
vp = vp->v_mount->mnt_vnodecovered;
VREF(vp);
fp->f_data = (caddr_t) vp;
fp->f_offset = 0;
vrele(tvp);
goto unionread;
}
}
if (SCARG(uap, basep) != NULL) {
error = copyout((caddr_t)&loff, (caddr_t)SCARG(uap, basep),