diff options
author | Connor O'Brien <connoro@google.com> | 2017-01-20 11:50:32 -0800 |
---|---|---|
committer | Connor O'Brien <connoro@google.com> | 2017-01-20 14:09:26 -0800 |
commit | 6a6c37f22fc62cf6a2fb5cc65ddcc887a5d96c86 (patch) | |
tree | b5e673798a2e3a2c3e0297adba3295079ede26ae /ext4_utils/ext4_utils.c | |
parent | 7f56eee60c66062acaa72fb212037a62a7e7f62d (diff) | |
download | extras-6a6c37f22fc62cf6a2fb5cc65ddcc887a5d96c86.tar.gz |
Set stripe_width and stride params in make_ext4fs
If available, make_ext4fs will use flash erase & logical block
sizes to tune stride and stripe_width.
Test: Build userdata w/ make_ext4fs, flash, check stride & stripe values
Bug: 33243520
Change-Id: I54f95d822cc1ccc0ebb5edec023560cd9e30e259
Signed-off-by: Connor O'Brien <connoro@google.com>
Diffstat (limited to 'ext4_utils/ext4_utils.c')
-rw-r--r-- | ext4_utils/ext4_utils.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext4_utils/ext4_utils.c b/ext4_utils/ext4_utils.c index fa5f673d..550181f3 100644 --- a/ext4_utils/ext4_utils.c +++ b/ext4_utils/ext4_utils.c @@ -352,10 +352,14 @@ void ext4_fill_in_sb(int real_uuid) sb->s_want_extra_isize = sizeof(struct ext4_inode) - EXT4_GOOD_OLD_INODE_SIZE; sb->s_flags = 2; - sb->s_raid_stride = 0; + sb->s_raid_stride = info.flash_logical_block_size / info.block_size; + // stride should be the max of 8kb and logical block size + if (info.flash_logical_block_size != 0 && info.flash_logical_block_size < 8192) { + sb->s_raid_stride = 8192 / info.block_size; + } sb->s_mmp_interval = 0; sb->s_mmp_block = 0; - sb->s_raid_stripe_width = 0; + sb->s_raid_stripe_width = info.flash_erase_block_size / info.block_size; sb->s_log_groups_per_flex = 0; sb->s_kbytes_written = 0; |