btrfs: paramater refactors for data and metadata endio call backs
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest2 patches 6 repliesIn review
- v22 patches 2 repliesSuperseded
- v12 patches 4 repliesSuperseded
Changes in v3 from the cover letter
- Rename the @offset/phy_offset to @bio_offset to avoid confusion It turns out that, the name used in v2, @disk_bytenr, can also be confusing, as in endio time, the bi_sector can be remapped for real device offset.
Although it doesn't cause problem since we're only using that value to calculate the offset to the beginning of the bio.
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | btrfs: remove the phy_offset parameter for btrfs_validate_metadata_buffer()fs/ fs/ fs/ | +3 | 2 replies | |
| 2/2 | btrfs: pass bio_offset to check_data_csum() directlyfs/ fs/ fs/ | +25 | 4 replies |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Nikolay Borisov | Johannes Thumshirn | Josef Bacik |
|---|---|---|---|
| 1/2 | R-b | R-b | R-b |
| 2/2 | R-b | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v3 0/2] btrfs: paramater refactors for data and metadata endio call backs
This is another cleanup exposed when I'm fixing my subpage patchset.
Dating back to the old time where we still have hooks for data/metadata endio, we have a parameter called @phy_offset for both hooks.
That @phy_offset is the number of sectors compared to the bio on-disk bytenr, and is used to grab the csum from btrfs_io_bio.
This is far from straightforward, and costs reader tons of time to grasp the basic.
This patchset will change it by:
- Remove phy_offset completely for metadata
Since metadata doesn't use btrfs_io_bio::csums[] at all, there is no need for it.
- Use @disk_bytenr to replace @phy_offset/@icsum
Let the callee, check_data_csum() to calculate the offset from @disk_bytenr and bio to get the csum offset.
Changelog:
v2:
- Update commit message to remove the wrong comment on btrfs_io_bio->logical
That logical is mess, it has different meanings for different use cases.
What we should refer to is bio->bi_iter.bi_sector.
- Remove the false-alert prone ASSERT()
Even at endio time. bio->bi_iter.bi_size can change due to incoming finished IOs.
This means we can't really rely on bio->bi_iter.bi_size to check if our disk_bytenr is still valid.
v3:
- Rename the @offset/phy_offset to @bio_offset to avoid confusion It turns out that, the name used in v2, @disk_bytenr, can also be confusing, as in endio time, the bi_sector can be remapped for real device offset.
Although it doesn't cause problem since we're only using that value to calculate the offset to the beginning of the bio.
But still, we're trying to remove confusion, not adding more, thus rename them to bio_offset.
Qu Wenruo (2):
btrfs: remove the phy_offset parameter for
btrfs_validate_metadata_buffer()
btrfs: pass bio_offset to check_data_csum() directly
fs/btrfs/disk-io.c | 2 +- fs/btrfs/disk-io.h | 2 +- fs/btrfs/extent_io.c | 16 +++++++++------- fs/btrfs/inode.c | 26 ++++++++++++++++---------- 4 files changed, 27 insertions(+), 19 deletions(-)
Signature · 1 line
2.29.2