From: Johannes Thumshirn <jth@kernel.org>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>,
Damien Le Moal <dlemoal@kernel.org>,
Filipe Manana <fdmanana@suse.com>,
Naohiro Aota <naohiro.aota@wdc.com>,
Josef Bacik <josef@toxicpanda.com>,
Johannes Thumshirn <johannes.thumshirn@wdc.com>
Subject: [PATCH v2 1/2] btrfs: directly call do_zone_finish() from btrfs_zone_finish_endio_workfn()
Date: Tue, 22 Jul 2025 11:39:14 +0200 [thread overview]
Message-ID: <20250722093915.13214-2-jth@kernel.org> (raw)
In-Reply-To: <20250722093915.13214-1-jth@kernel.org>
From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
When btrfs_zone_finish_endio_workfn() is calling btrfs_zone_finish_endio()
it already has a pointer to the block group. Furthermore
btrfs_zone_finish_endio() does additional checks if the block group can be
finished or not.
But in the context of btrfs_zone_finish_endio_workfn() only the actual
call to do_zone_finish() is of interest, as the skipping condition when
there is still room to allocate from the block group cannot be checked.
Directly call do_zone_finish() on the block group.
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
fs/btrfs/zoned.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 245e813ecd78..5a234f31c8da 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -2461,12 +2461,14 @@ void btrfs_zone_finish_endio(struct btrfs_fs_info *fs_info, u64 logical, u64 len
static void btrfs_zone_finish_endio_workfn(struct work_struct *work)
{
+ int ret;
struct btrfs_block_group *bg =
container_of(work, struct btrfs_block_group, zone_finish_work);
wait_on_extent_buffer_writeback(bg->last_eb);
free_extent_buffer(bg->last_eb);
- btrfs_zone_finish_endio(bg->fs_info, bg->start, bg->length);
+ ret = do_zone_finish(bg, true);
+ ASSERT(!ret);
btrfs_put_block_group(bg);
}
--
2.50.1
next prev parent reply other threads:[~2025-07-22 9:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-22 9:39 [PATCH v2 0/2] btrfs: zoned: two small style improvements for zone finishing Johannes Thumshirn
2025-07-22 9:39 ` Johannes Thumshirn [this message]
2025-07-22 9:42 ` [PATCH v2 1/2] btrfs: directly call do_zone_finish() from btrfs_zone_finish_endio_workfn() Damien Le Moal
2025-07-22 10:21 ` Johannes Thumshirn
2025-07-22 9:39 ` [PATCH v2 2/2] btrfs: zoned: return error from btrfs_zone_finish_endio() Johannes Thumshirn
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=20250722093915.13214-2-jth@kernel.org \
--to=jth@kernel.org \
--cc=dlemoal@kernel.org \
--cc=dsterba@suse.com \
--cc=fdmanana@suse.com \
--cc=johannes.thumshirn@wdc.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=naohiro.aota@wdc.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.