Skip to content

btrfs-progs: write_and_map_eb() cleanup

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs-progs: split btrfs_direct_pio() functions into twocommon/device-utils.c common/device-utils.h+60 -290 replies
2/3btrfs-progs: constify the buffer pointer for write functionscommon/device-utils.h kernel-shared/extent_io.c kernel-shared/extent_io.h+5 -50 replies
3/3btrfs-progs: remove write_and_map_eb()btrfs-corrupt-block.c convert/main.c convert/source-reiserfs.c +3 more+53 -890 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] btrfs-progs: write_and_map_eb() cleanup

During my convert fixes, I found a lot of locations allocating a dummy extent buffer with a size which is not nodesize.

Then just read data into that dummy eb, and later call write_and_map_eb() to write it back.

This behavior is a historic workaround, at a time where we only do proper RAID56 writeback for metadata, but not data.

But now we have all raid56 handling done properly, and has proper function to read/write any logical bytenr, read_data_from_disk() and write_data_to_disk().

Thus there is no longer any need to use write_and_map_eb() as a workaround.

This patchset would completely remove write_and_map_eb(), most call sites are just abuse, only 3 call sites are valid but can easily be converted to call write_data_to_disk().

Qu Wenruo (3):
btrfs-progs: split btrfs_direct_pio() functions into two
btrfs-progs: constify the buffer pointer for write functions
btrfs-progs: remove write_and_map_eb()

 btrfs-corrupt-block.c     | 48 ++++++++++++++---------
 common/device-utils.c     | 82 ++++++++++++++++++++++++++-------------
 common/device-utils.h     | 13 ++++---
 convert/main.c            | 19 ++++-----
 convert/source-reiserfs.c | 10 +----
 kernel-shared/disk-io.c   | 23 +----------
 kernel-shared/disk-io.h   |  1 -
 kernel-shared/extent_io.c |  2 +-
 kernel-shared/extent_io.h |  2 +-
 mkfs/rootdir.c            | 41 +++++++-------------
 10 files changed, 118 insertions(+), 123 deletions(-)
Signature · 1 line
2.40.1