diff options
author | Christoph Hellwig <hch@lst.de> | 2017-04-05 19:21:05 +0200 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-04-08 19:25:38 +0200 |
commit | ac62d6208a7977107a47be4eb8566d6e5034b5f5 (patch) | |
tree | cac7e46e26b67193cefb333d9aad2f8e87ecfee7 /drivers/md/dm-rq.c | |
parent | dm io: discards don't take a payload (diff) | |
download | linux-ac62d6208a7977107a47be4eb8566d6e5034b5f5.tar.xz linux-ac62d6208a7977107a47be4eb8566d6e5034b5f5.zip |
dm: support REQ_OP_WRITE_ZEROES
Copy & paste from the REQ_OP_WRITE_SAME code.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/md/dm-rq.c')
-rw-r--r-- | drivers/md/dm-rq.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c index d19af1d21f4c..e60f1b6845be 100644 --- a/drivers/md/dm-rq.c +++ b/drivers/md/dm-rq.c @@ -298,9 +298,14 @@ static void dm_done(struct request *clone, int error, bool mapped) r = rq_end_io(tio->ti, clone, error, &tio->info); } - if (unlikely(r == -EREMOTEIO && (req_op(clone) == REQ_OP_WRITE_SAME) && - !clone->q->limits.max_write_same_sectors)) - disable_write_same(tio->md); + if (unlikely(r == -EREMOTEIO)) { + if (req_op(clone) == REQ_OP_WRITE_SAME && + !clone->q->limits.max_write_same_sectors) + disable_write_same(tio->md); + if (req_op(clone) == REQ_OP_WRITE_ZEROES && + !clone->q->limits.max_write_zeroes_sectors) + disable_write_zeroes(tio->md); + } if (r <= 0) /* The target wants to complete the I/O */ |