Skip to content

Commit b30935f

Browse files
Christoph Hellwigkawasaki
authored andcommitted
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: Christoph Hellwig <[email protected]> Reviewed-by: Hans Holmberg <[email protected]> Reviewed-by: Carlos Maiolino <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: "Darrick J. Wong" <[email protected]>
1 parent 14b06a2 commit b30935f

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

fs/xfs/xfs_zone_gc.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -811,8 +811,6 @@ xfs_zone_gc_write_chunk(
811811
{
812812
struct xfs_zone_gc_data *data = chunk->data;
813813
struct xfs_mount *mp = chunk->ip->i_mount;
814-
phys_addr_t bvec_paddr =
815-
bvec_phys(bio_first_bvec_all(&chunk->bio));
816814
struct xfs_gc_bio *split_chunk;
817815

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

828-
bio_reset(&chunk->bio, mp->m_rtdev_targp->bt_bdev, REQ_OP_WRITE);
829-
bio_add_folio_nofail(&chunk->bio, chunk->scratch->folio, chunk->len,
830-
offset_in_folio(chunk->scratch->folio, bvec_paddr));
831-
826+
bio_reuse(&chunk->bio, REQ_OP_WRITE);
832827
while ((split_chunk = xfs_zone_gc_split_write(data, chunk)))
833828
xfs_zone_gc_submit_write(data, split_chunk);
834829
xfs_zone_gc_submit_write(data, chunk);

0 commit comments

Comments
 (0)