diff options
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 89baee42f353..5a51af7d0335 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -59,6 +59,7 @@ static struct kset *ext4_kset; | |||
59 | static struct ext4_lazy_init *ext4_li_info; | 59 | static struct ext4_lazy_init *ext4_li_info; |
60 | static struct mutex ext4_li_mtx; | 60 | static struct mutex ext4_li_mtx; |
61 | static struct ext4_features *ext4_feat; | 61 | static struct ext4_features *ext4_feat; |
62 | static int ext4_mballoc_ready; | ||
62 | 63 | ||
63 | static int ext4_load_journal(struct super_block *, struct ext4_super_block *, | 64 | static int ext4_load_journal(struct super_block *, struct ext4_super_block *, |
64 | unsigned long journal_devnum); | 65 | unsigned long journal_devnum); |
@@ -845,6 +846,10 @@ static void ext4_put_super(struct super_block *sb) | |||
845 | invalidate_bdev(sbi->journal_bdev); | 846 | invalidate_bdev(sbi->journal_bdev); |
846 | ext4_blkdev_remove(sbi); | 847 | ext4_blkdev_remove(sbi); |
847 | } | 848 | } |
849 | if (sbi->s_mb_cache) { | ||
850 | ext4_xattr_destroy_cache(sbi->s_mb_cache); | ||
851 | sbi->s_mb_cache = NULL; | ||
852 | } | ||
848 | if (sbi->s_mmp_tsk) | 853 | if (sbi->s_mmp_tsk) |
849 | kthread_stop(sbi->s_mmp_tsk); | 854 | kthread_stop(sbi->s_mmp_tsk); |
850 | sb->s_fs_info = NULL; | 855 | sb->s_fs_info = NULL; |
@@ -4010,6 +4015,14 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
4010 | percpu_counter_set(&sbi->s_dirtyclusters_counter, 0); | 4015 | percpu_counter_set(&sbi->s_dirtyclusters_counter, 0); |
4011 | 4016 | ||
4012 | no_journal: | 4017 | no_journal: |
4018 | if (ext4_mballoc_ready) { | ||
4019 | sbi->s_mb_cache = ext4_xattr_create_cache(sb->s_id); | ||
4020 | if (!sbi->s_mb_cache) { | ||
4021 | ext4_msg(sb, KERN_ERR, "Failed to create an mb_cache"); | ||
4022 | goto failed_mount_wq; | ||
4023 | } | ||
4024 | } | ||
4025 | |||
4013 | /* | 4026 | /* |
4014 | * Get the # of file system overhead blocks from the | 4027 | * Get the # of file system overhead blocks from the |
4015 | * superblock if present. | 4028 | * superblock if present. |
@@ -5519,11 +5532,9 @@ static int __init ext4_init_fs(void) | |||
5519 | 5532 | ||
5520 | err = ext4_init_mballoc(); | 5533 | err = ext4_init_mballoc(); |
5521 | if (err) | 5534 | if (err) |
5522 | goto out3; | ||
5523 | |||
5524 | err = ext4_init_xattr(); | ||
5525 | if (err) | ||
5526 | goto out2; | 5535 | goto out2; |
5536 | else | ||
5537 | ext4_mballoc_ready = 1; | ||
5527 | err = init_inodecache(); | 5538 | err = init_inodecache(); |
5528 | if (err) | 5539 | if (err) |
5529 | goto out1; | 5540 | goto out1; |
@@ -5539,10 +5550,9 @@ out: | |||
5539 | unregister_as_ext3(); | 5550 | unregister_as_ext3(); |
5540 | destroy_inodecache(); | 5551 | destroy_inodecache(); |
5541 | out1: | 5552 | out1: |
5542 | ext4_exit_xattr(); | 5553 | ext4_mballoc_ready = 0; |
5543 | out2: | ||
5544 | ext4_exit_mballoc(); | 5554 | ext4_exit_mballoc(); |
5545 | out3: | 5555 | out2: |
5546 | ext4_exit_feat_adverts(); | 5556 | ext4_exit_feat_adverts(); |
5547 | out4: | 5557 | out4: |
5548 | if (ext4_proc_root) | 5558 | if (ext4_proc_root) |
@@ -5565,7 +5575,6 @@ static void __exit ext4_exit_fs(void) | |||
5565 | unregister_as_ext3(); | 5575 | unregister_as_ext3(); |
5566 | unregister_filesystem(&ext4_fs_type); | 5576 | unregister_filesystem(&ext4_fs_type); |
5567 | destroy_inodecache(); | 5577 | destroy_inodecache(); |
5568 | ext4_exit_xattr(); | ||
5569 | ext4_exit_mballoc(); | 5578 | ext4_exit_mballoc(); |
5570 | ext4_exit_feat_adverts(); | 5579 | ext4_exit_feat_adverts(); |
5571 | remove_proc_entry("fs/ext4", NULL); | 5580 | remove_proc_entry("fs/ext4", NULL); |