summaryrefslogtreecommitdiff
path: root/drivers/block/drbd/drbd_receiver.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-04-05 20:21:08 +0300
committerJens Axboe <axboe@fb.com>2017-04-08 20:25:38 +0300
commitee472d835c264a4cb77f8cf878603e1e40f3559e (patch)
tree923d051ac77e50e2871eefc7c6f7da43da3538c9 /drivers/block/drbd/drbd_receiver.c
parentc20cfc27a47307e811346f85959cf3cc07ae42f9 (diff)
downloadlinux-ee472d835c264a4cb77f8cf878603e1e40f3559e.tar.xz
block: add a flags argument to (__)blkdev_issue_zeroout
Turn the existing discard flag into a new BLKDEV_ZERO_UNMAP flag with similar semantics, but without referring to diѕcard. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block/drbd/drbd_receiver.c')
-rw-r--r--drivers/block/drbd/drbd_receiver.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index aa6bf9692eff..dc9a6dcd431c 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -1499,19 +1499,22 @@ int drbd_issue_discard_or_zero_out(struct drbd_device *device, sector_t start, u
tmp = start + granularity - sector_div(tmp, granularity);
nr = tmp - start;
- err |= blkdev_issue_zeroout(bdev, start, nr, GFP_NOIO, 0);
+ err |= blkdev_issue_zeroout(bdev, start, nr, GFP_NOIO,
+ BLKDEV_ZERO_NOUNMAP);
nr_sectors -= nr;
start = tmp;
}
while (nr_sectors >= granularity) {
nr = min_t(sector_t, nr_sectors, max_discard_sectors);
- err |= blkdev_issue_discard(bdev, start, nr, GFP_NOIO, 0);
+ err |= blkdev_issue_discard(bdev, start, nr, GFP_NOIO,
+ BLKDEV_ZERO_NOUNMAP);
nr_sectors -= nr;
start += nr;
}
zero_out:
if (nr_sectors) {
- err |= blkdev_issue_zeroout(bdev, start, nr_sectors, GFP_NOIO, 0);
+ err |= blkdev_issue_zeroout(bdev, start, nr_sectors, GFP_NOIO,
+ BLKDEV_ZERO_NOUNMAP);
}
return err != 0;
}