From: George Hu <integral@archlinux.org>
To: Carlos Maiolino <cem@kernel.org>
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
George Hu <integral@archlinux.org>
Subject: [PATCH] xfs: replace min & max with clamp() in xfs_max_open_zones()
Date: Sat, 12 Jul 2025 22:57:41 +0800 [thread overview]
Message-ID: <20250712145741.41433-1-integral@archlinux.org> (raw)
Refactor the xfs_max_open_zones() function by replacing the usage
of min() and max() macro with clamp() to simplify the code and
improve readability.
Signed-off-by: George Hu <integral@archlinux.org>
---
fs/xfs/xfs_zone_alloc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/xfs/xfs_zone_alloc.c b/fs/xfs/xfs_zone_alloc.c
index 01315ed75502..58997afb1a14 100644
--- a/fs/xfs/xfs_zone_alloc.c
+++ b/fs/xfs/xfs_zone_alloc.c
@@ -1133,9 +1133,7 @@ xfs_max_open_zones(
/*
* Cap the max open limit to 1/4 of available space
*/
- max_open = min(max_open, mp->m_sb.sb_rgcount / 4);
-
- return max(XFS_MIN_OPEN_ZONES, max_open);
+ return clamp(max_open, XFS_MIN_OPEN_ZONES, mp->m_sb.sb_rgcount / 4);
}
/*
--
2.50.0
next reply other threads:[~2025-07-12 14:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-12 14:57 George Hu [this message]
2025-07-14 5:55 ` Christoph Hellwig
2025-07-14 7:58 ` John Garry
2025-07-14 10:59 ` Christoph Hellwig
2025-07-15 9:49 ` Carlos Maiolino
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=20250712145741.41433-1-integral@archlinux.org \
--to=integral@archlinux.org \
--cc=cem@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@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
all inboxes | Powered by JetHome®