HFS wants 8Kb per-superblock allocation; just use kmalloc()
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 2 Jan 2016 19:29:23 +0000 (14:29 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 4 Jan 2016 15:29:34 +0000 (10:29 -0500)
... rather than play with __get_free_pages() (and figuring out the
allocation order, etc.)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/hfs/mdb.c

index aa3f0d6..a3ec3ae 100644 (file)
@@ -166,7 +166,7 @@ int hfs_mdb_get(struct super_block *sb)
                pr_warn("continuing without an alternate MDB\n");
        }
 
-       HFS_SB(sb)->bitmap = (__be32 *)__get_free_pages(GFP_KERNEL, PAGE_SIZE < 8192 ? 1 : 0);
+       HFS_SB(sb)->bitmap = kmalloc(8192, GFP_KERNEL);
        if (!HFS_SB(sb)->bitmap)
                goto out;
 
@@ -360,7 +360,7 @@ void hfs_mdb_put(struct super_block *sb)
        unload_nls(HFS_SB(sb)->nls_io);
        unload_nls(HFS_SB(sb)->nls_disk);
 
-       free_pages((unsigned long)HFS_SB(sb)->bitmap, PAGE_SIZE < 8192 ? 1 : 0);
+       kfree(HFS_SB(sb)->bitmap);
        kfree(HFS_SB(sb));
        sb->s_fs_info = NULL;
 }