aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-lib.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-04-05 13:21:23 -0400
committerJens Axboe <axboe@fb.com>2017-04-08 13:25:38 -0400
commit48920ff2a5a940cd07d12cc79e4a2c75f1185aee (patch)
tree0505a85fce20a0d34c5d4bbc71ba8771a037e209 /block/blk-lib.c
parent45c21793a6601b29926d67f7a07fe4077a45072e (diff)
block: remove the discard_zeroes_data flag
Now that we use the proper REQ_OP_WRITE_ZEROES operation everywhere we can kill this hack. 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 'block/blk-lib.c')
-rw-r--r--block/blk-lib.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/block/blk-lib.c b/block/blk-lib.c
index b0c6c4bcf441..e8caecd71688 100644
--- a/block/blk-lib.c
+++ b/block/blk-lib.c
@@ -37,17 +37,12 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector,
37 return -ENXIO; 37 return -ENXIO;
38 38
39 if (flags & BLKDEV_DISCARD_SECURE) { 39 if (flags & BLKDEV_DISCARD_SECURE) {
40 if (flags & BLKDEV_DISCARD_ZERO)
41 return -EOPNOTSUPP;
42 if (!blk_queue_secure_erase(q)) 40 if (!blk_queue_secure_erase(q))
43 return -EOPNOTSUPP; 41 return -EOPNOTSUPP;
44 op = REQ_OP_SECURE_ERASE; 42 op = REQ_OP_SECURE_ERASE;
45 } else { 43 } else {
46 if (!blk_queue_discard(q)) 44 if (!blk_queue_discard(q))
47 return -EOPNOTSUPP; 45 return -EOPNOTSUPP;
48 if ((flags & BLKDEV_DISCARD_ZERO) &&
49 !q->limits.discard_zeroes_data)
50 return -EOPNOTSUPP;
51 op = REQ_OP_DISCARD; 46 op = REQ_OP_DISCARD;
52 } 47 }
53 48
@@ -126,7 +121,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
126 &bio); 121 &bio);
127 if (!ret && bio) { 122 if (!ret && bio) {
128 ret = submit_bio_wait(bio); 123 ret = submit_bio_wait(bio);
129 if (ret == -EOPNOTSUPP && !(flags & BLKDEV_DISCARD_ZERO)) 124 if (ret == -EOPNOTSUPP)
130 ret = 0; 125 ret = 0;
131 bio_put(bio); 126 bio_put(bio);
132 } 127 }