diff options
author | sef <sef@FreeBSD.org> | 1997-12-08 01:06:36 +0000 |
---|---|---|
committer | sef <sef@FreeBSD.org> | 1997-12-08 01:06:36 +0000 |
commit | 287c0e3604b769c59f576c3964642715079a76f4 (patch) | |
tree | 409e9c1a735c2dd89128df90141f54a93b1e8b3e /sys/miscfs | |
parent | 2484645f8d9962470a0283fa60ae8e3162098cc2 (diff) | |
download | FreeBSD-src-287c0e3604b769c59f576c3964642715079a76f4.zip FreeBSD-src-287c0e3604b769c59f576c3964642715079a76f4.tar.gz |
Use at_exit() to invoke procfs_exit() instead of calling it directly.
Note that an unload facility should be used to call rm_at_exit() (if
procfs is being loaded as an LKM and is subsequently removed), but it
was non-obvious how to do this in the VFS framework.
Reviewed by: Julian Elischer
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/procfs/procfs_subr.c | 5 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_vfsops.c | 11 |
2 files changed, 13 insertions, 3 deletions
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); } |