reduce boilerplate code within btrfs
Get series with b4
b4 am [email protected]Versions newest first
- v3 Latest6 patches 1 replyIn review
Changes in v3 from the cover letter
- Fix the error handling in the 2nd patch
- Fix the backref walk failure
There are two bugs in the 3rd patch:
* Bad parent/ref pointer update
Which only get updated once at the beginning, meanwhile they should be updated only when we found an existing node.
* Order change for prelim_ref
The prelim_ref_compare() require the first parameter to be the existing ref, and the second parameter to be the new one. This is different from the new rb_find_add_cached() order
Fix both and remove unnecessary variables.
- Add named parameters for cmp() function used in rb_find_add_cached() To give a more explicit distinguish on which one should be the newer node and which should be the existing node.
This should reduce the confusion on the order.
- Unify the parameters for cmp() functions
And all internal entry structure will have corresponding "new_/exist_" prefix.
- Make all parameters of cmp() to be const
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | rbtree: add rb_find_add_cached() to rbtree.hinclude/ | +37 | 0 replies | |
| 2/6 | btrfs: update btrfs_add_block_group_cache() to use rb helperfs/ | +22 | 0 replies | |
| 3/6 | btrfs: update prelim_ref_insert() to use rb helpersfs/ | +39 | 0 replies | |
| 4/6 | btrfs: update __btrfs_add_delayed_item() to use rb helperfs/ | +19 | 0 replies | |
| 5/6 | btrfs: update btrfs_add_chunk_map() to use rb helpersfs/ | +21 | 0 replies | |
| 6/6 | btrfs: update tree_insert() to use rb helpersfs/ | +18 | 0 replies |
Reviews trailers per patch
All 6 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Peter Zijlstra (Intel) | Qu Wenruo | David Sterba |
|---|---|---|---|
| Series | R-b | ||
| 1/6 | A-b | R-b | |
| 2/6 | R-b | ||
| 3/6 | R-b | ||
| 4/6 | R-b | ||
| 5/6 | R-b | ||
| 6/6 | 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/6] reduce boilerplate code within btrfs
[Changelog]
v3:
- Fix the error handling in the 2nd patch
- Fix the backref walk failure
There are two bugs in the 3rd patch:
* Bad parent/ref pointer update
Which only get updated once at the beginning, meanwhile they should be updated only when we found an existing node.
* Order change for prelim_ref
The prelim_ref_compare() require the first parameter to be the existing ref, and the second parameter to be the new one. This is different from the new rb_find_add_cached() order
Fix both and remove unnecessary variables.
- Add named parameters for cmp() function used in rb_find_add_cached() To give a more explicit distinguish on which one should be the newer node and which should be the existing node.
This should reduce the confusion on the order.
- Unify the parameters for cmp() functions
And all internal entry structure will have corresponding "new_/exist_" prefix.
- Make all parameters of cmp() to be const
v2: By Roger L
- Fix error handing in the 2nd patch
Which is still not done correctly
- Add Acked-by tag from Peter
The goal of this patch series is to reduce boilerplate code within btrfs. To accomplish this rb_find_add_cached() was added to linux/include/rbtree.h. Any replaceable functions were then replaced within btrfs.
changelog:
updated if() statements to utilize newer error checking resolved lock error on 0002
edited title of patches to utilize update instead of edit added Acked-by from Peter Zijlstra to 0001 eliminated extra variables throughout the patch series
Roger L. Beckermeyer III (6):
rbtree: add rb_find_add_cached() to rbtree.h
btrfs: update btrfs_add_block_group_cache() to use rb helper
btrfs: update prelim_ref_insert() to use rb helpers
btrfs: update __btrfs_add_delayed_item() to use rb helper
btrfs: update btrfs_add_chunk_map() to use rb helpers
btrfs: update tree_insert() to use rb helpers
fs/btrfs/backref.c | 79 ++++++++++++++++++++-------------------- fs/btrfs/block-group.c | 46 +++++++++++------------ fs/btrfs/delayed-inode.c | 43 ++++++++++------------ fs/btrfs/delayed-ref.c | 45 +++++++++-------------- fs/btrfs/volumes.c | 41 +++++++++++---------- include/linux/rbtree.h | 37 +++++++++++++++++++ 6 files changed, 156 insertions(+), 135 deletions(-)
Signature · 1 line
2.47.1