diff options
Diffstat (limited to 'sys/miscfs/procfs')
-rw-r--r-- | sys/miscfs/procfs/procfs.h | 6 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_subr.c | 13 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_vfsops.c | 83 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_vnops.c | 11 |
4 files changed, 31 insertions, 82 deletions
diff --git a/sys/miscfs/procfs/procfs.h b/sys/miscfs/procfs/procfs.h index 413c6509b4f..5741a9349df 100644 --- a/sys/miscfs/procfs/procfs.h +++ b/sys/miscfs/procfs/procfs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs.h,v 1.7 1997/10/06 20:20:33 deraadt Exp $ */ +/* $OpenBSD: procfs.h,v 1.8 1997/11/06 05:58:42 csapuntz Exp $ */ /* $NetBSD: procfs.h,v 1.17 1996/02/12 15:01:41 christos Exp $ */ /* @@ -128,7 +128,9 @@ int procfs_rw __P((void *)); extern int (**procfs_vnodeop_p) __P((void *)); extern struct vfsops procfs_vfsops; -void procfs_init __P((void)); +struct vfsconf; + +int procfs_init __P((struct vfsconf *)); int procfs_root __P((struct mount *, struct vnode **)); #endif /* _KERNEL */ diff --git a/sys/miscfs/procfs/procfs_subr.c b/sys/miscfs/procfs/procfs_subr.c index 24cae7cb845..46642a7c980 100644 --- a/sys/miscfs/procfs/procfs_subr.c +++ b/sys/miscfs/procfs/procfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_subr.c,v 1.10 1997/10/06 20:20:33 deraadt Exp $ */ +/* $OpenBSD: procfs_subr.c,v 1.11 1997/11/06 05:58:43 csapuntz Exp $ */ /* $NetBSD: procfs_subr.c,v 1.15 1996/02/12 15:01:42 christos Exp $ */ /* @@ -54,10 +54,14 @@ static TAILQ_HEAD(, pfsnode) pfshead; static int pfsvplock; -void -procfs_init(void) +/*ARGSUSED*/ +int +procfs_init(vfsp) + struct vfsconf *vfsp; + { TAILQ_INIT(&pfshead); + return (0); } /* @@ -93,6 +97,7 @@ procfs_allocvp(mp, vpp, pid, pfs_type) long pid; pfstype pfs_type; { + struct proc *p = curproc; struct pfsnode *pfs; struct vnode *vp; int error; @@ -103,7 +108,7 @@ loop: if (pfs->pfs_pid == pid && pfs->pfs_type == pfs_type && vp->v_mount == mp) { - if (vget(vp, 0)) + if (vget(vp, 0, p)) goto loop; *vpp = vp; return (0); diff --git a/sys/miscfs/procfs/procfs_vfsops.c b/sys/miscfs/procfs/procfs_vfsops.c index c2c31b37595..297323b8d94 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.6 1997/10/06 20:20:34 deraadt Exp $ */ +/* $OpenBSD: procfs_vfsops.c,v 1.7 1997/11/06 05:58:43 csapuntz Exp $ */ /* $NetBSD: procfs_vfsops.c,v 1.25 1996/02/09 22:40:53 christos Exp $ */ /* @@ -61,14 +61,7 @@ int procfs_mount __P((struct mount *, char *, caddr_t, struct nameidata *, struct proc *)); int procfs_start __P((struct mount *, int, struct proc *)); int procfs_unmount __P((struct mount *, int, struct proc *)); -int procfs_quotactl __P((struct mount *, int, uid_t, caddr_t, - struct proc *)); int procfs_statfs __P((struct mount *, struct statfs *, struct proc *)); -int procfs_sync __P((struct mount *, int, struct ucred *, struct proc *)); -int procfs_vget __P((struct mount *, ino_t, struct vnode **)); -int procfs_fhtovp __P((struct mount *, struct fid *, struct mbuf *, - struct vnode **, int *, struct ucred **)); -int procfs_vptofh __P((struct vnode *, struct fid *)); /* * VFS Operations. * @@ -95,7 +88,7 @@ procfs_mount(mp, path, data, ndp, p) mp->mnt_flag |= MNT_LOCAL; mp->mnt_data = 0; - getnewfsid(mp, makefstype(MOUNT_PROCFS)); + vfs_getnewfsid(mp); (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN, &size); bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size); @@ -179,72 +172,25 @@ procfs_statfs(mp, sbp, p) bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN); bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN); } - strncpy(sbp->f_fstypename, mp->mnt_op->vfs_name, MFSNAMELEN); + strncpy(sbp->f_fstypename, mp->mnt_vfc->vfc_name, MFSNAMELEN); return (0); } -/*ARGSUSED*/ -int -procfs_quotactl(mp, cmds, uid, arg, p) - struct mount *mp; - int cmds; - uid_t uid; - caddr_t arg; - struct proc *p; -{ - - return (EOPNOTSUPP); -} - -/*ARGSUSED*/ -int -procfs_sync(mp, waitfor, uc, p) - struct mount *mp; - int waitfor; - struct ucred *uc; - struct proc *p; -{ - return (0); -} +#define procfs_sync ((int (*) __P((struct mount *, int, struct ucred *, \ + struct proc *)))nullop) -/*ARGSUSED*/ -int -procfs_vget(mp, ino, vpp) - struct mount *mp; - ino_t ino; - struct vnode **vpp; -{ - - return (EOPNOTSUPP); -} - -/*ARGSUSED*/ -int -procfs_fhtovp(mp, fhp, mb, vpp, what, anon) - struct mount *mp; - struct fid *fhp; - struct mbuf *mb; - struct vnode **vpp; - int *what; - struct ucred **anon; -{ - - return (EINVAL); -} - -/*ARGSUSED*/ -int -procfs_vptofh(vp, fhp) - struct vnode *vp; - struct fid *fhp; -{ - - return (EINVAL); -} +#define procfs_fhtovp ((int (*) __P((struct mount *, struct fid *, \ + struct mbuf *, struct vnode **, int *, struct ucred **)))eopnotsupp) +#define procfs_quotactl ((int (*) __P((struct mount *, int, uid_t, caddr_t, \ + struct proc *)))eopnotsupp) +#define procfs_sysctl ((int (*) __P((int *, u_int, void *, size_t *, void *, \ + size_t, struct proc *)))eopnotsupp) +#define procfs_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \ + eopnotsupp) +#define procfs_vptofh ((int (*) __P((struct vnode *, struct fid *)))eopnotsupp) struct vfsops procfs_vfsops = { - MOUNT_PROCFS, procfs_mount, procfs_start, procfs_unmount, @@ -256,4 +202,5 @@ struct vfsops procfs_vfsops = { procfs_fhtovp, procfs_vptofh, procfs_init, + procfs_sysctl }; diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c index 3a7556f819a..11a74d5bd5b 100644 --- a/sys/miscfs/procfs/procfs_vnops.c +++ b/sys/miscfs/procfs/procfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_vnops.c,v 1.8 1997/10/06 20:20:35 deraadt Exp $ */ +/* $OpenBSD: procfs_vnops.c,v 1.9 1997/11/06 05:58:43 csapuntz Exp $ */ /* $NetBSD: procfs_vnops.c,v 1.40 1996/03/16 23:52:55 christos Exp $ */ /* @@ -728,6 +728,7 @@ procfs_lookup(v) struct vnode **vpp = ap->a_vpp; struct vnode *dvp = ap->a_dvp; char *pname = cnp->cn_nameptr; + struct proc *curp = curproc; struct proc_target *pt; struct vnode *fvp; pid_t pid; @@ -787,7 +788,7 @@ procfs_lookup(v) fvp = procfs_findtextvp(p); /* We already checked that it exists. */ VREF(fvp); - VOP_LOCK(fvp); + vn_lock(fvp, LK_EXCLUSIVE | LK_RETRY, curp); *vpp = fvp; return (0); } @@ -839,8 +840,6 @@ procfs_readdir(v) struct pfsnode *pfs; int i; int error; - u_long *cookies = ap->a_cookies; - int ncookies = ap->a_ncookies; pfs = VTOPFS(ap->a_vp); @@ -880,8 +879,6 @@ procfs_readdir(v) if ((error = uiomove((caddr_t)&d, UIO_MX, uio)) != 0) break; - if (ncookies-- > 0) - *cookies++ = i + 1; } break; @@ -943,8 +940,6 @@ procfs_readdir(v) if ((error = uiomove((caddr_t)&d, UIO_MX, uio)) != 0) break; - if (ncookies-- > 0) - *cookies++ = i + 1; } done: |