Commit e548ca4e authored by Jens Axboe's avatar Jens Axboe

block: don't honor chunk sizes for data-less IO

We don't need to honor chunk sizes for IO that doesn't carry any
data.
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent beefa6ba
...@@ -903,7 +903,7 @@ static inline unsigned int blk_rq_get_max_sectors(struct request *rq) ...@@ -903,7 +903,7 @@ static inline unsigned int blk_rq_get_max_sectors(struct request *rq)
if (unlikely(rq->cmd_type == REQ_TYPE_BLOCK_PC)) if (unlikely(rq->cmd_type == REQ_TYPE_BLOCK_PC))
return q->limits.max_hw_sectors; return q->limits.max_hw_sectors;
if (!q->limits.chunk_sectors) if (!q->limits.chunk_sectors || (rq->cmd_flags & REQ_DISCARD))
return blk_queue_get_max_sectors(q, rq->cmd_flags); return blk_queue_get_max_sectors(q, rq->cmd_flags);
return min(blk_max_size_offset(q, blk_rq_pos(rq)), return min(blk_max_size_offset(q, blk_rq_pos(rq)),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment