@@ -224,7 +224,7 @@ static int __blkdev_issue_write_zeroes(struct block_device *bdev,
return -EPERM;
/* Ensure that max_write_zeroes_sectors doesn't overflow bi_size */
- max_write_zeroes_sectors = bdev_write_zeroes_sectors(bdev);
+ max_write_zeroes_sectors = bdev_write_zeroes_sectors(bdev, 0);
if (max_write_zeroes_sectors == 0)
return -EOPNOTSUPP;
@@ -362,7 +362,7 @@ int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
sector_t bs_mask;
struct bio *bio;
struct blk_plug plug;
- bool try_write_zeroes = !!bdev_write_zeroes_sectors(bdev);
+ bool try_write_zeroes = !!bdev_write_zeroes_sectors(bdev, 0);
bs_mask = (bdev_logical_block_size(bdev) >> 9) - 1;
if ((sector | nr_sects) & bs_mask)
@@ -391,7 +391,7 @@ int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
try_write_zeroes = false;
goto retry;
}
- if (!bdev_write_zeroes_sectors(bdev)) {
+ if (!bdev_write_zeroes_sectors(bdev, 0)) {
/*
* Zeroing offload support was indicated, but the
* device reported ILLEGAL REQUEST (for some devices
@@ -831,7 +831,7 @@ void dm_kcopyd_copy(struct dm_kcopyd_client *kc, struct dm_io_region *from,
*/
job->rw = REQ_OP_WRITE_ZEROES;
for (i = 0; i < job->num_dests; i++)
- if (!bdev_write_zeroes_sectors(job->dests[i].bdev)) {
+ if (!bdev_write_zeroes_sectors(job->dests[i].bdev, 0)) {
job->rw = WRITE;
break;
}
@@ -117,7 +117,7 @@ static int iblock_configure_device(struct se_device *dev)
* Enable write same emulation for IBLOCK and use 0xFFFF as
* the smaller WRITE_SAME(10) only has a two-byte block count.
*/
- max_write_zeroes_sectors = bdev_write_zeroes_sectors(bd);
+ max_write_zeroes_sectors = bdev_write_zeroes_sectors(bd, 0);
if (max_write_zeroes_sectors)
dev->dev_attrib.max_write_same_len = max_write_zeroes_sectors;
else
@@ -468,7 +468,7 @@ iblock_execute_write_same(struct se_cmd *cmd)
return TCM_INVALID_CDB_FIELD;
}
- if (bdev_write_zeroes_sectors(bdev)) {
+ if (bdev_write_zeroes_sectors(bdev, 0)) {
if (!iblock_execute_zero_out(bdev, cmd))
return 0;
}
@@ -1418,7 +1418,8 @@ static inline unsigned int bdev_write_same(struct block_device *bdev)
return 0;
}
-static inline unsigned int bdev_write_zeroes_sectors(struct block_device *bdev)
+static inline unsigned int bdev_write_zeroes_sectors(struct block_device *bdev,
+ unsigned int flags)
{
struct request_queue *q = bdev_get_queue(bdev);