Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Christoph Hellwig and committed by
Jens Axboe
2d148a21 92c3737a

+5 -14
+5 -14
fs/xfs/xfs_zone_gc.c
··· 902 902 903 903 static void 904 904 xfs_submit_zone_reset_bio( 905 - struct xfs_rtgroup *rtg, 906 - struct bio *bio) 905 + struct bio *bio, 906 + void *priv) 907 907 { 908 + struct xfs_rtgroup *rtg = priv; 908 909 struct xfs_mount *mp = rtg_mount(rtg); 909 910 910 911 trace_xfs_zone_reset(rtg); ··· 937 936 submit_bio(bio); 938 937 } 939 938 940 - static void xfs_bio_wait_endio(struct bio *bio) 941 - { 942 - complete(bio->bi_private); 943 - } 944 - 945 939 int 946 940 xfs_zone_gc_reset_sync( 947 941 struct xfs_rtgroup *rtg) 948 942 { 949 - DECLARE_COMPLETION_ONSTACK(done); 950 943 struct bio bio; 951 944 int error; 952 945 953 946 bio_init(&bio, rtg_mount(rtg)->m_rtdev_targp->bt_bdev, NULL, 0, 954 947 REQ_OP_ZONE_RESET | REQ_SYNC); 955 - bio.bi_private = &done; 956 - bio.bi_end_io = xfs_bio_wait_endio; 957 - xfs_submit_zone_reset_bio(rtg, &bio); 958 - wait_for_completion_io(&done); 959 - 948 + bio_await(&bio, rtg, xfs_submit_zone_reset_bio); 960 949 error = blk_status_to_errno(bio.bi_status); 961 950 bio_uninit(&bio); 962 951 return error; ··· 983 992 chunk->data = data; 984 993 WRITE_ONCE(chunk->state, XFS_GC_BIO_NEW); 985 994 list_add_tail(&chunk->entry, &data->resetting); 986 - xfs_submit_zone_reset_bio(rtg, bio); 995 + xfs_submit_zone_reset_bio(bio, rtg); 987 996 } while (next); 988 997 } 989 998