From ac424f9b0252e3ca105fa2635876d3659eaf9af8 Mon Sep 17 00:00:00 2001 From: Chris Pressey Date: Sun, 2 May 2004 03:05:11 +0000 Subject: [PATCH] Style(9) cleanup to src/sys/vfs, stage 15/21: procfs. - Convert K&R-style function definitions to ANSI style. Submitted-by: Andre Nathan Additional-reformatting-by: cpressey --- sys/vfs/procfs/procfs_ctl.c | 14 +--- sys/vfs/procfs/procfs_dbregs.c | 13 +--- sys/vfs/procfs/procfs_fpregs.c | 13 +--- sys/vfs/procfs/procfs_map.c | 12 +-- sys/vfs/procfs/procfs_mem.c | 19 ++--- sys/vfs/procfs/procfs_note.c | 9 +-- sys/vfs/procfs/procfs_regs.c | 13 +--- sys/vfs/procfs/procfs_rlimit.c | 9 +-- sys/vfs/procfs/procfs_status.c | 16 ++-- sys/vfs/procfs/procfs_subr.c | 21 ++--- sys/vfs/procfs/procfs_type.c | 12 +-- sys/vfs/procfs/procfs_vfsops.c | 19 ++--- sys/vfs/procfs/procfs_vnops.c | 135 ++++++++++++--------------------- 13 files changed, 98 insertions(+), 207 deletions(-) diff --git a/sys/vfs/procfs/procfs_ctl.c b/sys/vfs/procfs/procfs_ctl.c index b904ca035d..943d35bb88 100644 --- a/sys/vfs/procfs/procfs_ctl.c +++ b/sys/vfs/procfs/procfs_ctl.c @@ -38,7 +38,7 @@ * * From: * $FreeBSD: src/sys/miscfs/procfs/procfs_ctl.c,v 1.20.2.2 2002/01/22 17:22:59 nectar Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_ctl.c,v 1.6 2003/08/20 09:56:33 rob Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_ctl.c,v 1.7 2004/05/02 03:05:11 cpressey Exp $ */ #include @@ -104,10 +104,7 @@ static vfs_namemap_t signames[] = { static int procfs_control (struct proc *curp, struct proc *p, int op); static int -procfs_control(curp, p, op) - struct proc *curp; - struct proc *p; - int op; +procfs_control(struct proc *curp, struct proc *p, int op) { int error; @@ -275,11 +272,8 @@ procfs_control(curp, p, op) } int -procfs_doctl(curp, p, pfs, uio) - struct proc *curp; - struct pfsnode *pfs; - struct uio *uio; - struct proc *p; +procfs_doctl(struct proc *curp, struct proc *p, struct pfsnode *pfs, + struct uio *uio) { int xlen; int error; diff --git a/sys/vfs/procfs/procfs_dbregs.c b/sys/vfs/procfs/procfs_dbregs.c index eb9e25a8cf..538eb11453 100644 --- a/sys/vfs/procfs/procfs_dbregs.c +++ b/sys/vfs/procfs/procfs_dbregs.c @@ -41,7 +41,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/miscfs/procfs/procfs_dbregs.c,v 1.4.2.3 2002/01/22 17:22:59 nectar Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_dbregs.c,v 1.5 2003/10/02 19:21:06 drhodus Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_dbregs.c,v 1.6 2004/05/02 03:05:11 cpressey Exp $ */ #include @@ -52,11 +52,8 @@ #include int -procfs_dodbregs(curp, p, pfs, uio) - struct proc *curp; - struct proc *p; - struct pfsnode *pfs; - struct uio *uio; +procfs_dodbregs(struct proc *curp, struct proc *p, struct pfsnode *pfs, + struct uio *uio) { int error; struct dbreg r; @@ -93,9 +90,7 @@ procfs_dodbregs(curp, p, pfs, uio) } int -procfs_validdbregs(p) - struct proc *p; +procfs_validdbregs(struct proc *p) { - return ((p->p_flag & P_SYSTEM) == 0); } diff --git a/sys/vfs/procfs/procfs_fpregs.c b/sys/vfs/procfs/procfs_fpregs.c index 2b00c57da2..7c8514fe6a 100644 --- a/sys/vfs/procfs/procfs_fpregs.c +++ b/sys/vfs/procfs/procfs_fpregs.c @@ -38,7 +38,7 @@ * * From: * $FreeBSD: src/sys/miscfs/procfs/procfs_fpregs.c,v 1.11.2.3 2002/01/22 17:22:59 nectar Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_fpregs.c,v 1.5 2003/10/02 19:21:06 drhodus Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_fpregs.c,v 1.6 2004/05/02 03:05:11 cpressey Exp $ */ #include @@ -49,11 +49,8 @@ #include int -procfs_dofpregs(curp, p, pfs, uio) - struct proc *curp; - struct proc *p; - struct pfsnode *pfs; - struct uio *uio; +procfs_dofpregs(struct proc *curp, struct proc *p, struct pfsnode *pfs, + struct uio *uio) { int error; struct fpreg r; @@ -90,9 +87,7 @@ procfs_dofpregs(curp, p, pfs, uio) } int -procfs_validfpregs(p) - struct proc *p; +procfs_validfpregs(struct proc *p) { - return ((p->p_flag & P_SYSTEM) == 0); } diff --git a/sys/vfs/procfs/procfs_map.c b/sys/vfs/procfs/procfs_map.c index 0bd8021ed4..91bfe3c0cc 100644 --- a/sys/vfs/procfs/procfs_map.c +++ b/sys/vfs/procfs/procfs_map.c @@ -37,7 +37,7 @@ * @(#)procfs_status.c 8.3 (Berkeley) 2/17/94 * * $FreeBSD: src/sys/miscfs/procfs/procfs_map.c,v 1.24.2.1 2001/08/04 13:12:24 rwatson Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_map.c,v 1.3 2003/08/07 21:17:43 dillon Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_map.c,v 1.4 2004/05/02 03:05:11 cpressey Exp $ */ #include @@ -67,11 +67,8 @@ * can try a bigger buffer. */ int -procfs_domap(curp, p, pfs, uio) - struct proc *curp; - struct proc *p; - struct pfsnode *pfs; - struct uio *uio; +procfs_domap(struct proc *curp, struct proc *p, struct pfsnode *pfs, + struct uio *uio) { int len; int error; @@ -179,8 +176,7 @@ case OBJT_DEVICE: } int -procfs_validmap(p) - struct proc *p; +procfs_validmap(struct proc *p) { return ((p->p_flag & P_SYSTEM) == 0); } diff --git a/sys/vfs/procfs/procfs_mem.c b/sys/vfs/procfs/procfs_mem.c index 6f3de8237b..77fe926cfe 100644 --- a/sys/vfs/procfs/procfs_mem.c +++ b/sys/vfs/procfs/procfs_mem.c @@ -38,7 +38,7 @@ * @(#)procfs_mem.c 8.5 (Berkeley) 6/15/94 * * $FreeBSD: src/sys/miscfs/procfs/procfs_mem.c,v 1.46.2.3 2002/01/22 17:22:59 nectar Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_mem.c,v 1.7 2003/09/03 11:47:04 hmp Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_mem.c,v 1.8 2004/05/02 03:05:11 cpressey Exp $ */ /* @@ -67,10 +67,7 @@ static int procfs_rwmem (struct proc *curp, struct proc *p, struct uio *uio); static int -procfs_rwmem(curp, p, uio) - struct proc *curp; - struct proc *p; - struct uio *uio; +procfs_rwmem(struct proc *curp, struct proc *p, struct uio *uio) { int error; int writing; @@ -235,13 +232,9 @@ procfs_rwmem(curp, p, uio) * from the kernel address space. */ int -procfs_domem(curp, p, pfs, uio) - struct proc *curp; - struct proc *p; - struct pfsnode *pfs; - struct uio *uio; +procfs_domem(struct proc *curp, struct proc *p, struct pfsnode *pfs, + struct uio *uio) { - if (uio->uio_resid == 0) return (0); @@ -280,9 +273,7 @@ procfs_domem(curp, p, pfs, uio) * */ struct vnode * -procfs_findtextvp(p) - struct proc *p; +procfs_findtextvp(struct proc *p) { - return (p->p_textvp); } diff --git a/sys/vfs/procfs/procfs_note.c b/sys/vfs/procfs/procfs_note.c index 7191db5af3..39d7de628b 100644 --- a/sys/vfs/procfs/procfs_note.c +++ b/sys/vfs/procfs/procfs_note.c @@ -37,7 +37,7 @@ * @(#)procfs_note.c 8.2 (Berkeley) 1/21/94 * * $FreeBSD: src/sys/miscfs/procfs/procfs_note.c,v 1.6 1999/08/28 00:46:55 peter Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_note.c,v 1.3 2003/08/07 21:17:43 dillon Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_note.c,v 1.4 2004/05/02 03:05:11 cpressey Exp $ */ #include @@ -45,11 +45,8 @@ #include int -procfs_donote(curp, p, pfs, uio) - struct proc *curp; - struct proc *p; - struct pfsnode *pfs; - struct uio *uio; +procfs_donote(struct proc *curp, struct proc *p, struct pfsnode *pfs, + struct uio *uio) { int xlen; int error; diff --git a/sys/vfs/procfs/procfs_regs.c b/sys/vfs/procfs/procfs_regs.c index ceae51459e..719378e550 100644 --- a/sys/vfs/procfs/procfs_regs.c +++ b/sys/vfs/procfs/procfs_regs.c @@ -38,7 +38,7 @@ * * From: * $FreeBSD: src/sys/miscfs/procfs/procfs_regs.c,v 1.10.2.3 2002/01/22 17:22:59 nectar Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_regs.c,v 1.6 2003/10/05 20:08:41 drhodus Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_regs.c,v 1.7 2004/05/02 03:05:11 cpressey Exp $ */ #include @@ -50,11 +50,8 @@ #include int -procfs_doregs(curp, p, pfs, uio) - struct proc *curp; - struct proc *p; - struct pfsnode *pfs; - struct uio *uio; +procfs_doregs(struct proc *curp, struct proc *p, struct pfsnode *pfs, + struct uio *uio) { int error; struct reg r; @@ -92,9 +89,7 @@ procfs_doregs(curp, p, pfs, uio) } int -procfs_validregs(p) - struct proc *p; +procfs_validregs(struct proc *p) { - return ((p->p_flag & P_SYSTEM) == 0); } diff --git a/sys/vfs/procfs/procfs_rlimit.c b/sys/vfs/procfs/procfs_rlimit.c index 15d20bffa0..36032b0808 100644 --- a/sys/vfs/procfs/procfs_rlimit.c +++ b/sys/vfs/procfs/procfs_rlimit.c @@ -37,7 +37,7 @@ * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94 * * $FreeBSD: src/sys/miscfs/procfs/procfs_rlimit.c,v 1.5 1999/12/08 08:59:37 phk Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_rlimit.c,v 1.4 2003/10/02 19:21:06 drhodus Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_rlimit.c,v 1.5 2004/05/02 03:05:11 cpressey Exp $ */ /* @@ -57,11 +57,8 @@ int -procfs_dorlimit(curp, p, pfs, uio) - struct proc *curp; - struct proc *p; - struct pfsnode *pfs; - struct uio *uio; +procfs_dorlimit(struct proc *curp, struct proc *p, struct pfsnode *pfs, + struct uio *uio) { char *ps; int i; diff --git a/sys/vfs/procfs/procfs_status.c b/sys/vfs/procfs/procfs_status.c index 0878ba49be..945aaae873 100644 --- a/sys/vfs/procfs/procfs_status.c +++ b/sys/vfs/procfs/procfs_status.c @@ -38,7 +38,7 @@ * * From: * $FreeBSD: src/sys/miscfs/procfs/procfs_status.c,v 1.20.2.4 2002/01/22 17:22:59 nectar Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_status.c,v 1.5 2003/10/02 19:21:06 drhodus Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_status.c,v 1.6 2004/05/02 03:05:11 cpressey Exp $ */ #include @@ -58,11 +58,8 @@ #define DOCHECK() do { if (ps >= psbuf+sizeof(psbuf)) goto bailout; } while (0) int -procfs_dostatus(curp, p, pfs, uio) - struct proc *curp; - struct proc *p; - struct pfsnode *pfs; - struct uio *uio; +procfs_dostatus(struct proc *curp, struct proc *p, struct pfsnode *pfs, + struct uio *uio) { struct session *sess; struct tty *tp; @@ -183,11 +180,8 @@ bailout: } int -procfs_docmdline(curp, p, pfs, uio) - struct proc *curp; - struct proc *p; - struct pfsnode *pfs; - struct uio *uio; +procfs_docmdline(struct proc *curp, struct proc *p, struct pfsnode *pfs, + struct uio *uio) { char *ps; int xlen; diff --git a/sys/vfs/procfs/procfs_subr.c b/sys/vfs/procfs/procfs_subr.c index dade967886..9c4bcf7f96 100644 --- a/sys/vfs/procfs/procfs_subr.c +++ b/sys/vfs/procfs/procfs_subr.c @@ -37,7 +37,7 @@ * @(#)procfs_subr.c 8.6 (Berkeley) 5/14/95 * * $FreeBSD: src/sys/miscfs/procfs/procfs_subr.c,v 1.26.2.3 2002/02/18 21:28:04 des Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_subr.c,v 1.6 2004/03/01 06:33:22 dillon Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_subr.c,v 1.7 2004/05/02 03:05:11 cpressey Exp $ */ #include @@ -80,11 +80,7 @@ static int pfsvplock; * the vnode free list. */ int -procfs_allocvp(mp, vpp, pid, pfs_type) - struct mount *mp; - struct vnode **vpp; - long pid; - pfstype pfs_type; +procfs_allocvp(struct mount *mp, struct vnode **vpp, long pid, pfstype pfs_type) { struct thread *td = curthread; /* XXX */ struct pfsnode *pfs; @@ -220,8 +216,7 @@ out: } int -procfs_freevp(vp) - struct vnode *vp; +procfs_freevp(struct vnode *vp) { struct pfsnode **pfspp; struct pfsnode *pfs = VTOPFS(vp); @@ -333,10 +328,7 @@ procfs_rw(struct vop_read_args *ap) * EFAULT: user i/o buffer is not addressable */ int -vfs_getuserstr(uio, buf, buflenp) - struct uio *uio; - char *buf; - int *buflenp; +vfs_getuserstr(struct uio *uio, char *buf, int *buflenp) { int xlen; int error; @@ -368,10 +360,7 @@ vfs_getuserstr(uio, buf, buflenp) } vfs_namemap_t * -vfs_findname(nm, buf, buflen) - vfs_namemap_t *nm; - char *buf; - int buflen; +vfs_findname(vfs_namemap_t *nm, char *buf, int buflen) { for (; nm->nm_name; nm++) diff --git a/sys/vfs/procfs/procfs_type.c b/sys/vfs/procfs/procfs_type.c index f87ccffabb..971f1e411c 100644 --- a/sys/vfs/procfs/procfs_type.c +++ b/sys/vfs/procfs/procfs_type.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/miscfs/procfs/procfs_type.c,v 1.6 1999/08/28 00:46:56 peter Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_type.c,v 1.3 2003/08/07 21:17:43 dillon Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_type.c,v 1.4 2004/05/02 03:05:11 cpressey Exp $ */ #include @@ -46,11 +46,8 @@ #include int -procfs_dotype(curp, p, pfs, uio) - struct proc *curp; - struct proc *p; - struct pfsnode *pfs; - struct uio *uio; +procfs_dotype(struct proc *curp, struct proc *p, struct pfsnode *pfs, + struct uio *uio) { int len; int error; @@ -79,8 +76,7 @@ procfs_dotype(curp, p, pfs, uio) } int -procfs_validtype(p) - struct proc *p; +procfs_validtype(struct proc *p) { return ((p->p_flag & P_SYSTEM) == 0); } diff --git a/sys/vfs/procfs/procfs_vfsops.c b/sys/vfs/procfs/procfs_vfsops.c index 49edf62918..eaca6af812 100644 --- a/sys/vfs/procfs/procfs_vfsops.c +++ b/sys/vfs/procfs/procfs_vfsops.c @@ -37,7 +37,7 @@ * @(#)procfs_vfsops.c 8.7 (Berkeley) 5/10/95 * * $FreeBSD: src/sys/miscfs/procfs/procfs_vfsops.c,v 1.32.2.1 2001/10/15 20:42:01 des Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_vfsops.c,v 1.5 2003/08/20 09:56:33 rob Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_vfsops.c,v 1.6 2004/05/02 03:05:11 cpressey Exp $ */ /* @@ -66,12 +66,8 @@ static int procfs_unmount (struct mount *mp, int mntflags, */ /* ARGSUSED */ static int -procfs_mount(mp, path, data, ndp, td) - struct mount *mp; - char *path; - caddr_t data; - struct nameidata *ndp; - struct thread *td; +procfs_mount(struct mount *mp, char *path, caddr_t data, struct nameidata *ndp, + struct thread *td) { size_t size; int error; @@ -103,10 +99,7 @@ procfs_mount(mp, path, data, ndp, td) * unmount system call */ static int -procfs_unmount(mp, mntflags, td) - struct mount *mp; - int mntflags; - struct thread *td; +procfs_unmount(struct mount *mp, int mntflags, struct thread *td) { int error; int flags = 0; @@ -125,9 +118,7 @@ procfs_unmount(mp, mntflags, td) } int -procfs_root(mp, vpp) - struct mount *mp; - struct vnode **vpp; +procfs_root(struct mount *mp, struct vnode **vpp) { return (procfs_allocvp(mp, vpp, 0, Proot)); diff --git a/sys/vfs/procfs/procfs_vnops.c b/sys/vfs/procfs/procfs_vnops.c index f46bdbb983..0b3edfa7f1 100644 --- a/sys/vfs/procfs/procfs_vnops.c +++ b/sys/vfs/procfs/procfs_vnops.c @@ -37,7 +37,7 @@ * @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95 * * $FreeBSD: src/sys/miscfs/procfs/procfs_vnops.c,v 1.76.2.7 2002/01/22 17:22:59 nectar Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_vnops.c,v 1.12 2004/04/24 04:32:05 drhodus Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_vnops.c,v 1.13 2004/05/02 03:05:11 cpressey Exp $ */ /* @@ -123,15 +123,12 @@ static pid_t atopid (const char *, u_int); * in particular for i/o. all that is done * is to support exclusive open on process * memory images. + * + * procfs_open(struct vnode *a_vp, int a_mode, struct ucred *a_cred, + * struct thread *a_td) */ static int -procfs_open(ap) - struct vop_open_args /* { - struct vnode *a_vp; - int a_mode; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; +procfs_open(struct vop_open_args *ap) { struct pfsnode *pfs = VTOPFS(ap->a_vp); struct proc *p1, *p2; @@ -174,15 +171,12 @@ procfs_open(ap) * * nothing to do for procfs other than undo * any exclusive open flag (see _open above). + * + * procfs_close(struct vnode *a_vp, int a_fflag, struct ucred *a_cred, + * struct thread *a_td) */ static int -procfs_close(ap) - struct vop_close_args /* { - struct vnode *a_vp; - int a_fflag; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; +procfs_close(struct vop_close_args *ap) { struct pfsnode *pfs = VTOPFS(ap->a_vp); struct proc *p; @@ -228,8 +222,7 @@ procfs_close(ap) * (vp) is not locked on entry or exit. */ static int -procfs_ioctl(ap) - struct vop_ioctl_args *ap; +procfs_ioctl(struct vop_ioctl_args *ap) { struct pfsnode *pfs = VTOPFS(ap->a_vp); struct proc *procp; @@ -324,18 +317,13 @@ procfs_ioctl(ap) * of this function. for sanity, this is the * usual no-op bmap, although returning * (EIO) would be a reasonable alternative. + * + * procfs_bmap(struct vnode *a_vp, daddr_t a_bn, struct vnode **a_vpp, + * daddr_t *a_bnp, int *a_runp) */ static int -procfs_bmap(ap) - struct vop_bmap_args /* { - struct vnode *a_vp; - daddr_t a_bn; - struct vnode **a_vpp; - daddr_t *a_bnp; - int *a_runp; - } */ *ap; +procfs_bmap(struct vop_bmap_args *ap) { - if (ap->a_vpp != NULL) *ap->a_vpp = ap->a_vp; if (ap->a_bnp != NULL) @@ -353,13 +341,11 @@ procfs_bmap(ap) * used. * * (vp) is locked on entry, but must be unlocked on exit. + * + * procfs_inactive(struct vnode *a_vp, struct thread *a_td) */ static int -procfs_inactive(ap) - struct vop_inactive_args /* { - struct vnode *a_vp; - struct thread *a_td; - } */ *ap; +procfs_inactive(struct vop_inactive_args *ap) { struct vnode *vp = ap->a_vp; @@ -374,14 +360,12 @@ procfs_inactive(ap) * free list. at this time the filesystem needs * to free any private data and remove the node * from any private lists. + * + * procfs_reclaim(struct vnode *a_vp) */ static int -procfs_reclaim(ap) - struct vop_reclaim_args /* { - struct vnode *a_vp; - } */ *ap; +procfs_reclaim(struct vop_reclaim_args *ap) { - return (procfs_freevp(ap->a_vp)); } @@ -389,12 +373,11 @@ procfs_reclaim(ap) * _print is used for debugging. * just print a readable description * of (vp). + * + * procfs_print(struct vnode *a_vp) */ static int -procfs_print(ap) - struct vop_print_args /* { - struct vnode *a_vp; - } */ *ap; +procfs_print(struct vop_print_args *ap) { struct pfsnode *pfs = VTOPFS(ap->a_vp); @@ -407,9 +390,8 @@ procfs_print(ap) * generic entry point for unsupported operations */ static int -procfs_badop() +procfs_badop(void) { - return (EIO); } @@ -421,15 +403,12 @@ procfs_badop() * to be computed, and nothing cares anyway. * * this is relatively minimal for procfs. + * + * procfs_getattr(struct vnode *a_vp, struct vattr *a_vap, + * struct ucred *a_cred, struct thread *a_td) */ static int -procfs_getattr(ap) - struct vop_getattr_args /* { - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; +procfs_getattr(struct vop_getattr_args *ap) { struct pfsnode *pfs = VTOPFS(ap->a_vp); struct vattr *vap = ap->a_vap; @@ -593,16 +572,13 @@ procfs_getattr(ap) return (error); } +/* + * procfs_setattr(struct vnode *a_vp, struct vattr *a_vap, + * struct ucred *a_cred, struct thread *a_td) + */ static int -procfs_setattr(ap) - struct vop_setattr_args /* { - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; +procfs_setattr(struct vop_setattr_args *ap) { - if (ap->a_vap->va_flags != VNOVAL) return (EOPNOTSUPP); @@ -630,15 +606,12 @@ procfs_setattr(ap) * objects. this doesn't cause any particular trouble * but does mean that the i/o entry points need to check * that the operation really does make sense. + * + * procfs_access(struct vnode *a_vp, int a_mode, struct ucred *a_cred, + * struct thread *a_td) */ static int -procfs_access(ap) - struct vop_access_args /* { - struct vnode *a_vp; - int a_mode; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; +procfs_access(struct vop_access_args *ap) { struct vattr *vap; struct vattr vattr; @@ -689,14 +662,12 @@ found: * unless you want to get a migraine, just make sure your * filesystem doesn't do any locking of its own. otherwise * read and inwardly digest ufs_lookup(). + * + * procfs_lookup(struct vnode *a_dvp, struct vnode **a_vpp, + * struct componentname *a_cnp) */ static int -procfs_lookup(ap) - struct vop_lookup_args /* { - struct vnode * a_dvp; - struct vnode ** a_vpp; - struct componentname * a_cnp; - } */ *ap; +procfs_lookup(struct vop_lookup_args *ap) { struct componentname *cnp = ap->a_cnp; struct vnode **vpp = ap->a_vpp; @@ -778,10 +749,8 @@ procfs_lookup(ap) * Does this process have a text file? */ int -procfs_validfile(p) - struct proc *p; +procfs_validfile(struct proc *p) { - return (procfs_findtextvp(p) != NULLVP); } @@ -790,17 +759,12 @@ procfs_validfile(p) * * We generate just one directory entry at a time, as it would probably * not pay off to buffer several entries locally to save uiomove calls. + * + * procfs_readdir(struct vnode *a_vp, struct uio *a_uio, struct ucred *a_cred, + * int *a_eofflag, int *a_ncookies, u_long **a_cookies) */ static int -procfs_readdir(ap) - struct vop_readdir_args /* { - struct vnode *a_vp; - struct uio *a_uio; - struct ucred *a_cred; - int *a_eofflag; - int *a_ncookies; - u_long **a_cookies; - } */ *ap; +procfs_readdir(struct vop_readdir_args *ap) { struct uio *uio = ap->a_uio; struct dirent d; @@ -960,8 +924,7 @@ procfs_readdir(ap) * readlink reads the link of `curproc' or `file' */ static int -procfs_readlink(ap) - struct vop_readlink_args *ap; +procfs_readlink(struct vop_readlink_args *ap) { char buf[16]; /* should be enough */ struct proc *procp; @@ -1006,9 +969,7 @@ procfs_readlink(ap) * convert decimal ascii to pid_t */ static pid_t -atopid(b, len) - const char *b; - u_int len; +atopid(const char *b, u_int len) { pid_t p = 0; -- 2.41.0