blk-settings.c (eb28d31bc97e6374d81f404da309401ffaed467b) | blk-settings.c (086fa5ff0854c676ec333760f4c0154b3b242616) |
---|---|
1/* 2 * Functions related to setting various queue properties from drivers 3 */ 4#include <linux/kernel.h> 5#include <linux/module.h> 6#include <linux/init.h> 7#include <linux/bio.h> 8#include <linux/blkdev.h> --- 140 unchanged lines hidden (view full) --- 149 q->unplug_delay = msecs_to_jiffies(3); /* 3 milliseconds */ 150 if (q->unplug_delay == 0) 151 q->unplug_delay = 1; 152 153 q->unplug_timer.function = blk_unplug_timeout; 154 q->unplug_timer.data = (unsigned long)q; 155 156 blk_set_default_limits(&q->limits); | 1/* 2 * Functions related to setting various queue properties from drivers 3 */ 4#include <linux/kernel.h> 5#include <linux/module.h> 6#include <linux/init.h> 7#include <linux/bio.h> 8#include <linux/blkdev.h> --- 140 unchanged lines hidden (view full) --- 149 q->unplug_delay = msecs_to_jiffies(3); /* 3 milliseconds */ 150 if (q->unplug_delay == 0) 151 q->unplug_delay = 1; 152 153 q->unplug_timer.function = blk_unplug_timeout; 154 q->unplug_timer.data = (unsigned long)q; 155 156 blk_set_default_limits(&q->limits); |
157 blk_queue_max_sectors(q, BLK_SAFE_MAX_SECTORS); | 157 blk_queue_max_hw_sectors(q, BLK_SAFE_MAX_SECTORS); |
158 159 /* 160 * If the caller didn't supply a lock, fall back to our embedded 161 * per-queue locks 162 */ 163 if (!q->queue_lock) 164 q->queue_lock = &q->__queue_lock; 165 --- 39 unchanged lines hidden (view full) --- 205 init_emergency_isa_pool(); 206 q->bounce_gfp = GFP_NOIO | GFP_DMA; 207 q->limits.bounce_pfn = b_pfn; 208 } 209} 210EXPORT_SYMBOL(blk_queue_bounce_limit); 211 212/** | 158 159 /* 160 * If the caller didn't supply a lock, fall back to our embedded 161 * per-queue locks 162 */ 163 if (!q->queue_lock) 164 q->queue_lock = &q->__queue_lock; 165 --- 39 unchanged lines hidden (view full) --- 205 init_emergency_isa_pool(); 206 q->bounce_gfp = GFP_NOIO | GFP_DMA; 207 q->limits.bounce_pfn = b_pfn; 208 } 209} 210EXPORT_SYMBOL(blk_queue_bounce_limit); 211 212/** |
213 * blk_queue_max_sectors - set max sectors for a request for this queue | 213 * blk_queue_max_hw_sectors - set max sectors for a request for this queue |
214 * @q: the request queue for the device 215 * @max_hw_sectors: max hardware sectors in the usual 512b unit 216 * 217 * Description: 218 * Enables a low level driver to set a hard upper limit, 219 * max_hw_sectors, on the size of requests. max_hw_sectors is set by 220 * the device driver based upon the combined capabilities of I/O 221 * controller and storage device. 222 * 223 * max_sectors is a soft limit imposed by the block layer for 224 * filesystem type requests. This value can be overridden on a 225 * per-device basis in /sys/block/<device>/queue/max_sectors_kb. 226 * The soft limit can not exceed max_hw_sectors. 227 **/ | 214 * @q: the request queue for the device 215 * @max_hw_sectors: max hardware sectors in the usual 512b unit 216 * 217 * Description: 218 * Enables a low level driver to set a hard upper limit, 219 * max_hw_sectors, on the size of requests. max_hw_sectors is set by 220 * the device driver based upon the combined capabilities of I/O 221 * controller and storage device. 222 * 223 * max_sectors is a soft limit imposed by the block layer for 224 * filesystem type requests. This value can be overridden on a 225 * per-device basis in /sys/block/<device>/queue/max_sectors_kb. 226 * The soft limit can not exceed max_hw_sectors. 227 **/ |
228void blk_queue_max_sectors(struct request_queue *q, unsigned int max_hw_sectors) | 228void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_hw_sectors) |
229{ 230 if ((max_hw_sectors << 9) < PAGE_CACHE_SIZE) { 231 max_hw_sectors = 1 << (PAGE_CACHE_SHIFT - 9); 232 printk(KERN_INFO "%s: set to minimum %d\n", 233 __func__, max_hw_sectors); 234 } 235 236 q->limits.max_hw_sectors = max_hw_sectors; 237 q->limits.max_sectors = min_t(unsigned int, max_hw_sectors, 238 BLK_DEF_MAX_SECTORS); 239} | 229{ 230 if ((max_hw_sectors << 9) < PAGE_CACHE_SIZE) { 231 max_hw_sectors = 1 << (PAGE_CACHE_SHIFT - 9); 232 printk(KERN_INFO "%s: set to minimum %d\n", 233 __func__, max_hw_sectors); 234 } 235 236 q->limits.max_hw_sectors = max_hw_sectors; 237 q->limits.max_sectors = min_t(unsigned int, max_hw_sectors, 238 BLK_DEF_MAX_SECTORS); 239} |
240EXPORT_SYMBOL(blk_queue_max_sectors); | 240EXPORT_SYMBOL(blk_queue_max_hw_sectors); |
241 242/** 243 * blk_queue_max_discard_sectors - set max sectors for a single discard 244 * @q: the request queue for the device 245 * @max_discard_sectors: maximum number of sectors to discard 246 **/ 247void blk_queue_max_discard_sectors(struct request_queue *q, 248 unsigned int max_discard_sectors) --- 580 unchanged lines hidden --- | 241 242/** 243 * blk_queue_max_discard_sectors - set max sectors for a single discard 244 * @q: the request queue for the device 245 * @max_discard_sectors: maximum number of sectors to discard 246 **/ 247void blk_queue_max_discard_sectors(struct request_queue *q, 248 unsigned int max_discard_sectors) --- 580 unchanged lines hidden --- |