diff options
author | Andrew Perepechko <andrew.perepechko@seagate.com> | 2017-04-30 00:46:35 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2017-04-30 00:46:35 -0400 |
commit | 85c8f176a6111ecde9c158109989dbd445a0e59a (patch) | |
tree | 6bdbf361508bb0159e9e13198424a517ff251d1d | |
parent | 1a20a63084be8fc5b0c1191231dfd311f7fc2afa (diff) |
ext4: preload block group descriptors
With enabled meta_bg option block group descriptors
reading IO is not sequential and requires optimization.
Signed-off-by: Andrew Perepechko <andrew.perepechko@seagate.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r-- | fs/ext4/super.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 9ec8963ba604..9a40e0c16dcc 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -3879,6 +3879,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
3879 | 3879 | ||
3880 | bgl_lock_init(sbi->s_blockgroup_lock); | 3880 | bgl_lock_init(sbi->s_blockgroup_lock); |
3881 | 3881 | ||
3882 | /* Pre-read the descriptors into the buffer cache */ | ||
3883 | for (i = 0; i < db_count; i++) { | ||
3884 | block = descriptor_loc(sb, logical_sb_block, i); | ||
3885 | sb_breadahead(sb, block); | ||
3886 | } | ||
3887 | |||
3882 | for (i = 0; i < db_count; i++) { | 3888 | for (i = 0; i < db_count; i++) { |
3883 | block = descriptor_loc(sb, logical_sb_block, i); | 3889 | block = descriptor_loc(sb, logical_sb_block, i); |
3884 | sbi->s_group_desc[i] = sb_bread_unmovable(sb, block); | 3890 | sbi->s_group_desc[i] = sb_bread_unmovable(sb, block); |