mbox series

[00/10] Cleanup metadata page reading path

Message ID 20200909094914.29721-1-nborisov@suse.com (mailing list archive)
Headers show
Series Cleanup metadata page reading path | expand

Message

Nikolay Borisov Sept. 9, 2020, 9:49 a.m. UTC
This series streamlines the page read path for metadata pages. Currently
__do_readpage is shared between ordinary data inodes as well as the btree_inode.
This is unnecenssary and brings clutter to the interface of __do_readpage et al
in the form of needlessly passed parameters and unnecessary actions performed
in btree_get_extent just to appease the interface/logic of __do_readpage.

To simplify the code metadata read is switched from calling __do_readpage to
directly calling submit_extent_page in read_extent_buffer_pages which is sufficient
to grab metadata pages. This in turn paves the way for further cleanups by
removing a lot of arguments from top level functions and sinking them in
lowe-level worker functions.

Patch 1 and 2 remove unused function and a parameter from btrfs_get_extent.
Patch 3 switches read_extent_buffer_pages (sole metadata read path) to using
submit_extent_page which enables further simplifications. Following patches
now-unused functions and removes certain indirection now that __do_readpage
is used only for data read.

Every patch has survived a -g quick and the overall series survived a full
xfstest run.

Nikolay Borisov (10):
  btrfs: Remove btree_readpage
  btrfs: Remove pg_offset from btrfs_get_extent
  btrfs: Simplify metadata pages reading
  btrfs: Remove btree_get_extent
  btrfs: Remove btrfs_get_extent indirection from __do_readpage
  btrfs: Remove mirror_num argument from extent_read_full_page
  btrfs: Promote extent_read_full_page to btrfs_readpage
  btrfs: Sink mirror_num argument in extent_read_full_page
  btrfs: Sink read_flags argument into extent_read_full_page
  btrfs: Sink mirror_num argument in __do_readpage

 fs/btrfs/ctree.h             |  3 +-
 fs/btrfs/disk-io.c           | 53 --------------------------
 fs/btrfs/disk-io.h           |  3 --
 fs/btrfs/extent_io.c         | 74 ++++++++++++------------------------
 fs/btrfs/extent_io.h         | 10 +++--
 fs/btrfs/file.c              | 12 +++---
 fs/btrfs/inode.c             | 37 +++++++++---------
 fs/btrfs/ioctl.c             |  2 +-
 fs/btrfs/tests/inode-tests.c | 42 ++++++++++----------
 9 files changed, 79 insertions(+), 157 deletions(-)

--
2.17.1