aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk-settings.c')
-rw-r--r--block/blk-settings.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/block/blk-settings.c b/block/blk-settings.c
index d29498ef1eb5..e0695bca7027 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -96,6 +96,7 @@ void blk_set_default_limits(struct queue_limits *lim)
96 lim->max_segment_size = MAX_SEGMENT_SIZE; 96 lim->max_segment_size = MAX_SEGMENT_SIZE;
97 lim->max_sectors = BLK_DEF_MAX_SECTORS; 97 lim->max_sectors = BLK_DEF_MAX_SECTORS;
98 lim->max_hw_sectors = INT_MAX; 98 lim->max_hw_sectors = INT_MAX;
99 lim->max_discard_sectors = SAFE_MAX_SECTORS;
99 lim->logical_block_size = lim->physical_block_size = lim->io_min = 512; 100 lim->logical_block_size = lim->physical_block_size = lim->io_min = 512;
100 lim->bounce_pfn = (unsigned long)(BLK_BOUNCE_ANY >> PAGE_SHIFT); 101 lim->bounce_pfn = (unsigned long)(BLK_BOUNCE_ANY >> PAGE_SHIFT);
101 lim->alignment_offset = 0; 102 lim->alignment_offset = 0;
@@ -239,6 +240,18 @@ void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_sectors)
239EXPORT_SYMBOL(blk_queue_max_hw_sectors); 240EXPORT_SYMBOL(blk_queue_max_hw_sectors);
240 241
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: maximum number of sectors to discard
246 **/
247void blk_queue_max_discard_sectors(struct request_queue *q,
248 unsigned int max_discard_sectors)
249{
250 q->limits.max_discard_sectors = max_discard_sectors;
251}
252EXPORT_SYMBOL(blk_queue_max_discard_sectors);
253
254/**
242 * blk_queue_max_phys_segments - set max phys segments for a request for this queue 255 * blk_queue_max_phys_segments - set max phys segments for a request for this queue
243 * @q: the request queue for the device 256 * @q: the request queue for the device
244 * @max_segments: max number of segments 257 * @max_segments: max number of segments