btrfs: more explaination on extent_map members
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest3 patches 0 repliesNew
- v43 patches 4 repliesSuperseded
- v33 patches 6 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 4 patches | 7 replies | Superseded | |
| v1 | 2 patches | 4 replies | Superseded |
Changes in v5 from the cover letter
- Update the comment on extent map merging part
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | btrfs: add extra comments on extent_map membersfs/ | +55 | 0 replies | |
| 2/3 | btrfs: simplify the inline extent map creationfs/ | +10 | 0 replies | |
| 3/3 | btrfs: add extra sanity checks for create_io_em()fs/ | +39 | 0 replies |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Filipe Manana |
|---|---|
| 1/3 | R-b |
| 2/3 | R-b |
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v5 0/3] btrfs: more explaination on extent_map members
[REPO]
https://github.com/adam900710/linux.git/ em_cleanup
The first 3 patches only. As later patches are the huge rename part.
[CHANGELOG]
v5:
- Update the comment on extent map merging part
v4:
- Add extra comments for the extent map merging
Since extent maps can be merged, the members are only matching on-disk file extent items before merging.
This also means users of extent_map should not rely on it for a reliable file extent item member.
(That's also why we use ordered_extent not extent_maps, to update
file extent items)
v3:
- Rebased to latest for-next branch
- Further comments polishment
- Coding style update to follow the guideline
v2:
- Add Filipe's cleanup on mod_start/mod_len
These two members are no longer utilized, saving me quite some time on digging into their usage.
- Update the comments of the extent_map structure
To make them more readable and less confusing.
- Further cleanup for inline extent_map reading
- A new patch to do extra sanity checks for create_io_em() Firstly pure NOCOW writes should not call create_io_em(), secondly with the new knowledge of extent_map, it's easier to do extra sanity checks for the already pretty long parameter list.
Btrfs uses extent_map to represent a in-memory file extent.
There are severam members that are 1:1 mappe in on-disk file extent items and extent maps:
- extent_map::start == key.offset
- extent_map::len == file_extent_num_bytes
- extent_map::ram_bytes == file_extent_ram_bytes
But that's all, the remaining are pretty different:
- Use block_start to indicate holes/inline extents
Meanwhile btrfs on-disk file extent items go with a dedicated type for inline extents, and disk_bytenr 0 for holes.
- Weird block_start/orig_block_len/orig_start
In theory we can directly go with the same file_extent_disk_bytenr, file_extent_disk_num_bytes and file_extent_offset to calculate the remaining members (block_start/orig_start/orig_block_len/block_len).
But for whatever reason, we didn't go that path and have a hell of weird and inconsistent calculation for them.
Qu Wenruo (3):
btrfs: add extra comments on extent_map members
btrfs: simplify the inline extent map creation
btrfs: add extra sanity checks for create_io_em()
fs/btrfs/extent_map.h | 56 ++++++++++++++++++++++++++++++++++++++++++- fs/btrfs/file-item.c | 20 ++++++++-------- fs/btrfs/inode.c | 40 ++++++++++++++++++++++++++++++- 3 files changed, 104 insertions(+), 12 deletions(-)
Signature · 1 line
2.44.0