btrfs: subpage: make readahead work properly
authorQu Wenruo <wqu@suse.com>
Mon, 15 Mar 2021 05:39:15 +0000 (13:39 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 16 Mar 2021 10:06:21 +0000 (11:06 +0100)
commit60484cd9d50117017cf53d5310c6cd629600dc69
treed9fd8b21118ecfb047beb71c427fec8cffe0d475
parentd9bb77d51e668a1a6d4530c1ea471574d0ce465f
btrfs: subpage: make readahead work properly

In readahead infrastructure, we are using a lot of hard coded PAGE_SHIFT
while we're not doing anything specific to PAGE_SIZE.

One of the most affected part is the radix tree operation of
btrfs_fs_info::reada_tree.

If using PAGE_SHIFT, subpage metadata readahead is broken and does no
help reading metadata ahead.

Fix the problem by using btrfs_fs_info::sectorsize_bits so that
readahead could work for subpage.

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>
fs/btrfs/reada.c