summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2026-04-07 17:05:28 +0300
committerJens Axboe <axboe@kernel.dk>2026-04-07 17:22:24 +0300
commit2d148a214b24b4a2525f649cced0c3e9e57281cd (patch)
tree2bed2974b34c50a3120cb1925445e9a6ede0bf7e
parent92c3737a2473ff5b83f90f5c1b353a27492a10f2 (diff)
downloadlinux-2d148a214b24b4a2525f649cced0c3e9e57281cd.tar.xz
xfs: use bio_await in xfs_zone_gc_reset_sync
Replace the open-coded bio wait logic with the new bio_await helper. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Link: https://patch.msgid.link/20260407140538.633364-6-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--fs/xfs/xfs_zone_gc.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/fs/xfs/xfs_zone_gc.c b/fs/xfs/xfs_zone_gc.c
index f279dcca53cc..441b99727bbc 100644
--- a/fs/xfs/xfs_zone_gc.c
+++ b/fs/xfs/xfs_zone_gc.c
@@ -902,9 +902,10 @@ out:
static void
xfs_submit_zone_reset_bio(
- struct xfs_rtgroup *rtg,
- struct bio *bio)
+ struct bio *bio,
+ void *priv)
{
+ struct xfs_rtgroup *rtg = priv;
struct xfs_mount *mp = rtg_mount(rtg);
trace_xfs_zone_reset(rtg);
@@ -936,26 +937,16 @@ xfs_submit_zone_reset_bio(
submit_bio(bio);
}
-static void xfs_bio_wait_endio(struct bio *bio)
-{
- complete(bio->bi_private);
-}
-
int
xfs_zone_gc_reset_sync(
struct xfs_rtgroup *rtg)
{
- DECLARE_COMPLETION_ONSTACK(done);
struct bio bio;
int error;
bio_init(&bio, rtg_mount(rtg)->m_rtdev_targp->bt_bdev, NULL, 0,
REQ_OP_ZONE_RESET | REQ_SYNC);
- bio.bi_private = &done;
- bio.bi_end_io = xfs_bio_wait_endio;
- xfs_submit_zone_reset_bio(rtg, &bio);
- wait_for_completion_io(&done);
-
+ bio_await(&bio, rtg, xfs_submit_zone_reset_bio);
error = blk_status_to_errno(bio.bi_status);
bio_uninit(&bio);
return error;
@@ -992,7 +983,7 @@ xfs_zone_gc_reset_zones(
chunk->data = data;
WRITE_ONCE(chunk->state, XFS_GC_BIO_NEW);
list_add_tail(&chunk->entry, &data->resetting);
- xfs_submit_zone_reset_bio(rtg, bio);
+ xfs_submit_zone_reset_bio(bio, rtg);
} while (next);
}