Skip to content

btrfs: btrfs_bio and btrfs_io_bio rename

Qu Wenruo linux-btrfs 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 18 repliesIn review
  2. v23 patches 6 repliesSuperseded
  3. v13 patches 3 repliesSuperseded

Changes in v3 from the cover letter

- Fixes whiespace problems
Caused by "dwi" vim commands

- Update several modified comments

- Rename btrfs_io_bio to btrfs_logical_bio
To avoid backport confusion.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs: rename btrfs_bio to btrfs_io_contextfs/btrfs/check-integrity.c fs/btrfs/extent-tree.c fs/btrfs/extent_io.c +8 more+326 -3144 replies
2/3btrfs: remove btrfs_bio_alloc() helperfs/btrfs/compression.c fs/btrfs/extent_io.c fs/btrfs/extent_io.h+23 -239 replies
3/3btrfs: rename struct btrfs_io_bio to btrfs_logical_biofs/btrfs/check-integrity.c fs/btrfs/compression.c fs/btrfs/ctree.h +10 more+116 -1114 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH v3 0/3] btrfs: btrfs_bio and btrfs_io_bio rename

The branch can be fetched from github, and is the preferred way to grab the code, as this patchset changed quite a lot of code.
https://github.com/adam900710/linux/tree/chunk_refactor

There are two structure, btrfs_io_bio and btrfs_bio, which have very similar names but completely different meanings.

Btrfs_io_bio mostly works at logical bytenr layer (its bio->bi_iter.bi_sector points to btrfs logical bytenr), and just contains extra info like csum and mirror_num.

And btrfs_io_bio is in fact the most utilized bio, as all data/metadata IO is using btrfs_io_bio.

While btrfs_bio is completely a helper structure for mirrored IO submission (utilized by SINGLE/DUP/RAID1/RAID10), and contains RAID56 maps for RAID56 (it doesn't utilize this structure for IO submission tracking).

Such naming is completely anti-human.

So this patchset will do the following renaming:

- btrfs_bio -> btrfs_io_context
Since it's not really used by all bios (only mirrored profiles utilize it), and it contains extra info for RAID56, it's not proper to name it with _bio suffix.

Later we can integrate btrfs_io_context pointer into the new btrfs_bio.

- btrfs_io_bio -> btrfs_logical_bio
It is intentional not to reuse "btrfs_bio", which could cause confusion for later backport.

Changelog:
v2:
- Rename btrfs_bio to btrfs_io_context (bioc)
- Rename btrfs_io_bio to btrfs_bio
Both suggested by Nikolay

v3:
- Fixes whiespace problems
Caused by "dwi" vim commands

- Update several modified comments

- Rename btrfs_io_bio to btrfs_logical_bio
To avoid backport confusion.

Qu Wenruo (3):
btrfs: rename btrfs_bio to btrfs_io_context
btrfs: remove btrfs_bio_alloc() helper
btrfs: rename struct btrfs_io_bio to btrfs_logical_bio

 fs/btrfs/check-integrity.c |   4 +-
 fs/btrfs/compression.c     |  20 +--
 fs/btrfs/ctree.h           |   6 +-
 fs/btrfs/disk-io.c         |   2 +-
 fs/btrfs/disk-io.h         |   2 +-
 fs/btrfs/extent-tree.c     |  19 ++-
 fs/btrfs/extent_io.c       | 116 ++++++++--------
 fs/btrfs/extent_io.h       |   8 +-
 fs/btrfs/extent_map.c      |   4 +-
 fs/btrfs/file-item.c       |  12 +-
 fs/btrfs/inode.c           |  50 +++----
 fs/btrfs/raid56.c          | 135 +++++++++---------
 fs/btrfs/raid56.h          |   8 +-
 fs/btrfs/reada.c           |  26 ++--
 fs/btrfs/scrub.c           | 130 +++++++++---------
 fs/btrfs/volumes.c         | 272 ++++++++++++++++++-------------------
 fs/btrfs/volumes.h         |  63 +++++----
 fs/btrfs/zoned.c           |  16 +--
 18 files changed, 455 insertions(+), 438 deletions(-)
Signature · 1 line
2.33.0