btrfs: delayed refs cleanups
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest19 patches 19 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/19 | btrfs: add a helper to get the delayed ref node from the data/tree reffs/ fs/ | +31 | 1 reply | |
| 2/19 | btrfs: embed data_ref and tree_ref in btrfs_delayed_ref_nodefs/ fs/ | +40 | 1 reply | |
| 3/19 | btrfs: do not use a function to initialize btrfs_reffs/ fs/ fs/ +4 more | +131 | 1 reply | |
| 4/19 | btrfs: move ref_root into btrfs_reffs/ fs/ fs/ +5 more | +73 | 1 reply | |
| 5/19 | btrfs: pass btrfs_ref to init_delayed_ref_commonfs/ fs/ | +27 | 1 reply | |
| 6/19 | btrfs: initialize btrfs_delayed_ref_head with btrfs_reffs/ | +25 | 1 reply | |
| 7/19 | btrfs: move ref specific initialization into init_delayed_ref_commonfs/ | +11 | 1 reply | |
| 8/19 | btrfs: simplify delayed ref tracepointsfs/ fs/ include/ | +25 | 1 reply | |
| 9/19 | btrfs: unify the btrfs_add_delayed_*_ref helpers into one helperfs/ | +28 | 1 reply | |
| 10/19 | btrfs: rename ->len to ->num_bytes in btrfs_reffs/ fs/ fs/ +5 more | +27 | 1 reply | |
| 11/19 | btrfs: move ->parent and ->ref_root into btrfs_delayed_ref_nodefs/ fs/ fs/ +2 more | +52 | 1 reply | |
| 12/19 | btrfs: rename btrfs_data_ref->ino to ->objectidfs/ fs/ fs/ | +4 | 1 reply | |
| 13/19 | btrfs: make __btrfs_inc_extent_ref take a btrfs_delayed_ref_nodefs/ fs/ | +25 | 1 reply | |
| 14/19 | btrfs: drop unnecessary arguments from __btrfs_free_extentfs/ | +8 | 1 reply | |
| 15/19 | btrfs: make the insert backref helpers take a btrfs_delayed_ref_nodefs/ | +21 | 1 reply | |
| 16/19 | btrfs: stop referencing btrfs_delayed_data_ref directlyfs/ fs/ include/ | +13 | 1 reply | |
| 17/19 | btrfs: stop referencing btrfs_delayed_tree_ref directlyfs/ fs/ include/ | +16 | 1 reply | |
| 18/19 | btrfs: remove the btrfs_delayed_ref_node container helpersfs/ | +0 | 1 reply | |
| 19/19 | btrfs: replace btrfs_delayed_*_ref with btrfs_*_reffs/ fs/ | +28 | 1 reply |
Reviews trailers per patch
All 19 patches have a Reviewed-by or Acked-by.
| Patch | Filipe Manana |
|---|---|
| 1/19 | R-b |
| 2/19 | R-b |
| 3/19 | R-b |
| 4/19 | R-b |
| 5/19 | R-b |
| 6/19 | R-b |
| 7/19 | R-b |
| 8/19 | R-b |
| 9/19 | R-b |
| 10/19 | R-b |
| 11/19 | R-b |
| 12/19 | R-b |
| 13/19 | R-b |
| 14/19 | R-b |
| 15/19 | R-b |
| 16/19 | R-b |
| 17/19 | R-b |
| 18/19 | R-b |
| 19/19 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/19] btrfs: delayed refs cleanups
Hello,
While I was fixing the snapshot deletion corruption I noticed a lot of silly duplication when it comes to delayed refs. We have two things to refer to references, and use different names for the same thing, anybody who doesn't know what this code does would understandably be confused.
I reworked all of this to consolidate everything into btrfs_delayed_ref_node, and got rid of the type specific wrapper structs. I made the initialization of the btrfs_ref for the actions clearer instead of a 6 argument initialization function. I used this simplification to reduce the duplicated code around adding new delayed refs. The result is a net removal of 130 lines of code, and makes several of the call chains clearer as we just pass the btrfs_delayed_ref_node around where we can.
I want to cleanup how we lookup delayed ref heads and how we handle those cases, but I'm much more cautious around that code because there's some guarantees about parallel modifications that are maintained by the current status quo, and I'm afraid cleaning that code up will result in subtle bugs.
These cleanups should be relatively safe as they have no behavior changes. I've run it through fstests to validate nothing broke. Thanks,
Josef
Josef Bacik (19):
btrfs: add a helper to get the delayed ref node from the data/tree ref
btrfs: embed data_ref and tree_ref in btrfs_delayed_ref_node
btrfs: do not use a function to initialize btrfs_ref
btrfs: move ref_root into btrfs_ref
btrfs: pass btrfs_ref to init_delayed_ref_common
btrfs: initialize btrfs_delayed_ref_head with btrfs_ref
btrfs: move ref specific initialization into init_delayed_ref_common
btrfs: simplify delayed ref tracepoints
btrfs: unify the btrfs_add_delayed_*_ref helpers into one helper
btrfs: rename ->len to ->num_bytes in btrfs_ref
btrfs: move ->parent and ->ref_root into btrfs_delayed_ref_node
btrfs: rename btrfs_data_ref->ino to ->objectid
btrfs: make __btrfs_inc_extent_ref take a btrfs_delayed_ref_node
btrfs: drop unnecessary arguments from __btrfs_free_extent
btrfs: make the insert backref helpers take a btrfs_delayed_ref_node
btrfs: stop referencing btrfs_delayed_data_ref directly
btrfs: stop referencing btrfs_delayed_tree_ref directly
btrfs: remove the btrfs_delayed_ref_node container helpers
btrfs: replace btrfs_delayed_*_ref with btrfs_*_ref
fs/btrfs/backref.c | 40 ++-- fs/btrfs/delayed-ref.c | 369 +++++++++++------------------------ fs/btrfs/delayed-ref.h | 148 +++++++------- fs/btrfs/extent-tree.c | 273 ++++++++++++-------------- fs/btrfs/file.c | 79 ++++---- fs/btrfs/inode-item.c | 16 +- fs/btrfs/ref-verify.c | 8 +- fs/btrfs/relocation.c | 84 +++++--- fs/btrfs/tree-log.c | 17 +- include/trace/events/btrfs.h | 56 ++---- 10 files changed, 479 insertions(+), 611 deletions(-)
Signature · 1 line
2.43.0