@@ -82,7 +82,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
break;
}
- req_sects = min_t(sector_t, nr_sects, MAX_BIO_SECTORS);
+ req_sects = min_t(sector_t, nr_sects, UINT_MAX>>9);
end_sect = sector + req_sects;
bio->bi_iter.bi_sector = sector;
@@ -270,9 +270,12 @@ static int stripe_map_range(struct stripe_c *sc, struct bio *bio,
bio->bi_iter.bi_sector = begin +
sc->stripe[target_stripe].physical_start;
bio->bi_iter.bi_size = to_bytes(end - begin);
+ printk("DEBUG: stripe %d, discard sector [%ld, %ld]\n", target_stripe,
+ bio->bi_iter.bi_sector, (bio->bi_iter.bi_sector + (bio->bi_iter.bi_size>>9) - 1));
return DM_MAPIO_REMAPPED;
} else {
/* The range doesn't map to the target stripe */
+ printk("DEBUG: stripe %d, discard ignored\n", target_stripe);
bio_endio(bio);
return DM_MAPIO_SUBMITTED;
}