aboutsummaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorMike Snitzer2022-04-15 03:04:59 -0400
committerMike Snitzer2022-05-05 17:31:35 -0400
commitbdb34759a0dbc89c134c60d282b5f100bed1365f (patch)
treee7016545256b889fa00a60c276aa09657972c0e2 /drivers/md
parente86f2b005a51437d2887eec5ee659d0287d370ad (diff)
dm: use bio_sectors in dm_aceept_partial_bio
Rename 'bi_size' to 'bio_sectors' given bi_size is being stored in sectors. Also, use bio_sectors() rather than open-coding it. Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 6304322a48f0..69535e021c92 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1194,7 +1194,7 @@ static int dm_dax_zero_page_range(struct dax_device *dax_dev, pgoff_t pgoff,
* +--------------------+---------------+-------+
*
* <-------------- *tio->len_ptr --------------->
- * <------- bi_size ------->
+ * <----- bio_sectors ----->
* <-- n_sectors -->
*
* Region 1 was already iterated over with bio_advance or similar function.
@@ -1211,15 +1211,15 @@ static int dm_dax_zero_page_range(struct dax_device *dax_dev, pgoff_t pgoff,
void dm_accept_partial_bio(struct bio *bio, unsigned n_sectors)
{
struct dm_target_io *tio = clone_to_tio(bio);
- unsigned bi_size = bio->bi_iter.bi_size >> SECTOR_SHIFT;
+ unsigned bio_sectors = bio_sectors(bio);
BUG_ON(dm_tio_flagged(tio, DM_TIO_IS_DUPLICATE_BIO));
BUG_ON(op_is_zone_mgmt(bio_op(bio)));
BUG_ON(bio_op(bio) == REQ_OP_ZONE_APPEND);
- BUG_ON(bi_size > *tio->len_ptr);
- BUG_ON(n_sectors > bi_size);
+ BUG_ON(bio_sectors > *tio->len_ptr);
+ BUG_ON(n_sectors > bio_sectors);
- *tio->len_ptr -= bi_size - n_sectors;
+ *tio->len_ptr -= bio_sectors - n_sectors;
bio->bi_iter.bi_size = n_sectors << SECTOR_SHIFT;
}
EXPORT_SYMBOL_GPL(dm_accept_partial_bio);