diff options
Diffstat (limited to 'block/blk-settings.c')
-rw-r--r-- | block/blk-settings.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/block/blk-settings.c b/block/blk-settings.c index 5d21239bc859..a2b9cb195e70 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c | |||
@@ -113,6 +113,7 @@ void blk_set_default_limits(struct queue_limits *lim) | |||
113 | lim->seg_boundary_mask = BLK_SEG_BOUNDARY_MASK; | 113 | lim->seg_boundary_mask = BLK_SEG_BOUNDARY_MASK; |
114 | lim->max_segment_size = BLK_MAX_SEGMENT_SIZE; | 114 | lim->max_segment_size = BLK_MAX_SEGMENT_SIZE; |
115 | lim->max_sectors = lim->max_hw_sectors = BLK_SAFE_MAX_SECTORS; | 115 | lim->max_sectors = lim->max_hw_sectors = BLK_SAFE_MAX_SECTORS; |
116 | lim->chunk_sectors = 0; | ||
116 | lim->max_write_same_sectors = 0; | 117 | lim->max_write_same_sectors = 0; |
117 | lim->max_discard_sectors = 0; | 118 | lim->max_discard_sectors = 0; |
118 | lim->discard_granularity = 0; | 119 | lim->discard_granularity = 0; |
@@ -277,6 +278,23 @@ void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_hw_secto | |||
277 | EXPORT_SYMBOL(blk_queue_max_hw_sectors); | 278 | EXPORT_SYMBOL(blk_queue_max_hw_sectors); |
278 | 279 | ||
279 | /** | 280 | /** |
281 | * blk_queue_chunk_sectors - set size of the chunk for this queue | ||
282 | * @q: the request queue for the device | ||
283 | * @chunk_sectors: chunk sectors in the usual 512b unit | ||
284 | * | ||
285 | * Description: | ||
286 | * If a driver doesn't want IOs to cross a given chunk size, it can set | ||
287 | * this limit and prevent merging across chunks. Note that the chunk size | ||
288 | * must currently be a power-of-2 in sectors. | ||
289 | **/ | ||
290 | void blk_queue_chunk_sectors(struct request_queue *q, unsigned int chunk_sectors) | ||
291 | { | ||
292 | BUG_ON(!is_power_of_2(chunk_sectors)); | ||
293 | q->limits.chunk_sectors = chunk_sectors; | ||
294 | } | ||
295 | EXPORT_SYMBOL(blk_queue_chunk_sectors); | ||
296 | |||
297 | /** | ||
280 | * blk_queue_max_discard_sectors - set max sectors for a single discard | 298 | * blk_queue_max_discard_sectors - set max sectors for a single discard |
281 | * @q: the request queue for the device | 299 | * @q: the request queue for the device |
282 | * @max_discard_sectors: maximum number of sectors to discard | 300 | * @max_discard_sectors: maximum number of sectors to discard |