mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 20:54:03 +02:00
btrfs: allow any block size that is no larger than page size
Since v5.15 btrfs has support for block size < page size, but we still only support 4K block size, while there is no special reason that we cannot support 8K/16K/32K block sizes for 64K page size. That 4K limit is completely arbitrary, and mostly to reduce test runtime so we do not need to test all the extra block size combinations. However that also limits the user choices, some users may understand what they are doing, and want larger block sizes. In that case, fixed 4K block size for subpage routine is blocking our way. Just remove that fixed 4K requirement for block size < page size. This should not affect regular end users, since mkfs is already using 4K block size as default for quite a while, and the existing bs == ps support is always there. But for power users, this allows extra block size support, and may provide extra test coverage. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
6eb2fe0724
commit
097cdc8462
|
|
@ -127,14 +127,9 @@ void btrfs_csum_final(struct btrfs_csum_ctx *ctx, u8 *out)
|
|||
}
|
||||
|
||||
/*
|
||||
* We support the following block sizes for all systems:
|
||||
*
|
||||
* - 4K
|
||||
* This is the most common block size. For PAGE SIZE > 4K cases the subpage
|
||||
* mode is used.
|
||||
*
|
||||
* - PAGE_SIZE
|
||||
* The straightforward block size to support.
|
||||
* For regular builds, any block size <= page size is supported.
|
||||
* For experimental builds, any block size between BTRFS_MIN_BLOCKSIZE
|
||||
* and BTRFS_MAX_BLOCKSIZE (inclusive) is supported.
|
||||
*/
|
||||
bool __attribute_const__ btrfs_supported_blocksize(u32 blocksize)
|
||||
{
|
||||
|
|
@ -142,7 +137,7 @@ bool __attribute_const__ btrfs_supported_blocksize(u32 blocksize)
|
|||
ASSERT(is_power_of_2(blocksize) && blocksize >= BTRFS_MIN_BLOCKSIZE &&
|
||||
blocksize <= BTRFS_MAX_BLOCKSIZE);
|
||||
|
||||
if (blocksize == PAGE_SIZE || blocksize == SZ_4K || blocksize == BTRFS_MIN_BLOCKSIZE)
|
||||
if (blocksize <= PAGE_SIZE)
|
||||
return true;
|
||||
#ifdef CONFIG_BTRFS_EXPERIMENTAL
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user