aboutsummaryrefslogtreecommitdiff
path: root/sys/fs
diff options
context:
space:
mode:
authorAlexander Langer <alex@FreeBSD.org>1998-07-25 15:52:44 +0000
committerAlexander Langer <alex@FreeBSD.org>1998-07-25 15:52:44 +0000
commitca2be56ff90c5f3d3514654d4e9c5eb3ab8c2fcf (patch)
treefcfb6171170c0e2a38db0e900bbf5a3511cc1c97 /sys/fs
parent38bfd69bdad738f96c71eff4e2fb5848f8412835 (diff)
downloadsrc-ca2be56ff90c5f3d3514654d4e9c5eb3ab8c2fcf.tar.gz
src-ca2be56ff90c5f3d3514654d4e9c5eb3ab8c2fcf.zip
Override the default VFS LKM dispatch functions so that a module
unload function can be provided (this is necessary to unregister the at_exit handler).
Notes
Notes: svn path=/head/; revision=37864
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/procfs/procfs_vfsops.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/sys/fs/procfs/procfs_vfsops.c b/sys/fs/procfs/procfs_vfsops.c
index 0827be178f9f..fdd7a89db96f 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.21 1998/05/06 05:29:36 msmith Exp $
+ * $Id: procfs_vfsops.c,v 1.22 1998/06/07 17:11:58 dfr Exp $
*/
/*
@@ -174,9 +174,7 @@ 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);
@@ -210,3 +208,20 @@ static struct vfsops procfs_vfsops = {
};
VFS_SET(procfs_vfsops, procfs, MOUNT_PROCFS, VFCF_SYNTHETIC);
+
+#ifdef VFS_LKM
+static int
+procfs_unload ()
+{
+ rm_at_exit(procfs_exit);
+ return(0);
+}
+
+int
+procfs_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(procfs, lkmtp, cmd, ver, lkm_nullcmd,
+ procfs_unload, lkm_nullcmd);
+}
+#endif
+