From: Shida Zhang Replace duplicate bio chaining logic with the common bio_chain_and_submit helper function. Signed-off-by: Shida Zhang --- fs/xfs/xfs_bio_io.c | 3 +-- fs/xfs/xfs_buf.c | 3 +-- fs/xfs/xfs_log.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/xfs/xfs_bio_io.c b/fs/xfs/xfs_bio_io.c index 2a736d10eaf..4a6577b0789 100644 --- a/fs/xfs/xfs_bio_io.c +++ b/fs/xfs/xfs_bio_io.c @@ -38,8 +38,7 @@ xfs_rw_bdev( bio_max_vecs(count - done), prev->bi_opf, GFP_KERNEL); bio->bi_iter.bi_sector = bio_end_sector(prev); - bio_chain(prev, bio); - submit_bio(prev); + bio_chain_and_submit(prev, bio); } done += added; } while (done < count); diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 773d959965d..c26bd28edb4 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -1357,8 +1357,7 @@ xfs_buf_submit_bio( split = bio_split(bio, bp->b_maps[map].bm_len, GFP_NOFS, &fs_bio_set); split->bi_iter.bi_sector = bp->b_maps[map].bm_bn; - bio_chain(split, bio); - submit_bio(split); + bio_chain_and_submit(split, bio); } bio->bi_iter.bi_sector = bp->b_maps[map].bm_bn; submit_bio(bio); diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 603e85c1ab4..f4c9ad1d148 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -1687,8 +1687,7 @@ xlog_write_iclog( split = bio_split(&iclog->ic_bio, log->l_logBBsize - bno, GFP_NOIO, &fs_bio_set); - bio_chain(split, &iclog->ic_bio); - submit_bio(split); + bio_chain_and_submit(split, &iclog->ic_bio); /* restart at logical offset zero for the remainder */ iclog->ic_bio.bi_iter.bi_sector = log->l_logBBstart; -- 2.34.1