[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20170330194215.26379-1-fabf@skynet.be>
Date: Thu, 30 Mar 2017 21:42:15 +0200
From: Fabian Frederick <fabf@...net.be>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Jan Kara <jack@...e.com>, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, fabf@...net.be
Subject: [PATCH 1/1 linux-next] fs/affs: free affs_sb_info in put_super()
kill_block_super() calls generic_shutdown_super() calling FS
put_user() where we generally free superblock specific information.
This removes unneeded affs_kill_sb()
sbi is automatically reserved in fill_super() so there is no
need to test it.
Signed-off-by: Fabian Frederick <fabf@...net.be>
---
fs/affs/super.c | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
diff --git a/fs/affs/super.c b/fs/affs/super.c
index c2c27a8..f273203 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -46,9 +46,14 @@ static void
affs_put_super(struct super_block *sb)
{
struct affs_sb_info *sbi = AFFS_SB(sb);
- pr_debug("%s()\n", __func__);
+ pr_debug("%s()\n", __func__);
cancel_delayed_work_sync(&sbi->sb_work);
+ affs_free_bitmap(sb);
+ affs_brelse(sbi->s_root_bh);
+ kfree(sbi->s_prefix);
+ mutex_destroy(&sbi->s_bmlock);
+ kfree(sbi);
}
static int
@@ -604,24 +609,11 @@ static struct dentry *affs_mount(struct file_system_type *fs_type,
return mount_bdev(fs_type, flags, dev_name, data, affs_fill_super);
}
-static void affs_kill_sb(struct super_block *sb)
-{
- struct affs_sb_info *sbi = AFFS_SB(sb);
- kill_block_super(sb);
- if (sbi) {
- affs_free_bitmap(sb);
- affs_brelse(sbi->s_root_bh);
- kfree(sbi->s_prefix);
- mutex_destroy(&sbi->s_bmlock);
- kfree(sbi);
- }
-}
-
static struct file_system_type affs_fs_type = {
.owner = THIS_MODULE,
.name = "affs",
.mount = affs_mount,
- .kill_sb = affs_kill_sb,
+ .kill_sb = kill_block_super,
.fs_flags = FS_REQUIRES_DEV,
};
MODULE_ALIAS_FS("affs");
--
2.9.3
Powered by blists - more mailing lists