Commit 0506d32f authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Carlos Maiolino
Browse files

xfs: use bio_reuse in the zone GC code



Replace our somewhat fragile code to reuse the bio, which caused a
regression in the past with the block layer bio_reuse helper.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarHans Holmberg <hans.holmberg@wdc.com>
Reviewed-by: default avatarCarlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
parent 7ca44303
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -811,8 +811,6 @@ xfs_zone_gc_write_chunk(
{
	struct xfs_zone_gc_data	*data = chunk->data;
	struct xfs_mount	*mp = chunk->ip->i_mount;
	phys_addr_t		bvec_paddr =
		bvec_phys(bio_first_bvec_all(&chunk->bio));
	struct xfs_gc_bio	*split_chunk;

	if (chunk->bio.bi_status)
@@ -825,10 +823,7 @@ xfs_zone_gc_write_chunk(
	WRITE_ONCE(chunk->state, XFS_GC_BIO_NEW);
	list_move_tail(&chunk->entry, &data->writing);

	bio_reset(&chunk->bio, mp->m_rtdev_targp->bt_bdev, REQ_OP_WRITE);
	bio_add_folio_nofail(&chunk->bio, chunk->scratch->folio, chunk->len,
			offset_in_folio(chunk->scratch->folio, bvec_paddr));

	bio_reuse(&chunk->bio, REQ_OP_WRITE);
	while ((split_chunk = xfs_zone_gc_split_write(data, chunk)))
		xfs_zone_gc_submit_write(data, split_chunk);
	xfs_zone_gc_submit_write(data, chunk);