summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/fs/procfs/procfs_subr.c5
-rw-r--r--sys/fs/procfs/procfs_vfsops.c11
-rw-r--r--sys/kern/kern_exit.c13
-rw-r--r--sys/miscfs/procfs/procfs_subr.c5
-rw-r--r--sys/miscfs/procfs/procfs_vfsops.c11
5 files changed, 27 insertions, 18 deletions
diff --git a/sys/fs/procfs/procfs_subr.c b/sys/fs/procfs/procfs_subr.c
index b77489b..12dcf76 100644
--- a/sys/fs/procfs/procfs_subr.c
+++ b/sys/fs/procfs/procfs_subr.c
@@ -36,7 +36,7 @@
*
* @(#)procfs_subr.c 8.6 (Berkeley) 5/14/95
*
- * $Id: procfs_subr.c,v 1.17 1997/08/02 14:32:18 bde Exp $
+ * $Id: procfs_subr.c,v 1.18 1997/12/06 04:11:12 sef Exp $
*/
#include <sys/param.h>
@@ -353,9 +353,10 @@ vfs_findname(nm, buf, buflen)
}
void
-procfs_exit(pid_t pid)
+procfs_exit(struct proc *p)
{
struct pfsnode *pfs;
+ pid_t pid = p->p_pid;
for (pfs = pfshead; pfs ; pfs = pfs->pfs_next) {
if (pfs->pfs_pid == pid)
diff --git a/sys/fs/procfs/procfs_vfsops.c b/sys/fs/procfs/procfs_vfsops.c
index 3afd9e9..5983a56 100644
--- a/sys/fs/procfs/procfs_vfsops.c
+++ b/sys/fs/procfs/procfs_vfsops.c
@@ -36,7 +36,7 @@
*
* @(#)procfs_vfsops.c 8.7 (Berkeley) 5/10/95
*
- * $Id: procfs_vfsops.c,v 1.16 1997/08/02 14:32:19 bde Exp $
+ * $Id: procfs_vfsops.c,v 1.17 1997/08/16 19:15:19 wollman Exp $
*/
/*
@@ -61,6 +61,8 @@ static int procfs_statfs __P((struct mount *mp, struct statfs *sbp,
static int procfs_unmount __P((struct mount *mp, int mntflags,
struct proc *p));
+extern void procfs_exit __P((struct proc *));
+
/*
* VFS Operations.
*
@@ -96,6 +98,7 @@ procfs_mount(mp, path, data, ndp, p)
bcopy("procfs", mp->mnt_stat.f_mntfromname, size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
(void)procfs_statfs(mp, &mp->mnt_stat, p);
+
return (0);
}
@@ -172,6 +175,12 @@ static int
procfs_init(vfsp)
struct vfsconf *vfsp;
{
+ int error;
+ /*
+ * XXX - this should be rm_at_exit'd in an LKM unload function,
+ */
+ if (error = at_exit(procfs_exit))
+ printf("procfs: cannot register procfs_exit with at_exit -- error %d\n", error);
return (0);
}
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 88c78a1..a68949b 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_exit.c 8.7 (Berkeley) 2/12/94
- * $Id: kern_exit.c,v 1.61 1997/12/06 04:11:10 sef Exp $
+ * $Id: kern_exit.c,v 1.62 1997/12/07 18:16:43 sef Exp $
*/
#include "opt_ktrace.h"
@@ -114,9 +114,6 @@ exit1(p, rv)
register struct proc *q, *nq;
register struct vmspace *vm;
ele_p ep = exit_list;
-#ifdef PROCFS
- extern void procfs_exit(pid_t);
-#endif
if (p->p_pid == 1) {
printf("init died (signal %d, exit %d)\n",
@@ -161,14 +158,6 @@ exit1(p, rv)
#endif
STOPEVENT(p, S_EXIT, rv);
-#ifdef PROCFS
- /*
- * Now that we're back from stopevent(), force a close
- * of all open procfs files for this process.
- */
- procfs_exit(p->p_pid);
-#endif
-
/*
* Check if any LKMs need anything done at process exit.
* e.g. SYSV IPC stuff
diff --git a/sys/miscfs/procfs/procfs_subr.c b/sys/miscfs/procfs/procfs_subr.c
index b77489b..12dcf76 100644
--- a/sys/miscfs/procfs/procfs_subr.c
+++ b/sys/miscfs/procfs/procfs_subr.c
@@ -36,7 +36,7 @@
*
* @(#)procfs_subr.c 8.6 (Berkeley) 5/14/95
*
- * $Id: procfs_subr.c,v 1.17 1997/08/02 14:32:18 bde Exp $
+ * $Id: procfs_subr.c,v 1.18 1997/12/06 04:11:12 sef Exp $
*/
#include <sys/param.h>
@@ -353,9 +353,10 @@ vfs_findname(nm, buf, buflen)
}
void
-procfs_exit(pid_t pid)
+procfs_exit(struct proc *p)
{
struct pfsnode *pfs;
+ pid_t pid = p->p_pid;
for (pfs = pfshead; pfs ; pfs = pfs->pfs_next) {
if (pfs->pfs_pid == pid)
diff --git a/sys/miscfs/procfs/procfs_vfsops.c b/sys/miscfs/procfs/procfs_vfsops.c
index 3afd9e9..5983a56 100644
--- a/sys/miscfs/procfs/procfs_vfsops.c
+++ b/sys/miscfs/procfs/procfs_vfsops.c
@@ -36,7 +36,7 @@
*
* @(#)procfs_vfsops.c 8.7 (Berkeley) 5/10/95
*
- * $Id: procfs_vfsops.c,v 1.16 1997/08/02 14:32:19 bde Exp $
+ * $Id: procfs_vfsops.c,v 1.17 1997/08/16 19:15:19 wollman Exp $
*/
/*
@@ -61,6 +61,8 @@ static int procfs_statfs __P((struct mount *mp, struct statfs *sbp,
static int procfs_unmount __P((struct mount *mp, int mntflags,
struct proc *p));
+extern void procfs_exit __P((struct proc *));
+
/*
* VFS Operations.
*
@@ -96,6 +98,7 @@ procfs_mount(mp, path, data, ndp, p)
bcopy("procfs", mp->mnt_stat.f_mntfromname, size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
(void)procfs_statfs(mp, &mp->mnt_stat, p);
+
return (0);
}
@@ -172,6 +175,12 @@ static int
procfs_init(vfsp)
struct vfsconf *vfsp;
{
+ int error;
+ /*
+ * XXX - this should be rm_at_exit'd in an LKM unload function,
+ */
+ if (error = at_exit(procfs_exit))
+ printf("procfs: cannot register procfs_exit with at_exit -- error %d\n", error);
return (0);
}
OpenPOWER on IntegriCloud