aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/mballoc.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2008-10-10 09:40:52 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-10-10 09:40:52 -0400
commitc2ea3fde61f1df1dbf062345f23277dcd6f01dfe (patch)
tree53ecbf57416326810540494e814c05753bf30874 /fs/ext4/mballoc.c
parent240799cdf22bd789ea6852653c3b879d35ad0a6c (diff)
ext4: Remove old legacy block allocator
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r--fs/ext4/mballoc.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index b9118bb29939..335faee0c0f5 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -534,9 +534,6 @@ static int __mb_check_buddy(struct ext4_buddy *e4b, char *file,
534 void *buddy; 534 void *buddy;
535 void *buddy2; 535 void *buddy2;
536 536
537 if (!test_opt(sb, MBALLOC))
538 return 0;
539
540 { 537 {
541 static int mb_check_counter; 538 static int mb_check_counter;
542 if (mb_check_counter++ % 100 != 0) 539 if (mb_check_counter++ % 100 != 0)
@@ -2487,19 +2484,14 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery)
2487 unsigned max; 2484 unsigned max;
2488 int ret; 2485 int ret;
2489 2486
2490 if (!test_opt(sb, MBALLOC))
2491 return 0;
2492
2493 i = (sb->s_blocksize_bits + 2) * sizeof(unsigned short); 2487 i = (sb->s_blocksize_bits + 2) * sizeof(unsigned short);
2494 2488
2495 sbi->s_mb_offsets = kmalloc(i, GFP_KERNEL); 2489 sbi->s_mb_offsets = kmalloc(i, GFP_KERNEL);
2496 if (sbi->s_mb_offsets == NULL) { 2490 if (sbi->s_mb_offsets == NULL) {
2497 clear_opt(sbi->s_mount_opt, MBALLOC);
2498 return -ENOMEM; 2491 return -ENOMEM;
2499 } 2492 }
2500 sbi->s_mb_maxs = kmalloc(i, GFP_KERNEL); 2493 sbi->s_mb_maxs = kmalloc(i, GFP_KERNEL);
2501 if (sbi->s_mb_maxs == NULL) { 2494 if (sbi->s_mb_maxs == NULL) {
2502 clear_opt(sbi->s_mount_opt, MBALLOC);
2503 kfree(sbi->s_mb_maxs); 2495 kfree(sbi->s_mb_maxs);
2504 return -ENOMEM; 2496 return -ENOMEM;
2505 } 2497 }
@@ -2522,7 +2514,6 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery)
2522 /* init file for buddy data */ 2514 /* init file for buddy data */
2523 ret = ext4_mb_init_backend(sb); 2515 ret = ext4_mb_init_backend(sb);
2524 if (ret != 0) { 2516 if (ret != 0) {
2525 clear_opt(sbi->s_mount_opt, MBALLOC);
2526 kfree(sbi->s_mb_offsets); 2517 kfree(sbi->s_mb_offsets);
2527 kfree(sbi->s_mb_maxs); 2518 kfree(sbi->s_mb_maxs);
2528 return ret; 2519 return ret;
@@ -2544,7 +2535,6 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery)
2544 2535
2545 sbi->s_locality_groups = alloc_percpu(struct ext4_locality_group); 2536 sbi->s_locality_groups = alloc_percpu(struct ext4_locality_group);
2546 if (sbi->s_locality_groups == NULL) { 2537 if (sbi->s_locality_groups == NULL) {
2547 clear_opt(sbi->s_mount_opt, MBALLOC);
2548 kfree(sbi->s_mb_offsets); 2538 kfree(sbi->s_mb_offsets);
2549 kfree(sbi->s_mb_maxs); 2539 kfree(sbi->s_mb_maxs);
2550 return -ENOMEM; 2540 return -ENOMEM;
@@ -2590,9 +2580,6 @@ int ext4_mb_release(struct super_block *sb)
2590 struct ext4_group_info *grinfo; 2580 struct ext4_group_info *grinfo;
2591 struct ext4_sb_info *sbi = EXT4_SB(sb); 2581 struct ext4_sb_info *sbi = EXT4_SB(sb);
2592 2582
2593 if (!test_opt(sb, MBALLOC))
2594 return 0;
2595
2596 /* release freed, non-committed blocks */ 2583 /* release freed, non-committed blocks */
2597 spin_lock(&sbi->s_md_lock); 2584 spin_lock(&sbi->s_md_lock);
2598 list_splice_init(&sbi->s_closed_transaction, 2585 list_splice_init(&sbi->s_closed_transaction,
@@ -3805,7 +3792,7 @@ out:
3805 * 3792 *
3806 * FIXME!! Make sure it is valid at all the call sites 3793 * FIXME!! Make sure it is valid at all the call sites
3807 */ 3794 */
3808void ext4_mb_discard_inode_preallocations(struct inode *inode) 3795void ext4_discard_preallocations(struct inode *inode)
3809{ 3796{
3810 struct ext4_inode_info *ei = EXT4_I(inode); 3797 struct ext4_inode_info *ei = EXT4_I(inode);
3811 struct super_block *sb = inode->i_sb; 3798 struct super_block *sb = inode->i_sb;
@@ -3817,7 +3804,7 @@ void ext4_mb_discard_inode_preallocations(struct inode *inode)
3817 struct ext4_buddy e4b; 3804 struct ext4_buddy e4b;
3818 int err; 3805 int err;
3819 3806
3820 if (!test_opt(sb, MBALLOC) || !S_ISREG(inode->i_mode)) { 3807 if (!S_ISREG(inode->i_mode)) {
3821 /*BUG_ON(!list_empty(&ei->i_prealloc_list));*/ 3808 /*BUG_ON(!list_empty(&ei->i_prealloc_list));*/
3822 return; 3809 return;
3823 } 3810 }
@@ -4300,11 +4287,6 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
4300 sb = ar->inode->i_sb; 4287 sb = ar->inode->i_sb;
4301 sbi = EXT4_SB(sb); 4288 sbi = EXT4_SB(sb);
4302 4289
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 }
4308 if (!EXT4_I(ar->inode)->i_delalloc_reserved_flag) { 4290 if (!EXT4_I(ar->inode)->i_delalloc_reserved_flag) {
4309 /* 4291 /*
4310 * With delalloc we already reserved the blocks 4292 * With delalloc we already reserved the blocks