btrfs: use true/false and simplify boolean parameters in btrfs_{inc,dec}_ref
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 5 repliesIn review
- v12 patches 7 repliesSuperseded
Changes in v2 from the cover letter
- Introduce local variable for the conditions in patch 2, suggested by Boris
- Merge the non-zero ret handling blocks in btrfs_copy_root()
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | btrfs: use true/false for boolean parameters in btrfs_{inc,dec}_reffs/ fs/ | +14 | 2 replies | |
| 2/2 | btrfs: simplify boolean argument for btrfs_{inc,dec}_reffs/ fs/ | +17 | 2 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/2] btrfs: use true/false and simplify boolean parameters in btrfs_{inc,dec}_ref
This tiny series removes the last 0/1 integer literals passed to btrfs_inc_ref() / btrfs_dec_ref() and replaces the open-coded if/else blocks with concise boolean expressions.
Patch 1 switches the callsites to the self-documenting true/false constants, eliminating the implicit bool <-> int mixing.
Patch 2 folds the remaining if/else ladders into a single line using the condition directly, which shrinks the code and makes the intent obvious.
No functional change.
[Changelog]
v2:
- Introduce local variable for the conditions in patch 2, suggested by Boris
- Merge the non-zero ret handling blocks in btrfs_copy_root()
Sun YangKai (2):
btrfs: use true/false for boolean parameters in btrfs_{inc,dec}_ref
btrfs: simplify boolean argument for btrfs_{inc,dec}_ref
fs/btrfs/ctree.c | 46 +++++++++++++++--------------------------- fs/btrfs/extent-tree.c | 21 +++++++------------ 2 files changed, 23 insertions(+), 44 deletions(-)
Signature · 1 line
2.51.2