diff options
author | Qu Wenruo <wqu@suse.com> | 2021-08-17 17:38:52 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2021-08-23 19:01:48 +0200 |
commit | a0f5d9f49712a541d7e6013aadda66814803872b (patch) | |
tree | 8c3972034b85ece40135993432792c0a206b7c87 /fs/btrfs/scrub.c | |
parent | 163ed4f6d9ea036d0743535e723adea7dbf60635 (diff) | |
download | linux-next-a0f5d9f49712a541d7e6013aadda66814803872b.tar.gz |
btrfs: subpage: pack all subpage bitmaps into a larger bitmap
Currently we use u16 bitmap to make 4k sectorsize work for 64K page
size.
But this u16 bitmap is not large enough to contain larger page size like
128K, nor is space efficient for 16K page size.
To handle both cases, here we pack all subpage bitmaps into a larger
bitmap, now btrfs_subpage::bitmaps[] will be the ultimate bitmap for
subpage usage.
Each sub-bitmap will has its start bit number recorded in
btrfs_subpage_info::*_start, and its bitmap length will be recorded in
btrfs_subpage_info::bitmap_nr_bits.
All subpage bitmap operations will be converted from using direct u16
operations to bitmap operations, with above *_start calculated.
For 64K page size with 4K sectorsize, this should not cause much
difference.
While for 16K page size, we will only need 1 unsigned long (u32) to
store all the bitmaps, which saves quite some space.
Furthermore, this allows us to support larger page size like 128K and
258K.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/scrub.c')
0 files changed, 0 insertions, 0 deletions