Skip to content

Simplifications around submit_bio_hook

Nikolay Borisov linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6btrfs: Define submit_bio_hook's type directlyfs/btrfs/extent_io.h+3 -41 reply
2/6btrfs: Change submit_bio_hook to taking an inode directlyfs/btrfs/disk-io.c fs/btrfs/extent_io.h fs/btrfs/inode.c+4 -62 replies
3/6btrfs: Remove 'tree' argument from read_extent_buffer_pagesfs/btrfs/disk-io.c fs/btrfs/extent_io.c fs/btrfs/extent_io.h+6 -131 reply
4/6btrfs: Pass 0 for bio_offset to btrfs_wq_submit_biofs/btrfs/inode.c+1 -24 replies
5/6btrfs: Always pass 0 bio_offset for btree_submit_bio_startfs/btrfs/disk-io.c+1 -21 reply
6/6btrfs: Remove bio_offset argument from submit_bio_hookfs/btrfs/disk-io.c fs/btrfs/extent_io.c fs/btrfs/extent_io.h +1 more+8 -104 replies

Reviews trailers per patch

5 of 6 patches have a Reviewed-by or Acked-by.

PatchJohannes Thumshirn
1/6R-b
2/6
3/6R-b
4/6R-b
5/6R-b
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] Simplifications around submit_bio_hook

I've been taking a look at the submit_bio_hook et al and I saw some opportunities for improvement. First I begin by simplifying the definition of submit_bio_hook callback and making one of its arguments explicit.

Patch 3 removes a redundant extent_io_tree argument that was passed through several layers of functions and ultimately made it somewhat cumbersome to reason what extent_io_tree is being used.

Patch 4 and 5 hardcode a 0 being passed for the bio_offset parameter to btrfs_submit_bio_start/btree_submit_bio_start since it only matters for DIO.

Patch 6 finally does away with the bio_offset parameter of submit_bio_hook.

Here is the output of bloat-o-meter for posterity:

add/remove: 0/0 grow/shrink: 4/7 up/down: 48/-319 (-271)

Function                                     old     new   delta
read_extent_buffer_pages                     784     822     +38
btrfs_add_ordered_sum                        100     104      +4
btrfs_submit_bio_hook                        364     367      +3
btree_submit_bio_hook                        175     178      +3
end_bio_extent_readpage                     2119    2116      -3
btrfs_reloc_clone_csums                      272     262     -10
btrfs_csum_one_bio                          1358    1348     -10
btree_read_extent_buffer_pages               282     272     -10
readahead_tree_block                          73      55     -18
reada_tree_block_flagged                     194     165     -29

submit_one_bio 313 74 -239
Total: Before=1072719, After=1072448, chg -0.03%

Nikolay Borisov (6):
btrfs: Define submit_bio_hook's type directly
btrfs: Change submit_bio_hook to taking an inode directly
btrfs: Remove 'tree' argument from read_extent_buffer_pages
btrfs: Pass 0 for bio_offset to btrfs_wq_submit_bio
btrfs: Always pass 0 bio_offset for btree_submit_bio_start
btrfs: Remove bio_offset argument from submit_bio_hook

 fs/btrfs/disk-io.c   | 22 +++++++---------------
 fs/btrfs/extent_io.c | 10 ++++------
 fs/btrfs/extent_io.h |  9 +++------
 fs/btrfs/inode.c     | 11 +++++------
 4 files changed, 19 insertions(+), 33 deletions(-)
Signature · 1 line
2.17.1