btrfs: simplify metadata pages reading
authorNikolay Borisov <nborisov@suse.com>
Mon, 14 Sep 2020 09:37:04 +0000 (12:37 +0300)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:13:19 +0000 (12:13 +0200)
commit0420177c08b2d86034a98d45b7d3609bdc986fd2
tree2f8b19c68e7bcce42d2ad0f904542edf25a987fd
parent2f1d3e4b930dcb83ac7ec9b106d7adb4d36c4c9d
btrfs: simplify metadata pages reading

Metadata pages currently use __do_readpage to read metadata pages,
unfortunately this function is also used to deal with ordinary data
pages. This makes the metadata pages reading code to go through multiple
hoops in order to adhere to __do_readpage invariants. Most of these are
necessary for data pages which could be compressed. For metadata it's
enough to simply build a bio and submit it.

To this effect simply call submit_extent_page directly from
read_extent_buffer_pages which is the only callpath used to populate
extent_buffers with data. This in turn enables further cleanups.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c