diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2001-05-24 07:32:44 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2001-05-24 07:32:44 +0000 |
commit | b3a744a8fcb8175169ccd8c4402d6279ae56a421 (patch) | |
tree | 2aa845782f5ed9b7728247e3692ddd9e457d06bc | |
parent | ef201cb599115f67244e44ab280e450a915901c3 (diff) |
Garbage collect procfs_findtextvp().
-rw-r--r-- | sys/miscfs/procfs/procfs.h | 3 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_mem.c | 87 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_vnops.c | 6 |
3 files changed, 5 insertions, 91 deletions
diff --git a/sys/miscfs/procfs/procfs.h b/sys/miscfs/procfs/procfs.h index f59c0d9f6ec..26d9b7b2154 100644 --- a/sys/miscfs/procfs/procfs.h +++ b/sys/miscfs/procfs/procfs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs.h,v 1.11 2001/04/09 07:14:21 tholo Exp $ */ +/* $OpenBSD: procfs.h,v 1.12 2001/05/24 07:32:42 aaron Exp $ */ /* $NetBSD: procfs.h,v 1.17 1996/02/12 15:01:41 christos Exp $ */ /* @@ -136,7 +136,6 @@ int procfs_docmdline __P((struct proc *, struct proc *, struct pfsnode *pfsp, st int procfs_domeminfo __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); int procfs_docpuinfo __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); int procfs_domap __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio, int)); -struct vnode *procfs_findtextvp __P((struct proc *)); int procfs_freevp __P((struct vnode *)); int procfs_getcpuinfstr __P((char *, int *)); diff --git a/sys/miscfs/procfs/procfs_mem.c b/sys/miscfs/procfs/procfs_mem.c index baad123deb7..d5e33efc52e 100644 --- a/sys/miscfs/procfs/procfs_mem.c +++ b/sys/miscfs/procfs/procfs_mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_mem.c,v 1.10 2000/08/15 02:44:12 ericj Exp $ */ +/* $OpenBSD: procfs_mem.c,v 1.11 2001/05/24 07:32:43 aaron Exp $ */ /* $NetBSD: procfs_mem.c,v 1.8 1996/02/09 22:40:50 christos Exp $ */ /* @@ -247,25 +247,6 @@ procfs_domem(curp, p, pfs, uio) } /* - * Given process (p), find the vnode from which - * it's text segment is being executed. - * - * It would be nice to grab this information from - * the VM system, however, there is no sure-fire - * way of doing that. Instead, fork(), exec() and - * wait() all maintain the p_textvp field in the - * process proc structure which contains a held - * reference to the exec'ed vnode. - */ -struct vnode * -procfs_findtextvp(p) - struct proc *p; -{ - - return (p->p_textvp); -} - -/* * Ensure that a process has permission to perform I/O on another. * Arguments: * p The process wishing to do the I/O (the tracer). @@ -299,69 +280,3 @@ procfs_checkioperm(p, t) return (0); } -#ifdef probably_never -/* - * Given process (p), find the vnode from which - * it's text segment is being mapped. - * - * (This is here, rather than in procfs_subr in order - * to keep all the VM related code in one place.) - */ -struct vnode * -procfs_findtextvp(p) - struct proc *p; -{ - int error; - vm_object_t object; - vm_offset_t pageno; /* page number */ - - /* find a vnode pager for the user address space */ - - for (pageno = VM_MIN_ADDRESS; - pageno < VM_MAXUSER_ADDRESS; - pageno += PAGE_SIZE) { - vm_map_t map; - vm_map_entry_t out_entry; - vm_prot_t out_prot; - boolean_t wired, single_use; - vm_offset_t off; - - map = &p->p_vmspace->vm_map; - error = vm_map_lookup(&map, pageno, - VM_PROT_READ, - &out_entry, &object, &off, &out_prot, - &wired, &single_use); - - if (!error) { - vm_pager_t pager; - - printf("procfs: found vm object\n"); - vm_map_lookup_done(map, out_entry); - printf("procfs: vm object = %p\n", object); - - /* - * At this point, assuming no errors, object - * is the VM object mapping UVA (pageno). - * Ensure it has a vnode pager, then grab - * the vnode from that pager's handle. - */ - - pager = object->pager; - printf("procfs: pager = %p\n", pager); - if (pager) - printf("procfs: found pager, type = %d\n", - pager->pg_type); - if (pager && pager->pg_type == PG_VNODE) { - struct vnode *vp; - - vp = (struct vnode *) pager->pg_handle; - printf("procfs: vp = %p\n", vp); - return (vp); - } - } - } - - printf("procfs: text object not found\n"); - return (0); -} -#endif /* probably_never */ diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c index 2660d236fbc..5fbf6096f28 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.17 2001/05/24 04:09:39 art Exp $ */ +/* $OpenBSD: procfs_vnops.c,v 1.18 2001/05/24 07:32:43 aaron Exp $ */ /* $NetBSD: procfs_vnops.c,v 1.40 1996/03/16 23:52:55 christos Exp $ */ /* @@ -841,7 +841,7 @@ procfs_lookup(v) found: if (pt->pt_pfstype == Pfile) { - fvp = procfs_findtextvp(p); + fvp = p->p_textvp; /* We already checked that it exists. */ VREF(fvp); vn_lock(fvp, LK_EXCLUSIVE | LK_RETRY, curp); @@ -865,7 +865,7 @@ procfs_validfile(p, mp) struct mount *mp; { - return (procfs_findtextvp(p) != NULLVP); + return (p->p_textvp != NULLVP); } int |