summaryrefslogtreecommitdiff
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2015-05-29 13:11:32 -0600
committerJens Axboe <axboe@fb.com>2015-05-29 13:11:32 -0600
commite548ca4ee4595f65b262661d166310ad8a149bec (patch)
treef95e59f4a7694ba9e0a6a866da4e978c0c958c71 /include/linux/blkdev.h
parentbeefa6ba7bf304d3de3a02cb7366fb0a7d6b27ab (diff)
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: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 9ded80da2c16..ccaa9aecd593 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -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))
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 min(blk_max_size_offset(q, blk_rq_pos(rq)),