@@ -534,9 +534,6 @@ static int __mb_check_buddy(struct ext4_buddy *e4b, char *file,
534534 void * buddy ;
535535 void * buddy2 ;
536536
537- if (!test_opt (sb , MBALLOC ))
538- return 0 ;
539-
540537 {
541538 static int mb_check_counter ;
542539 if (mb_check_counter ++ % 100 != 0 )
@@ -2487,19 +2484,14 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery)
24872484 unsigned max ;
24882485 int ret ;
24892486
2490- if (!test_opt (sb , MBALLOC ))
2491- return 0 ;
2492-
24932487 i = (sb -> s_blocksize_bits + 2 ) * sizeof (unsigned short );
24942488
24952489 sbi -> s_mb_offsets = kmalloc (i , GFP_KERNEL );
24962490 if (sbi -> s_mb_offsets == NULL ) {
2497- clear_opt (sbi -> s_mount_opt , MBALLOC );
24982491 return - ENOMEM ;
24992492 }
25002493 sbi -> s_mb_maxs = kmalloc (i , GFP_KERNEL );
25012494 if (sbi -> s_mb_maxs == NULL ) {
2502- clear_opt (sbi -> s_mount_opt , MBALLOC );
25032495 kfree (sbi -> s_mb_maxs );
25042496 return - ENOMEM ;
25052497 }
@@ -2522,7 +2514,6 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery)
25222514 /* init file for buddy data */
25232515 ret = ext4_mb_init_backend (sb );
25242516 if (ret != 0 ) {
2525- clear_opt (sbi -> s_mount_opt , MBALLOC );
25262517 kfree (sbi -> s_mb_offsets );
25272518 kfree (sbi -> s_mb_maxs );
25282519 return ret ;
@@ -2544,7 +2535,6 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery)
25442535
25452536 sbi -> s_locality_groups = alloc_percpu (struct ext4_locality_group );
25462537 if (sbi -> s_locality_groups == NULL ) {
2547- clear_opt (sbi -> s_mount_opt , MBALLOC );
25482538 kfree (sbi -> s_mb_offsets );
25492539 kfree (sbi -> s_mb_maxs );
25502540 return - ENOMEM ;
@@ -2590,9 +2580,6 @@ int ext4_mb_release(struct super_block *sb)
25902580 struct ext4_group_info * grinfo ;
25912581 struct ext4_sb_info * sbi = EXT4_SB (sb );
25922582
2593- if (!test_opt (sb , MBALLOC ))
2594- return 0 ;
2595-
25962583 /* release freed, non-committed blocks */
25972584 spin_lock (& sbi -> s_md_lock );
25982585 list_splice_init (& sbi -> s_closed_transaction ,
@@ -3805,7 +3792,7 @@ ext4_mb_discard_group_preallocations(struct super_block *sb,
38053792 *
38063793 * FIXME!! Make sure it is valid at all the call sites
38073794 */
3808- void ext4_mb_discard_inode_preallocations (struct inode * inode )
3795+ void ext4_discard_preallocations (struct inode * inode )
38093796{
38103797 struct ext4_inode_info * ei = EXT4_I (inode );
38113798 struct super_block * sb = inode -> i_sb ;
@@ -3817,7 +3804,7 @@ void ext4_mb_discard_inode_preallocations(struct inode *inode)
38173804 struct ext4_buddy e4b ;
38183805 int err ;
38193806
3820- if (!test_opt ( sb , MBALLOC ) || ! S_ISREG (inode -> i_mode )) {
3807+ if (!S_ISREG (inode -> i_mode )) {
38213808 /*BUG_ON(!list_empty(&ei->i_prealloc_list));*/
38223809 return ;
38233810 }
@@ -4300,11 +4287,6 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
43004287 sb = ar -> inode -> i_sb ;
43014288 sbi = EXT4_SB (sb );
43024289
4303- if (!test_opt (sb , MBALLOC )) {
4304- block = ext4_old_new_blocks (handle , ar -> inode , ar -> goal ,
4305- & (ar -> len ), errp );
4306- return block ;
4307- }
43084290 if (!EXT4_I (ar -> inode )-> i_delalloc_reserved_flag ) {
43094291 /*
43104292 * With delalloc we already reserved the blocks
0 commit comments