blk-settings.c (87760e5eef359788047d6fd54fc12eec74ce0d27) blk-settings.c (a6f0788ec2881ac14e97ff7fa6a78a807f87b5ba)
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>

--- 82 unchanged lines hidden (view full) ---

91 lim->max_integrity_segments = 0;
92 lim->seg_boundary_mask = BLK_SEG_BOUNDARY_MASK;
93 lim->virt_boundary_mask = 0;
94 lim->max_segment_size = BLK_MAX_SEGMENT_SIZE;
95 lim->max_sectors = lim->max_hw_sectors = BLK_SAFE_MAX_SECTORS;
96 lim->max_dev_sectors = 0;
97 lim->chunk_sectors = 0;
98 lim->max_write_same_sectors = 0;
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>

--- 82 unchanged lines hidden (view full) ---

91 lim->max_integrity_segments = 0;
92 lim->seg_boundary_mask = BLK_SEG_BOUNDARY_MASK;
93 lim->virt_boundary_mask = 0;
94 lim->max_segment_size = BLK_MAX_SEGMENT_SIZE;
95 lim->max_sectors = lim->max_hw_sectors = BLK_SAFE_MAX_SECTORS;
96 lim->max_dev_sectors = 0;
97 lim->chunk_sectors = 0;
98 lim->max_write_same_sectors = 0;
99 lim->max_write_zeroes_sectors = 0;
99 lim->max_discard_sectors = 0;
100 lim->max_hw_discard_sectors = 0;
101 lim->discard_granularity = 0;
102 lim->discard_alignment = 0;
103 lim->discard_misaligned = 0;
104 lim->discard_zeroes_data = 0;
105 lim->logical_block_size = lim->physical_block_size = lim->io_min = 512;
106 lim->bounce_pfn = (unsigned long)(BLK_BOUNCE_ANY >> PAGE_SHIFT);

--- 20 unchanged lines hidden (view full) ---

127 /* Inherit limits from component devices */
128 lim->discard_zeroes_data = 1;
129 lim->max_segments = USHRT_MAX;
130 lim->max_hw_sectors = UINT_MAX;
131 lim->max_segment_size = UINT_MAX;
132 lim->max_sectors = UINT_MAX;
133 lim->max_dev_sectors = UINT_MAX;
134 lim->max_write_same_sectors = UINT_MAX;
100 lim->max_discard_sectors = 0;
101 lim->max_hw_discard_sectors = 0;
102 lim->discard_granularity = 0;
103 lim->discard_alignment = 0;
104 lim->discard_misaligned = 0;
105 lim->discard_zeroes_data = 0;
106 lim->logical_block_size = lim->physical_block_size = lim->io_min = 512;
107 lim->bounce_pfn = (unsigned long)(BLK_BOUNCE_ANY >> PAGE_SHIFT);

--- 20 unchanged lines hidden (view full) ---

128 /* Inherit limits from component devices */
129 lim->discard_zeroes_data = 1;
130 lim->max_segments = USHRT_MAX;
131 lim->max_hw_sectors = UINT_MAX;
132 lim->max_segment_size = UINT_MAX;
133 lim->max_sectors = UINT_MAX;
134 lim->max_dev_sectors = UINT_MAX;
135 lim->max_write_same_sectors = UINT_MAX;
136 lim->max_write_zeroes_sectors = UINT_MAX;
135}
136EXPORT_SYMBOL(blk_set_stacking_limits);
137
138/**
139 * blk_queue_make_request - define an alternate make_request function for a device
140 * @q: the request queue for the device to be affected
141 * @mfn: the alternate make_request function
142 *

--- 152 unchanged lines hidden (view full) ---

295void blk_queue_max_write_same_sectors(struct request_queue *q,
296 unsigned int max_write_same_sectors)
297{
298 q->limits.max_write_same_sectors = max_write_same_sectors;
299}
300EXPORT_SYMBOL(blk_queue_max_write_same_sectors);
301
302/**
137}
138EXPORT_SYMBOL(blk_set_stacking_limits);
139
140/**
141 * blk_queue_make_request - define an alternate make_request function for a device
142 * @q: the request queue for the device to be affected
143 * @mfn: the alternate make_request function
144 *

--- 152 unchanged lines hidden (view full) ---

297void blk_queue_max_write_same_sectors(struct request_queue *q,
298 unsigned int max_write_same_sectors)
299{
300 q->limits.max_write_same_sectors = max_write_same_sectors;
301}
302EXPORT_SYMBOL(blk_queue_max_write_same_sectors);
303
304/**
305 * blk_queue_max_write_zeroes_sectors - set max sectors for a single
306 * write zeroes
307 * @q: the request queue for the device
308 * @max_write_zeroes_sectors: maximum number of sectors to write per command
309 **/
310void blk_queue_max_write_zeroes_sectors(struct request_queue *q,
311 unsigned int max_write_zeroes_sectors)
312{
313 q->limits.max_write_zeroes_sectors = max_write_zeroes_sectors;
314}
315EXPORT_SYMBOL(blk_queue_max_write_zeroes_sectors);
316
317/**
303 * blk_queue_max_segments - set max hw segments for a request for this queue
304 * @q: the request queue for the device
305 * @max_segments: max number of segments
306 *
307 * Description:
308 * Enables a low level driver to set an upper limit on the number of
309 * hw data segments in a request.
310 **/

--- 211 unchanged lines hidden (view full) ---

522{
523 unsigned int top, bottom, alignment, ret = 0;
524
525 t->max_sectors = min_not_zero(t->max_sectors, b->max_sectors);
526 t->max_hw_sectors = min_not_zero(t->max_hw_sectors, b->max_hw_sectors);
527 t->max_dev_sectors = min_not_zero(t->max_dev_sectors, b->max_dev_sectors);
528 t->max_write_same_sectors = min(t->max_write_same_sectors,
529 b->max_write_same_sectors);
318 * blk_queue_max_segments - set max hw segments for a request for this queue
319 * @q: the request queue for the device
320 * @max_segments: max number of segments
321 *
322 * Description:
323 * Enables a low level driver to set an upper limit on the number of
324 * hw data segments in a request.
325 **/

--- 211 unchanged lines hidden (view full) ---

537{
538 unsigned int top, bottom, alignment, ret = 0;
539
540 t->max_sectors = min_not_zero(t->max_sectors, b->max_sectors);
541 t->max_hw_sectors = min_not_zero(t->max_hw_sectors, b->max_hw_sectors);
542 t->max_dev_sectors = min_not_zero(t->max_dev_sectors, b->max_dev_sectors);
543 t->max_write_same_sectors = min(t->max_write_same_sectors,
544 b->max_write_same_sectors);
545 t->max_write_zeroes_sectors = min(t->max_write_zeroes_sectors,
546 b->max_write_zeroes_sectors);
530 t->bounce_pfn = min_not_zero(t->bounce_pfn, b->bounce_pfn);
531
532 t->seg_boundary_mask = min_not_zero(t->seg_boundary_mask,
533 b->seg_boundary_mask);
534 t->virt_boundary_mask = min_not_zero(t->virt_boundary_mask,
535 b->virt_boundary_mask);
536
537 t->max_segments = min_not_zero(t->max_segments, b->max_segments);

--- 347 unchanged lines hidden ---
547 t->bounce_pfn = min_not_zero(t->bounce_pfn, b->bounce_pfn);
548
549 t->seg_boundary_mask = min_not_zero(t->seg_boundary_mask,
550 b->seg_boundary_mask);
551 t->virt_boundary_mask = min_not_zero(t->virt_boundary_mask,
552 b->virt_boundary_mask);
553
554 t->max_segments = min_not_zero(t->max_segments, b->max_segments);

--- 347 unchanged lines hidden ---