mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 03:50:24 +09:00
ANDROID: block: Prepare for supporting sub-page limits
Introduce variables that represent the lower configuration bounds. This patch does not change any functionality. Bug: 308663717 Bug: 319125789 Change-Id: Ia39fbe29a0711caba841a7b44d462608216841ec Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Juan Yescas <jyescas@google.com>
This commit is contained in:
committed by
Juan Yescas
parent
f56ddffe05
commit
025c278e84
@@ -126,10 +126,11 @@ EXPORT_SYMBOL(blk_queue_bounce_limit);
|
||||
void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_hw_sectors)
|
||||
{
|
||||
struct queue_limits *limits = &q->limits;
|
||||
unsigned int min_max_hw_sectors = PAGE_SIZE >> SECTOR_SHIFT;
|
||||
unsigned int max_sectors;
|
||||
|
||||
if ((max_hw_sectors << 9) < PAGE_SIZE) {
|
||||
max_hw_sectors = 1 << (PAGE_SHIFT - 9);
|
||||
if (max_hw_sectors < min_max_hw_sectors) {
|
||||
max_hw_sectors = min_max_hw_sectors;
|
||||
pr_info("set to minimum %u\n", max_hw_sectors);
|
||||
}
|
||||
|
||||
@@ -279,8 +280,10 @@ EXPORT_SYMBOL_GPL(blk_queue_max_discard_segments);
|
||||
**/
|
||||
void blk_queue_max_segment_size(struct request_queue *q, unsigned int max_size)
|
||||
{
|
||||
if (max_size < PAGE_SIZE) {
|
||||
max_size = PAGE_SIZE;
|
||||
unsigned int min_max_segment_size = PAGE_SIZE;
|
||||
|
||||
if (max_size < min_max_segment_size) {
|
||||
max_size = min_max_segment_size;
|
||||
pr_info("set to minimum %u\n", max_size);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user