diff options
author | Jens Axboe <axboe@kernel.dk> | 2018-02-01 20:27:02 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-02-01 20:27:02 -0700 |
commit | 3c15f3f545afa320c5e3822825a9a53c664776b6 (patch) | |
tree | c6e0a7d7299e8012c2bf77e396aae40455d77d13 /block/blk-core.c | |
parent | 4bf772b14675411a69b3c807f73006de0fe4b649 (diff) | |
parent | bea99a500773fdfdb16b7dbfbaa00af7a6f0dc3b (diff) |
Merge branch 'for-linus' into test
* for-linus:
blk-mq-sched: Enable merging discard bio into request
blk-mq: fix discard merge with scheduler attached
blk-mq: introduce BLK_STS_DEV_RESOURCE
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index a2005a485335..d0d104268f1a 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -145,6 +145,7 @@ static const struct { [BLK_STS_MEDIUM] = { -ENODATA, "critical medium" }, [BLK_STS_PROTECTION] = { -EILSEQ, "protection" }, [BLK_STS_RESOURCE] = { -ENOMEM, "kernel resource" }, + [BLK_STS_DEV_RESOURCE] = { -EBUSY, "device resource" }, [BLK_STS_AGAIN] = { -EAGAIN, "nonblocking retry" }, /* device mapper special case, should not leak out: */ @@ -3282,6 +3283,8 @@ void blk_rq_bio_prep(struct request_queue *q, struct request *rq, { if (bio_has_data(bio)) rq->nr_phys_segments = bio_phys_segments(q, bio); + else if (bio_op(bio) == REQ_OP_DISCARD) + rq->nr_phys_segments = 1; rq->__data_len = bio->bi_iter.bi_size; rq->bio = rq->biotail = bio; |