aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/ext4.h1
-rw-r--r--fs/ext4/mballoc.c6
-rw-r--r--fs/ext4/resize.c6
-rw-r--r--fs/ext4/super.c19
4 files changed, 11 insertions, 21 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index c55a1faaed58..21a3b38395ff 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2192,7 +2192,6 @@ extern int ext4_calculate_overhead(struct super_block *sb);
2192extern void ext4_superblock_csum_set(struct super_block *sb); 2192extern void ext4_superblock_csum_set(struct super_block *sb);
2193extern void *ext4_kvmalloc(size_t size, gfp_t flags); 2193extern void *ext4_kvmalloc(size_t size, gfp_t flags);
2194extern void *ext4_kvzalloc(size_t size, gfp_t flags); 2194extern void *ext4_kvzalloc(size_t size, gfp_t flags);
2195extern void ext4_kvfree(void *ptr);
2196extern int ext4_alloc_flex_bg_array(struct super_block *sb, 2195extern int ext4_alloc_flex_bg_array(struct super_block *sb,
2197 ext4_group_t ngroup); 2196 ext4_group_t ngroup);
2198extern const char *ext4_decode_error(struct super_block *sb, int errno, 2197extern const char *ext4_decode_error(struct super_block *sb, int errno,
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index dbfe15c2533c..004d0ff8325f 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2358,7 +2358,7 @@ int ext4_mb_alloc_groupinfo(struct super_block *sb, ext4_group_t ngroups)
2358 if (sbi->s_group_info) { 2358 if (sbi->s_group_info) {
2359 memcpy(new_groupinfo, sbi->s_group_info, 2359 memcpy(new_groupinfo, sbi->s_group_info,
2360 sbi->s_group_info_size * sizeof(*sbi->s_group_info)); 2360 sbi->s_group_info_size * sizeof(*sbi->s_group_info));
2361 ext4_kvfree(sbi->s_group_info); 2361 kvfree(sbi->s_group_info);
2362 } 2362 }
2363 sbi->s_group_info = new_groupinfo; 2363 sbi->s_group_info = new_groupinfo;
2364 sbi->s_group_info_size = size / sizeof(*sbi->s_group_info); 2364 sbi->s_group_info_size = size / sizeof(*sbi->s_group_info);
@@ -2495,7 +2495,7 @@ err_freebuddy:
2495 kfree(sbi->s_group_info[i]); 2495 kfree(sbi->s_group_info[i]);
2496 iput(sbi->s_buddy_cache); 2496 iput(sbi->s_buddy_cache);
2497err_freesgi: 2497err_freesgi:
2498 ext4_kvfree(sbi->s_group_info); 2498 kvfree(sbi->s_group_info);
2499 return -ENOMEM; 2499 return -ENOMEM;
2500} 2500}
2501 2501
@@ -2708,7 +2708,7 @@ int ext4_mb_release(struct super_block *sb)
2708 EXT4_DESC_PER_BLOCK_BITS(sb); 2708 EXT4_DESC_PER_BLOCK_BITS(sb);
2709 for (i = 0; i < num_meta_group_infos; i++) 2709 for (i = 0; i < num_meta_group_infos; i++)
2710 kfree(sbi->s_group_info[i]); 2710 kfree(sbi->s_group_info[i]);
2711 ext4_kvfree(sbi->s_group_info); 2711 kvfree(sbi->s_group_info);
2712 } 2712 }
2713 kfree(sbi->s_mb_offsets); 2713 kfree(sbi->s_mb_offsets);
2714 kfree(sbi->s_mb_maxs); 2714 kfree(sbi->s_mb_maxs);
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index ca4588388fc3..bf76f405a5f9 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -856,7 +856,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
856 n_group_desc[gdb_num] = gdb_bh; 856 n_group_desc[gdb_num] = gdb_bh;
857 EXT4_SB(sb)->s_group_desc = n_group_desc; 857 EXT4_SB(sb)->s_group_desc = n_group_desc;
858 EXT4_SB(sb)->s_gdb_count++; 858 EXT4_SB(sb)->s_gdb_count++;
859 ext4_kvfree(o_group_desc); 859 kvfree(o_group_desc);
860 860
861 le16_add_cpu(&es->s_reserved_gdt_blocks, -1); 861 le16_add_cpu(&es->s_reserved_gdt_blocks, -1);
862 err = ext4_handle_dirty_super(handle, sb); 862 err = ext4_handle_dirty_super(handle, sb);
@@ -866,7 +866,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
866 return err; 866 return err;
867 867
868exit_inode: 868exit_inode:
869 ext4_kvfree(n_group_desc); 869 kvfree(n_group_desc);
870 brelse(iloc.bh); 870 brelse(iloc.bh);
871exit_dind: 871exit_dind:
872 brelse(dind); 872 brelse(dind);
@@ -909,7 +909,7 @@ static int add_new_gdb_meta_bg(struct super_block *sb,
909 n_group_desc[gdb_num] = gdb_bh; 909 n_group_desc[gdb_num] = gdb_bh;
910 EXT4_SB(sb)->s_group_desc = n_group_desc; 910 EXT4_SB(sb)->s_group_desc = n_group_desc;
911 EXT4_SB(sb)->s_gdb_count++; 911 EXT4_SB(sb)->s_gdb_count++;
912 ext4_kvfree(o_group_desc); 912 kvfree(o_group_desc);
913 BUFFER_TRACE(gdb_bh, "get_write_access"); 913 BUFFER_TRACE(gdb_bh, "get_write_access");
914 err = ext4_journal_get_write_access(handle, gdb_bh); 914 err = ext4_journal_get_write_access(handle, gdb_bh);
915 if (unlikely(err)) 915 if (unlikely(err))
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 2c9e6864abd9..4b79f39ebf66 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -176,15 +176,6 @@ void *ext4_kvzalloc(size_t size, gfp_t flags)
176 return ret; 176 return ret;
177} 177}
178 178
179void ext4_kvfree(void *ptr)
180{
181 if (is_vmalloc_addr(ptr))
182 vfree(ptr);
183 else
184 kfree(ptr);
185
186}
187
188ext4_fsblk_t ext4_block_bitmap(struct super_block *sb, 179ext4_fsblk_t ext4_block_bitmap(struct super_block *sb,
189 struct ext4_group_desc *bg) 180 struct ext4_group_desc *bg)
190{ 181{
@@ -811,8 +802,8 @@ static void ext4_put_super(struct super_block *sb)
811 802
812 for (i = 0; i < sbi->s_gdb_count; i++) 803 for (i = 0; i < sbi->s_gdb_count; i++)
813 brelse(sbi->s_group_desc[i]); 804 brelse(sbi->s_group_desc[i]);
814 ext4_kvfree(sbi->s_group_desc); 805 kvfree(sbi->s_group_desc);
815 ext4_kvfree(sbi->s_flex_groups); 806 kvfree(sbi->s_flex_groups);
816 percpu_counter_destroy(&sbi->s_freeclusters_counter); 807 percpu_counter_destroy(&sbi->s_freeclusters_counter);
817 percpu_counter_destroy(&sbi->s_freeinodes_counter); 808 percpu_counter_destroy(&sbi->s_freeinodes_counter);
818 percpu_counter_destroy(&sbi->s_dirs_counter); 809 percpu_counter_destroy(&sbi->s_dirs_counter);
@@ -1939,7 +1930,7 @@ int ext4_alloc_flex_bg_array(struct super_block *sb, ext4_group_t ngroup)
1939 memcpy(new_groups, sbi->s_flex_groups, 1930 memcpy(new_groups, sbi->s_flex_groups,
1940 (sbi->s_flex_groups_allocated * 1931 (sbi->s_flex_groups_allocated *
1941 sizeof(struct flex_groups))); 1932 sizeof(struct flex_groups)));
1942 ext4_kvfree(sbi->s_flex_groups); 1933 kvfree(sbi->s_flex_groups);
1943 } 1934 }
1944 sbi->s_flex_groups = new_groups; 1935 sbi->s_flex_groups = new_groups;
1945 sbi->s_flex_groups_allocated = size / sizeof(struct flex_groups); 1936 sbi->s_flex_groups_allocated = size / sizeof(struct flex_groups);
@@ -4224,7 +4215,7 @@ failed_mount7:
4224failed_mount6: 4215failed_mount6:
4225 ext4_mb_release(sb); 4216 ext4_mb_release(sb);
4226 if (sbi->s_flex_groups) 4217 if (sbi->s_flex_groups)
4227 ext4_kvfree(sbi->s_flex_groups); 4218 kvfree(sbi->s_flex_groups);
4228 percpu_counter_destroy(&sbi->s_freeclusters_counter); 4219 percpu_counter_destroy(&sbi->s_freeclusters_counter);
4229 percpu_counter_destroy(&sbi->s_freeinodes_counter); 4220 percpu_counter_destroy(&sbi->s_freeinodes_counter);
4230 percpu_counter_destroy(&sbi->s_dirs_counter); 4221 percpu_counter_destroy(&sbi->s_dirs_counter);
@@ -4253,7 +4244,7 @@ failed_mount3:
4253failed_mount2: 4244failed_mount2:
4254 for (i = 0; i < db_count; i++) 4245 for (i = 0; i < db_count; i++)
4255 brelse(sbi->s_group_desc[i]); 4246 brelse(sbi->s_group_desc[i]);
4256 ext4_kvfree(sbi->s_group_desc); 4247 kvfree(sbi->s_group_desc);
4257failed_mount: 4248failed_mount:
4258 if (sbi->s_chksum_driver) 4249 if (sbi->s_chksum_driver)
4259 crypto_free_shash(sbi->s_chksum_driver); 4250 crypto_free_shash(sbi->s_chksum_driver);