summaryrefslogtreecommitdiff
path: root/fs/adfs/super.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-12-09 11:08:44 +0000
committerAl Viro <viro@zeniv.linux.org.uk>2020-01-20 20:12:40 -0500
commit7b1952676256d2cdc03d0415a4c0e6bfb64e00ff (patch)
tree1525b175967b2907484ea4ebbe2693bcb3c06694 /fs/adfs/super.c
parent6092b6be304494e311b65935f5e09b510cbd57cc (diff)
fs/adfs: map: factor out map cleanup
We have several places which deal with releasing the map buffers and freeing the map array. Provide a helper for this. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/adfs/super.c')
-rw-r--r--fs/adfs/super.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/adfs/super.c b/fs/adfs/super.c
index 458824e0ca83..cef16028e9f2 100644
--- a/fs/adfs/super.c
+++ b/fs/adfs/super.c
@@ -90,12 +90,9 @@ static int adfs_checkdiscrecord(struct adfs_discrecord *dr)
static void adfs_put_super(struct super_block *sb)
{
- int i;
struct adfs_sb_info *asb = ADFS_SB(sb);
- for (i = 0; i < asb->s_map_size; i++)
- brelse(asb->s_map[i].dm_bh);
- kfree(asb->s_map);
+ adfs_free_map(sb);
kfree_rcu(asb, rcu);
}
@@ -412,10 +409,7 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent)
root = adfs_iget(sb, &root_obj);
sb->s_root = d_make_root(root);
if (!sb->s_root) {
- int i;
- for (i = 0; i < asb->s_map_size; i++)
- brelse(asb->s_map[i].dm_bh);
- kfree(asb->s_map);
+ adfs_free_map(sb);
adfs_error(sb, "get root inode failed\n");
ret = -EIO;
goto error;