diff options
| author | Li Dongyang <dongyangli@ddn.com> | 2020-01-26 22:06:36 -0500 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2020-01-26 23:10:05 -0500 |
| commit | 59037c5357d39c6d0f14a0aff70e67dc13eafc84 (patch) | |
| tree | f85c853ef07d80759b15ddbfabe55f4eeb9481b0 /tests/r_32to64bit | |
| parent | 6022925dc445eafb3d06793406af786645303f4a (diff) | |
| download | platform_external_e2fsprogs-59037c5357d39c6d0f14a0aff70e67dc13eafc84.tar.gz platform_external_e2fsprogs-59037c5357d39c6d0f14a0aff70e67dc13eafc84.tar.bz2 platform_external_e2fsprogs-59037c5357d39c6d0f14a0aff70e67dc13eafc84.zip | |
mke2fs: set overhead in super block
If overhead is not recorded in the super block, it is calculated
during mount in kernel, for bigalloc file systems it takes
O(groups**2) in time. For a 1PB device with 32K cluster size it takes
~12 mins to mount, with most of the time spent on figuring out
overhead.
While we can not improve the overhead algorithm in kernel due to the
nature of bigalloc, we can work out the overhead during mke2fs and set
it in the super block, avoiding calculating it every time when it
mounts.
Overhead is s_first_data_block plus internal journal blocks plus the
block and inode bitmaps, inode table, super block backups and group
descriptor blocks for every group. This patch introduces
ext2fs_count_used_clusters(), which calculates the clusters used in
the block bitmap for the given range.
When bad blocks are involved, it gets tricky because the blocks
counted as overhead and the bad blocks can end up in the same
allocation cluster. In this case we will unmark the bad blocks from
the block bitmap, convert to cluster bitmap and get the overhead, then
mark the bad blocks back in the cluster bitmap.
Reset the overhead to zero when resizing, we can not simply count the
used blocks as overhead like we do when mke2fs. The overhead can be
calculated by kernel side during mount.
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'tests/r_32to64bit')
| -rw-r--r-- | tests/r_32to64bit/expect | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/r_32to64bit/expect b/tests/r_32to64bit/expect index f5fa56bc3..c6816b7f9 100644 --- a/tests/r_32to64bit/expect +++ b/tests/r_32to64bit/expect @@ -31,7 +31,13 @@ Change in FS metadata: Default mount options: user_xattr acl Filesystem state: clean Errors behavior: Continue -@@ -15,7 +15,8 @@ +@@ -10,13 +10,13 @@ + Inode count: 65536 + Block count: 524288 + Reserved block count: 26214 +-Overhead clusters: 35228 + Free blocks: 589 + Free inodes: 65048 First block: 1 Block size: 1024 Fragment size: 1024 @@ -41,7 +47,7 @@ Change in FS metadata: Blocks per group: 8192 Fragments per group: 8192 Inodes per group: 1024 -@@ -40,16 +41,16 @@ +@@ -41,16 +41,16 @@ group:block:super:gdt:bbitmap:ibitmap:itable @@ -64,7 +70,7 @@ Change in FS metadata: 10:81921:-1:-1:270:286:2852 11:90113:-1:-1:271:287:3108 12:98305:-1:-1:272:288:3364 -@@ -65,9 +66,9 @@ +@@ -66,9 +66,9 @@ 22:180225:-1:-1:131079:131095:132641 23:188417:-1:-1:131080:131096:132897 24:196609:-1:-1:131081:131097:133153 @@ -76,7 +82,7 @@ Change in FS metadata: 28:229377:-1:-1:131085:131101:134177 29:237569:-1:-1:131086:131102:134433 30:245761:-1:-1:131087:131103:134689 -@@ -89,7 +90,7 @@ +@@ -90,7 +90,7 @@ 46:376833:-1:-1:262159:262175:265761 47:385025:-1:-1:262160:262176:266017 48:393217:-1:-1:393217:393233:393249 |
