@@ -165,15 +165,3 @@ int get_tree_mtd(struct fs_context *fc,
return -EINVAL;
}
EXPORT_SYMBOL_GPL(get_tree_mtd);
-
-/*
- * destroy an MTD-based superblock
- */
-void kill_mtd_super(struct super_block *sb)
-{
- generic_shutdown_super(sb);
- put_mtd_device(sb->s_mtd);
- sb->s_mtd = NULL;
-}
-
-EXPORT_SYMBOL_GPL(kill_mtd_super);
@@ -340,21 +340,27 @@ static void jffs2_put_super (struct super_block *sb)
jffs2_dbg(1, "%s(): returning\n", __func__);
}
-static void jffs2_kill_sb(struct super_block *sb)
+static void jffs2_shutdown_sb(struct super_block *sb)
{
struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
+
if (c && !sb_rdonly(sb))
jffs2_stop_garbage_collect_thread(c);
- kill_mtd_super(sb);
- kfree(c);
+}
+
+static void jffs2_free_sb(struct super_block *sb)
+{
+ put_mtd_device(sb->s_mtd);
+ kfree(JFFS2_SB_INFO(sb));
}
static struct file_system_type jffs2_fs_type = {
- .owner = THIS_MODULE,
- .name = "jffs2",
- .init_fs_context = jffs2_init_fs_context,
- .parameters = jffs2_fs_parameters,
- .kill_sb = jffs2_kill_sb,
+ .owner = THIS_MODULE,
+ .name = "jffs2",
+ .init_fs_context = jffs2_init_fs_context,
+ .parameters = jffs2_fs_parameters,
+ .shutdown_sb = jffs2_shutdown_sb,
+ .free_sb = jffs2_free_sb,
};
MODULE_ALIAS_FS("jffs2");
@@ -17,8 +17,6 @@
extern int get_tree_mtd(struct fs_context *fc,
int (*fill_super)(struct super_block *sb,
struct fs_context *fc));
-extern void kill_mtd_super(struct super_block *sb);
-
#endif /* __KERNEL__ */
Convert jffs2 from ->kill_sb to ->shutdown_sb and ->free_sb. Drop the otherwise unused kill_mtd_super helpers, as there is no benefit in it over just calling put_mtd_device on sb->s_mtd. Signed-off-by: Christoph Hellwig <hch@lst.de> --- drivers/mtd/mtdsuper.c | 12 ------------ fs/jffs2/super.c | 22 ++++++++++++++-------- include/linux/mtd/super.h | 2 -- 3 files changed, 14 insertions(+), 22 deletions(-)