btrfs: make btrfs_is_subpage() to return false directly for 4K page size
authorQu Wenruo <wqu@suse.com>
Mon, 5 Aug 2024 05:32:54 +0000 (15:02 +0930)
committerDavid Sterba <dsterba@suse.com>
Tue, 10 Sep 2024 14:51:18 +0000 (16:51 +0200)
commitefffb803bf37d4514e025e3d59e067dabb59bcd1
treeeeab7b82ce7396d620286a5a74da79e404abbb45
parent0c749585fc522b6cb32111abf2cd8f17cf30d3c5
btrfs: make btrfs_is_subpage() to return false directly for 4K page size

Btrfs only supports sectorsize 4K, 8K, 16K, 32K, 64K for now, thus for
systems with 4K page size, there is no way the fs is subpage (sectorsize
< PAGE_SIZE).

So here we define btrfs_is_subpage() different according to the
PAGE_SIZE:

- PAGE_SIZE > 4K
  We may hit real subpage cases, define btrfs_is_subpage() as a regular
  function and do the usual checks.

- PAGE_SIZE == 4K (no smaller PAGE_SIZE support AFAIK)
  There is no way the fs is subpage, so just define btrfs_is_subpage()
  as an inline function which always return false.

This saves about 7K bytes for x86_64 debug builds:

   text    data     bss     dec     hex filename
Before: 1484452  168693   25776 1678921  199e49 fs/btrfs/btrfs.ko
After: 1476605  168445   25776 1670826  197eaa fs/btrfs/btrfs.ko

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/subpage.c
fs/btrfs/subpage.h