From: Sun YangKai <sunk67188@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: Sun YangKai <sunk67188@gmail.com>
Subject: [PATCH 0/2] btrfs: use true/false and simplify boolean parameters in btrfs_{inc,dec}_ref
Date: Thu, 20 Nov 2025 22:19:12 +0800 [thread overview]
Message-ID: <20251120141948.5323-1-sunk67188@gmail.com> (raw)
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.
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 | 33 +++++++++++----------------------
fs/btrfs/extent-tree.c | 21 +++++++--------------
2 files changed, 18 insertions(+), 36 deletions(-)
--
2.51.2
next reply other threads:[~2025-11-20 14:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-20 14:19 Sun YangKai [this message]
2025-11-20 14:19 ` [PATCH 1/2] btrfs: use true/false for boolean parameters in btrfs_{inc,dec}_ref Sun YangKai
2025-11-21 6:59 ` Johannes Thumshirn
2025-11-20 14:19 ` [PATCH 2/2] btrfs: simplify boolean argument for btrfs_{inc,dec}_ref Sun YangKai
2025-11-20 19:02 ` David Sterba
2025-11-21 3:17 ` Sun Yangkai
2025-11-21 6:58 ` Johannes Thumshirn
2025-11-21 14:47 ` David Sterba
2025-11-21 7:21 ` Daniel Vacek
2025-11-20 19:00 ` [PATCH 0/2] btrfs: use true/false and simplify boolean parameters in btrfs_{inc,dec}_ref Boris Burkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251120141948.5323-1-sunk67188@gmail.com \
--to=sunk67188@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox