@@ -179,16 +179,16 @@ void blk_queue_bounce_limit(struct request_queue *q, u64 dma_mask)
179
179
*/
180
180
if (b_pfn < (min_t (u64 , 0xffffffffUL , BLK_BOUNCE_HIGH ) >> PAGE_SHIFT ))
181
181
dma = 1 ;
182
- q -> bounce_pfn = max_low_pfn ;
182
+ q -> limits . bounce_pfn = max_low_pfn ;
183
183
#else
184
184
if (b_pfn < blk_max_low_pfn )
185
185
dma = 1 ;
186
- q -> bounce_pfn = b_pfn ;
186
+ q -> limits . bounce_pfn = b_pfn ;
187
187
#endif
188
188
if (dma ) {
189
189
init_emergency_isa_pool ();
190
190
q -> bounce_gfp = GFP_NOIO | GFP_DMA ;
191
- q -> bounce_pfn = b_pfn ;
191
+ q -> limits . bounce_pfn = b_pfn ;
192
192
}
193
193
}
194
194
EXPORT_SYMBOL (blk_queue_bounce_limit );
@@ -211,20 +211,20 @@ void blk_queue_max_sectors(struct request_queue *q, unsigned int max_sectors)
211
211
}
212
212
213
213
if (BLK_DEF_MAX_SECTORS > max_sectors )
214
- q -> max_hw_sectors = q -> max_sectors = max_sectors ;
214
+ q -> limits . max_hw_sectors = q -> limits . max_sectors = max_sectors ;
215
215
else {
216
- q -> max_sectors = BLK_DEF_MAX_SECTORS ;
217
- q -> max_hw_sectors = max_sectors ;
216
+ q -> limits . max_sectors = BLK_DEF_MAX_SECTORS ;
217
+ q -> limits . max_hw_sectors = max_sectors ;
218
218
}
219
219
}
220
220
EXPORT_SYMBOL (blk_queue_max_sectors );
221
221
222
222
void blk_queue_max_hw_sectors (struct request_queue * q , unsigned int max_sectors )
223
223
{
224
224
if (BLK_DEF_MAX_SECTORS > max_sectors )
225
- q -> max_hw_sectors = BLK_DEF_MAX_SECTORS ;
225
+ q -> limits . max_hw_sectors = BLK_DEF_MAX_SECTORS ;
226
226
else
227
- q -> max_hw_sectors = max_sectors ;
227
+ q -> limits . max_hw_sectors = max_sectors ;
228
228
}
229
229
EXPORT_SYMBOL (blk_queue_max_hw_sectors );
230
230
@@ -247,7 +247,7 @@ void blk_queue_max_phys_segments(struct request_queue *q,
247
247
__func__ , max_segments );
248
248
}
249
249
250
- q -> max_phys_segments = max_segments ;
250
+ q -> limits . max_phys_segments = max_segments ;
251
251
}
252
252
EXPORT_SYMBOL (blk_queue_max_phys_segments );
253
253
@@ -271,7 +271,7 @@ void blk_queue_max_hw_segments(struct request_queue *q,
271
271
__func__ , max_segments );
272
272
}
273
273
274
- q -> max_hw_segments = max_segments ;
274
+ q -> limits . max_hw_segments = max_segments ;
275
275
}
276
276
EXPORT_SYMBOL (blk_queue_max_hw_segments );
277
277
@@ -292,7 +292,7 @@ void blk_queue_max_segment_size(struct request_queue *q, unsigned int max_size)
292
292
__func__ , max_size );
293
293
}
294
294
295
- q -> max_segment_size = max_size ;
295
+ q -> limits . max_segment_size = max_size ;
296
296
}
297
297
EXPORT_SYMBOL (blk_queue_max_segment_size );
298
298
@@ -308,7 +308,7 @@ EXPORT_SYMBOL(blk_queue_max_segment_size);
308
308
**/
309
309
void blk_queue_logical_block_size (struct request_queue * q , unsigned short size )
310
310
{
311
- q -> logical_block_size = size ;
311
+ q -> limits . logical_block_size = size ;
312
312
}
313
313
EXPORT_SYMBOL (blk_queue_logical_block_size );
314
314
@@ -325,14 +325,27 @@ EXPORT_SYMBOL(blk_queue_logical_block_size);
325
325
void blk_queue_stack_limits (struct request_queue * t , struct request_queue * b )
326
326
{
327
327
/* zero is "infinity" */
328
- t -> max_sectors = min_not_zero (t -> max_sectors , b -> max_sectors );
329
- t -> max_hw_sectors = min_not_zero (t -> max_hw_sectors , b -> max_hw_sectors );
330
- t -> seg_boundary_mask = min_not_zero (t -> seg_boundary_mask , b -> seg_boundary_mask );
331
-
332
- t -> max_phys_segments = min_not_zero (t -> max_phys_segments , b -> max_phys_segments );
333
- t -> max_hw_segments = min_not_zero (t -> max_hw_segments , b -> max_hw_segments );
334
- t -> max_segment_size = min_not_zero (t -> max_segment_size , b -> max_segment_size );
335
- t -> logical_block_size = max (t -> logical_block_size , b -> logical_block_size );
328
+ t -> limits .max_sectors = min_not_zero (queue_max_sectors (t ),
329
+ queue_max_sectors (b ));
330
+
331
+ t -> limits .max_hw_sectors = min_not_zero (queue_max_hw_sectors (t ),
332
+ queue_max_hw_sectors (b ));
333
+
334
+ t -> limits .seg_boundary_mask = min_not_zero (queue_segment_boundary (t ),
335
+ queue_segment_boundary (b ));
336
+
337
+ t -> limits .max_phys_segments = min_not_zero (queue_max_phys_segments (t ),
338
+ queue_max_phys_segments (b ));
339
+
340
+ t -> limits .max_hw_segments = min_not_zero (queue_max_hw_segments (t ),
341
+ queue_max_hw_segments (b ));
342
+
343
+ t -> limits .max_segment_size = min_not_zero (queue_max_segment_size (t ),
344
+ queue_max_segment_size (b ));
345
+
346
+ t -> limits .logical_block_size = max (queue_logical_block_size (t ),
347
+ queue_logical_block_size (b ));
348
+
336
349
if (!t -> queue_lock )
337
350
WARN_ON_ONCE (1 );
338
351
else if (!test_bit (QUEUE_FLAG_CLUSTER , & b -> queue_flags )) {
@@ -430,7 +443,7 @@ void blk_queue_segment_boundary(struct request_queue *q, unsigned long mask)
430
443
__func__ , mask );
431
444
}
432
445
433
- q -> seg_boundary_mask = mask ;
446
+ q -> limits . seg_boundary_mask = mask ;
434
447
}
435
448
EXPORT_SYMBOL (blk_queue_segment_boundary );
436
449
0 commit comments