From 51809f03ebf6008e415c3f15a3c82c8e4ddb8e07 Mon Sep 17 00:00:00 2001 From: julian Date: Sat, 27 Feb 1999 07:06:05 +0000 Subject: Fix code for union mounts Accidentally deleted by peter when he extracted the unionfs stuff in 1.109 Submitted by: Tony Finch --- sys/kern/vfs_extattr.c | 24 +++++++++++++++++++++++- sys/kern/vfs_syscalls.c | 24 +++++++++++++++++++++++- 2 files changed, 46 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 191b9f8..642dbd2 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 - * $Id: vfs_syscalls.c,v 1.117 1999/02/16 10:49:49 dfr Exp $ + * $Id: vfs_syscalls.c,v 1.118 1999/02/25 15:54:06 bde Exp $ */ /* For 4.3 integer FS ID compatibility */ @@ -2756,6 +2756,17 @@ 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)); p->p_retval[0] = SCARG(uap, count) - auio.uio_resid; @@ -2822,6 +2833,17 @@ 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), sizeof(long)); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 191b9f8..642dbd2 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 - * $Id: vfs_syscalls.c,v 1.117 1999/02/16 10:49:49 dfr Exp $ + * $Id: vfs_syscalls.c,v 1.118 1999/02/25 15:54:06 bde Exp $ */ /* For 4.3 integer FS ID compatibility */ @@ -2756,6 +2756,17 @@ 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)); p->p_retval[0] = SCARG(uap, count) - auio.uio_resid; @@ -2822,6 +2833,17 @@ 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), sizeof(long)); -- cgit v1.1