diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2003-01-31 20:41:30 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2003-01-31 20:41:30 +0000 |
commit | c53791d902c38c1c191d62126c175a5697e6102d (patch) | |
tree | 25e64c458066a42bbd00f52339f469ffce58a6a0 | |
parent | 6f32dfe01ce7a615d48b8e11e65455a701ba85a9 (diff) |
Sigh. I comitted the wrong diff in the last vfs changes.
These are the files that were ok:ed and tested.
-rw-r--r-- | sys/miscfs/kernfs/kernfs_vfsops.c | 32 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs.h | 3 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_vfsops.c | 27 | ||||
-rw-r--r-- | sys/sys/namei.h | 4 |
4 files changed, 19 insertions, 47 deletions
diff --git a/sys/miscfs/kernfs/kernfs_vfsops.c b/sys/miscfs/kernfs/kernfs_vfsops.c index 561c2c4e904..5d25f33e911 100644 --- a/sys/miscfs/kernfs/kernfs_vfsops.c +++ b/sys/miscfs/kernfs/kernfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kernfs_vfsops.c,v 1.20 2003/01/31 17:37:50 art Exp $ */ +/* $OpenBSD: kernfs_vfsops.c,v 1.21 2003/01/31 20:41:29 art Exp $ */ /* $NetBSD: kernfs_vfsops.c,v 1.26 1996/04/22 01:42:27 christos Exp $ */ /* @@ -102,10 +102,7 @@ kernfs_mount(mp, path, data, ndp, p) struct nameidata *ndp; struct proc *p; { - int error = 0; size_t size; - struct vnode *rvp; - struct kern_target *kt; #ifdef KERNFS_DIAGNOSTIC printf("kernfs_mount(mp = %p)\n", mp); @@ -117,17 +114,7 @@ kernfs_mount(mp, path, data, ndp, p) if (mp->mnt_flag & MNT_UPDATE) return (EOPNOTSUPP); - kt = kernfs_findtarget(".", 1); - error = kernfs_allocvp(kt, mp, &rvp); - if (error) - return (error); - - rvp->v_type = VDIR; - rvp->v_flag |= VROOT; - mp->mnt_flag |= MNT_LOCAL; - mp->mnt_data = (qaddr_t)rvp; - vrele(rvp); vfs_getnewfsid(mp); (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size); @@ -171,12 +158,8 @@ kernfs_unmount(mp, mntflags, p) #ifdef KERNFS_DIAGNOSTIC printf("kernfs_unmount: calling vflush\n"); #endif - - if ((error = vflush(mp, 0, flags)) != 0) { + if ((error = vflush(mp, 0, flags)) != 0) return (error); - } - - mp->mnt_data = 0; return (0); } @@ -186,14 +169,17 @@ kernfs_root(mp, vpp) struct mount *mp; struct vnode **vpp; { - struct vnode *vp = (struct vnode *)mp->mnt_data; + struct kern_target *kt; + int error; #ifdef KERNFS_DIAGNOSTIC printf("kernfs_root(mp = %p)\n", mp); #endif - - vget(vp, LK_EXCLUSIVE | LK_RETRY, curproc); - *vpp = vp; + kt = kernfs_findtarget(".", 1); + error = kernfs_allocvp(kt, mp, vpp); + if (error) + return (error); + vn_lock(*vpp, LK_EXCLUSIVE, curproc); return (0); } diff --git a/sys/miscfs/procfs/procfs.h b/sys/miscfs/procfs/procfs.h index 83577da1934..afd52387c25 100644 --- a/sys/miscfs/procfs/procfs.h +++ b/sys/miscfs/procfs/procfs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs.h,v 1.16 2003/01/31 17:37:50 art Exp $ */ +/* $OpenBSD: procfs.h,v 1.17 2003/01/31 20:41:29 art Exp $ */ /* $NetBSD: procfs.h,v 1.17 1996/02/12 15:01:41 christos Exp $ */ /* @@ -104,7 +104,6 @@ struct procfs_args { struct procfsmount { void *pmnt_exechook; int pmnt_flags; - struct vnode *rvp; }; #define VFSTOPROC(mp) ((struct procfsmount *)(mp)->mnt_data) diff --git a/sys/miscfs/procfs/procfs_vfsops.c b/sys/miscfs/procfs/procfs_vfsops.c index 166de670487..3db5f2589ca 100644 --- a/sys/miscfs/procfs/procfs_vfsops.c +++ b/sys/miscfs/procfs/procfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_vfsops.c,v 1.17 2003/01/31 17:37:50 art Exp $ */ +/* $OpenBSD: procfs_vfsops.c,v 1.18 2003/01/31 20:41:29 art Exp $ */ /* $NetBSD: procfs_vfsops.c,v 1.25 1996/02/09 22:40:53 christos Exp $ */ /* @@ -82,7 +82,6 @@ procfs_mount(mp, path, data, ndp, p) size_t size; struct procfsmount *pmnt; struct procfs_args args; - struct vnode *rvp; int error; if (UIO_MX & (UIO_MX-1)) { @@ -103,18 +102,10 @@ procfs_mount(mp, path, data, ndp, p) } else args.flags = 0; - error = procfs_allocvp(mp, &rvp, 0, Proot); - if (error) - return (error); - rvp->v_type = VDIR; - rvp->v_flag |= VROOT; - mp->mnt_flag |= MNT_LOCAL; pmnt = (struct procfsmount *) malloc(sizeof(struct procfsmount), M_UFSMNT, M_WAITOK); /* XXX need new malloc type */ - pmnt->rvp = rvp; - mp->mnt_data = (qaddr_t)pmnt; vfs_getnewfsid(mp); @@ -143,7 +134,6 @@ procfs_unmount(mp, mntflags, p) int error; extern int doforce; int flags = 0; - struct vnode *rvp = VFSTOPROC(mp)->rvp; if (mntflags & MNT_FORCE) { /* procfs can never be rootfs so don't check for it */ @@ -152,12 +142,8 @@ procfs_unmount(mp, mntflags, p) flags |= FORCECLOSE; } - vrele(rvp); - - if ((error = vflush(mp, 0, flags)) != 0) { - vget(rvp, 0, curproc); + if ((error = vflush(mp, 0, flags)) != 0) return (error); - } free(VFSTOPROC(mp), M_UFSMNT); mp->mnt_data = 0; @@ -170,11 +156,12 @@ procfs_root(mp, vpp) struct mount *mp; struct vnode **vpp; { - struct vnode *vp = VFSTOPROC(mp)->rvp; + int error; - VREF(vp); - vn_lock(vp, LK_EXCLUSIVE, curproc); - *vpp = vp; + error = procfs_allocvp(mp, vpp, 0, Proot); + if (error) + return (error); + vn_lock(*vpp, LK_EXCLUSIVE, curproc); return (0); } diff --git a/sys/sys/namei.h b/sys/sys/namei.h index 1663891d357..86da213e1d0 100644 --- a/sys/sys/namei.h +++ b/sys/sys/namei.h @@ -1,4 +1,4 @@ -/* $OpenBSD: namei.h,v 1.10 2003/01/31 17:37:50 art Exp $ */ +/* $OpenBSD: namei.h,v 1.11 2003/01/31 20:41:29 art Exp $ */ /* $NetBSD: namei.h,v 1.11 1996/02/09 18:25:20 christos Exp $ */ /* @@ -141,7 +141,7 @@ struct nameidata { #define REQUIREDIR 0x080000 /* must be a directory */ #define STRIPSLASHES 0x100000 /* strip trailing slashes */ #define PDIRUNLOCK 0x200000 /* vfs_lookup() unlocked parent dir */ -#define PARAMASK 0x2fff00 /* mask of parameter descriptors */ + /* * Initialization of an nameidata structure. */ |