summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2002-07-01 11:00:47 +0000
committeriedowse <iedowse@FreeBSD.org>2002-07-01 11:00:47 +0000
commit603a2708879d64fbc0c4e66269000f4525895f2e (patch)
tree2098674faebe22dd269ccf65053fd9c36532da98 /sys
parent3c634774fa3477cb19a2706307e02bd1747ad49c (diff)
downloadFreeBSD-src-603a2708879d64fbc0c4e66269000f4525895f2e.zip
FreeBSD-src-603a2708879d64fbc0c4e66269000f4525895f2e.tar.gz
Add the ffs bits necessary to support unloading of the ufs kernel
module. This adds an ffs_uninit() function that calls ufs_uninit() and also calls a new softdep_uninitialize() function. Add a stub for softdep_uninitialize() to cover the non-SOFTUPDATES case. Reviewed by: mckusick
Diffstat (limited to 'sys')
-rw-r--r--sys/ufs/ffs/ffs_extern.h1
-rw-r--r--sys/ufs/ffs/ffs_softdep.c13
-rw-r--r--sys/ufs/ffs/ffs_softdep_stub.c7
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c19
4 files changed, 38 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h
index 8274765..ae59ca3 100644
--- a/sys/ufs/ffs/ffs_extern.h
+++ b/sys/ufs/ffs/ffs_extern.h
@@ -106,6 +106,7 @@ extern vop_t **ffs_fifoop_p;
* Soft update function prototypes.
*/
void softdep_initialize(void);
+void softdep_uninitialize(void);
int softdep_mount(struct vnode *, struct mount *, struct fs *,
struct ucred *);
int softdep_flushworklist(struct mount *, int *, struct thread *);
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 0fc1848..4921344 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -1132,6 +1132,19 @@ softdep_initialize()
}
/*
+ * Executed after all filesystems have been unmounted during
+ * filesystem module unload.
+ */
+void
+softdep_uninitialize()
+{
+
+ hashdestroy(pagedep_hashtbl, M_PAGEDEP, pagedep_hash);
+ hashdestroy(inodedep_hashtbl, M_INODEDEP, inodedep_hash);
+ hashdestroy(newblk_hashtbl, M_NEWBLK, newblk_hash);
+}
+
+/*
* Called at mount time to notify the dependency code that a
* filesystem wishes to use it.
*/
diff --git a/sys/ufs/ffs/ffs_softdep_stub.c b/sys/ufs/ffs/ffs_softdep_stub.c
index 47feaec..df084c7 100644
--- a/sys/ufs/ffs/ffs_softdep_stub.c
+++ b/sys/ufs/ffs/ffs_softdep_stub.c
@@ -83,6 +83,13 @@ softdep_initialize()
}
void
+softdep_uninitialize()
+{
+
+ return;
+}
+
+void
softdep_setup_inomapdep(bp, ip, newinum)
struct buf *bp;
struct inode *ip;
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 61cec1f..fa0bffa 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -73,6 +73,7 @@ static void ffs_oldfscompat_read(struct fs *, struct ufsmount *,
ufs2_daddr_t);
static void ffs_oldfscompat_write(struct fs *, struct ufsmount *);
static int ffs_init(struct vfsconf *);
+static int ffs_uninit(struct vfsconf *);
static struct vfsops ufs_vfsops = {
ffs_mount,
@@ -87,7 +88,7 @@ static struct vfsops ufs_vfsops = {
vfs_stdcheckexp,
ffs_vptofh,
ffs_init,
- vfs_stduninit,
+ ffs_uninit,
#ifdef UFS_EXTATTR
ufs_extattrctl,
#else
@@ -1375,7 +1376,7 @@ ffs_vptofh(vp, fhp)
}
/*
- * Initialize the filesystem; just use ufs_init.
+ * Initialize the filesystem.
*/
static int
ffs_init(vfsp)
@@ -1387,6 +1388,20 @@ ffs_init(vfsp)
}
/*
+ * Undo the work of ffs_init().
+ */
+static int
+ffs_uninit(vfsp)
+ struct vfsconf *vfsp;
+{
+ int ret;
+
+ ret = ufs_uninit(vfsp);
+ softdep_uninitialize();
+ return (ret);
+}
+
+/*
* Write a superblock and associated information back to disk.
*/
static int
OpenPOWER on IntegriCloud