From: Damien Le Moal <dlemoal@kernel.org>
To: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Subject: [PATCH v2 3/7] block: remove disk_zone_is_full()
Date: Thu, 26 Feb 2026 13:10:20 +0900 [thread overview]
Message-ID: <20260226041024.2154806-4-dlemoal@kernel.org> (raw)
In-Reply-To: <20260226041024.2154806-1-dlemoal@kernel.org>
The helper function disk_zone_is_full() is only used in
disk_zone_wplug_is_full(). So remove it and open code it directly in
this single caller.
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
block/blk-zoned.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 3f66e7ae699c..12829e14fcda 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -492,18 +492,12 @@ static bool disk_zone_is_last(struct gendisk *disk, struct blk_zone *zone)
return zone->start + zone->len >= get_capacity(disk);
}
-static bool disk_zone_is_full(struct gendisk *disk,
- unsigned int zno, unsigned int offset_in_zone)
-{
- if (zno < disk->nr_zones - 1)
- return offset_in_zone >= disk->zone_capacity;
- return offset_in_zone >= disk->last_zone_capacity;
-}
-
static bool disk_zone_wplug_is_full(struct gendisk *disk,
struct blk_zone_wplug *zwplug)
{
- return disk_zone_is_full(disk, zwplug->zone_no, zwplug->wp_offset);
+ if (zwplug->zone_no < disk->nr_zones - 1)
+ return zwplug->wp_offset >= disk->zone_capacity;
+ return zwplug->wp_offset >= disk->last_zone_capacity;
}
static bool disk_insert_zone_wplug(struct gendisk *disk,
--
2.53.0
next prev parent reply other threads:[~2026-02-26 4:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 4:10 [PATCH v2 0/7] Improve zoned (SMR) HDD write throughput Damien Le Moal
2026-02-26 4:10 ` [PATCH v2 1/7] block: fix zone write plug removal Damien Le Moal
2026-02-26 16:10 ` Christoph Hellwig
2026-02-26 22:44 ` Damien Le Moal
2026-02-26 4:10 ` [PATCH v2 2/7] block: fix zone write plugs refcount handling in disk_zone_wplug_schedule_bio_work() Damien Le Moal
2026-02-26 16:11 ` Christoph Hellwig
2026-02-27 7:12 ` Johannes Thumshirn
2026-02-26 4:10 ` Damien Le Moal [this message]
2026-02-26 16:11 ` [PATCH v2 3/7] block: remove disk_zone_is_full() Christoph Hellwig
2026-02-26 4:10 ` [PATCH v2 4/7] block: rename struct gendisk zone_wplugs_lock field Damien Le Moal
2026-02-26 16:12 ` Christoph Hellwig
2026-02-26 4:10 ` [PATCH v2 5/7] block: allow submitting all zone writes from a single context Damien Le Moal
2026-02-26 16:16 ` Christoph Hellwig
2026-02-26 4:10 ` [PATCH v2 6/7] block: default to QD=1 writes for blk-mq rotational zoned devices Damien Le Moal
2026-02-26 16:16 ` Christoph Hellwig
2026-02-26 4:10 ` [PATCH v2 7/7] Documentation: ABI: stable: document the zoned_qd1_writes attribute Damien Le Moal
2026-02-26 16:17 ` Christoph Hellwig
2026-02-26 22:17 ` [PATCH v2 0/7] Improve zoned (SMR) HDD write throughput Bart Van Assche
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=20260226041024.2154806-4-dlemoal@kernel.org \
--to=dlemoal@kernel.org \
--cc=axboe@kernel.dk \
--cc=linux-block@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