diff options
author | alex <alex@FreeBSD.org> | 1998-07-25 15:52:44 +0000 |
---|---|---|
committer | alex <alex@FreeBSD.org> | 1998-07-25 15:52:44 +0000 |
commit | 4ab63c85e2b7f510cf1f2fd15814a9d3266456f9 (patch) | |
tree | c3dd08a3bc457d651efdf9371a09ede217be0817 | |
parent | 4c90ac575dd4d3a2758951098f5c2774ddd5b3ee (diff) | |
download | FreeBSD-src-4ab63c85e2b7f510cf1f2fd15814a9d3266456f9.zip FreeBSD-src-4ab63c85e2b7f510cf1f2fd15814a9d3266456f9.tar.gz |
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).
-rw-r--r-- | lkm/procfs/Makefile | 4 | ||||
-rw-r--r-- | sys/fs/procfs/procfs_vfsops.c | 23 | ||||
-rw-r--r-- | sys/miscfs/procfs/procfs_vfsops.c | 23 | ||||
-rw-r--r-- | sys/modules/procfs/Makefile | 4 |
4 files changed, 42 insertions, 12 deletions
diff --git a/lkm/procfs/Makefile b/lkm/procfs/Makefile index d0a8b0a..5eca69b 100644 --- a/lkm/procfs/Makefile +++ b/lkm/procfs/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.9 1998/06/30 16:09:28 sos Exp $ +# $Id: Makefile,v 1.10 1998/07/01 17:02:57 bde Exp $ .PATH: ${.CURDIR}/../../sys/miscfs/procfs KMOD= procfs_mod @@ -6,7 +6,7 @@ SRCS= opt_vmpage.h procfs_ctl.c procfs_map.c procfs_note.c procfs_status.c \ procfs_subr.c procfs_type.c procfs_vfsops.c procfs_vnops.c NOMAN= VFS_LKM= -CFLAGS+= -DPROCFS +CFLAGS+= -DPROCFS -DVFS_LKM_NO_DEFAULT_DISPATCH CLEANFILES+= opt_vmpage.h opt_vmpage.h: diff --git a/sys/fs/procfs/procfs_vfsops.c b/sys/fs/procfs/procfs_vfsops.c index 0827be1..fdd7a89 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 + diff --git a/sys/miscfs/procfs/procfs_vfsops.c b/sys/miscfs/procfs/procfs_vfsops.c index 0827be1..fdd7a89 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.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 + diff --git a/sys/modules/procfs/Makefile b/sys/modules/procfs/Makefile index d0a8b0a..5eca69b 100644 --- a/sys/modules/procfs/Makefile +++ b/sys/modules/procfs/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.9 1998/06/30 16:09:28 sos Exp $ +# $Id: Makefile,v 1.10 1998/07/01 17:02:57 bde Exp $ .PATH: ${.CURDIR}/../../sys/miscfs/procfs KMOD= procfs_mod @@ -6,7 +6,7 @@ SRCS= opt_vmpage.h procfs_ctl.c procfs_map.c procfs_note.c procfs_status.c \ procfs_subr.c procfs_type.c procfs_vfsops.c procfs_vnops.c NOMAN= VFS_LKM= -CFLAGS+= -DPROCFS +CFLAGS+= -DPROCFS -DVFS_LKM_NO_DEFAULT_DISPATCH CLEANFILES+= opt_vmpage.h opt_vmpage.h: |