summaryrefslogtreecommitdiff
path: root/fs/ext4/mballoc.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2020-07-17 00:14:40 -0400
committerTheodore Ts'o <tytso@mit.edu>2020-08-07 14:12:35 -0400
commit3d392b2676bf3199863a1e5efb2c087ad9d442a4 (patch)
tree848eeafb722b9269569e94b6cfcdd6a95169fbd3 /fs/ext4/mballoc.c
parentab74c7b23f3770935016e3eb3ecdf1e42b73efaa (diff)
ext4: add prefetch_block_bitmaps mount option
For file systems where we can afford to keep the buddy bitmaps cached, we can speed up initial writes to large file systems by starting to load the block allocation bitmaps as soon as the file system is mounted. This won't work well for _super_ large file systems, or memory constrained systems, so we only enable this when it is requested via a mount option. Addresses-Google-Bug: 159488342 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r--fs/ext4/mballoc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 9a07da53ab7b..8ecd49dd3906 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2232,9 +2232,8 @@ out:
* Start prefetching @nr block bitmaps starting at @group.
* Return the next group which needs to be prefetched.
*/
-static ext4_group_t
-ext4_mb_prefetch(struct super_block *sb, ext4_group_t group,
- unsigned int nr, int *cnt)
+ext4_group_t ext4_mb_prefetch(struct super_block *sb, ext4_group_t group,
+ unsigned int nr, int *cnt)
{
ext4_group_t ngroups = ext4_get_groups_count(sb);
struct buffer_head *bh;
@@ -2284,9 +2283,8 @@ ext4_mb_prefetch(struct super_block *sb, ext4_group_t group,
* waiting for the block allocation bitmap read to finish when
* ext4_mb_prefetch_fini is called from ext4_mb_regular_allocator().
*/
-static void
-ext4_mb_prefetch_fini(struct super_block *sb, ext4_group_t group,
- unsigned int nr)
+void ext4_mb_prefetch_fini(struct super_block *sb, ext4_group_t group,
+ unsigned int nr)
{
while (nr-- > 0) {
struct ext4_group_desc *gdp = ext4_get_group_desc(sb, group,