diff options
author | julian <julian@FreeBSD.org> | 1999-02-27 07:06:05 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1999-02-27 07:06:05 +0000 |
commit | 51809f03ebf6008e415c3f15a3c82c8e4ddb8e07 (patch) | |
tree | 6d4b99607d484bed9766353c8e73d18eb0c52ee7 /sys | |
parent | 0dd31950cdce992fa20722e191aef96b3f8b3a8b (diff) | |
download | FreeBSD-src-51809f03ebf6008e415c3f15a3c82c8e4ddb8e07.zip FreeBSD-src-51809f03ebf6008e415c3f15a3c82c8e4ddb8e07.tar.gz |
Fix code for union mounts
Accidentally deleted by peter when he extracted the unionfs stuff in 1.109
Submitted by: Tony Finch <dot@dotat.at>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_extattr.c | 24 | ||||
-rw-r--r-- | sys/kern/vfs_syscalls.c | 24 |
2 files changed, 46 insertions, 2 deletions
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)); |