loop: remove a pointless blk_queue_max_hw_sectors call
PATCH 1/2 loop: remove a pointless blk_queue_max_hw_sectors call
BLK_DEF_MAX_SECTORS is (as the name implies) already the default.
--- drivers/block/loop.c | 2 -- 1 file changed, 2 deletions(-)
drivers/block/loop.c +0 -2
@@ -2038,8 +2038,6 @@ static int loop_add(int i) } lo->lo_queue = lo->lo_disk->queue; -blk_queue_max_hw_sectors (lo->lo_queue,BLK_DEF_MAX_SECTORS ); -/* * By default, we do buffer IO, so it doesn't make sense to enable * merge because the I/O submitted to backing file is handled page by
Signature · 1 line
2.39.2
PATCH 2/2 loop: don't update discard limits from loop_set_status
loop_set_status doesn't change anything relevant to the discard and write_zeroes setting, so don't bother calling loop_config_discard.
--- drivers/block/loop.c | 2 -- 1 file changed, 2 deletions(-)
drivers/block/loop.c +0 -2
@@ -1303,8 +1303,6 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)loop_set_size (lo, new_size); } -loop_config_discard (lo); -/* update dio if lo_offset or transfer is changed */ __loop_update_dio (lo, lo->use_dio);
Signature · 1 line
2.39.2
Hi,
Quoted 1 line · Christoph Hellwig
BLK_DEF_MAX_SECTORSis (as the name implies) already the default.
Looks like this not true. From blk_set_default_limits():
lim->max_sectors = lim->max_hw_sectors = BLK_SAFE_MAX_SECTORS;
So, the default is not BLK_DEF_MAX_SECTORS. Or am I missing something?
Thanks,
Kuai
Quoted 20 lines
Signed-off-by Christoph Hellwig <[email protected]>--- drivers/block/loop.c | 2 -- 1 file changed, 2 deletions(-)drivers/block/loop.c +0
-2@@ -2038,8 +2038,6 @@ static int loop_add(int i) } lo->lo_queue = lo->lo_disk->queue; -blk_queue_max_hw_sectors (lo->lo_queue,BLK_DEF_MAX_SECTORS ); -/* * By default, we do buffer IO, so it doesn't make sense to enable * merge because the I/O submitted to backing file is handled page by
Quoted 10 lines · Yu Kuai
Hi,
Quoted 1 line · Christoph Hellwig
BLK_DEF_MAX_SECTORSis (as the name implies) already the default.Looks like this not true. From
blk_set_default_limits():
lim->max_sectors=lim->max_hw_sectors=BLK_SAFE_MAX_SECTORS;So, the default is not
BLK_DEF_MAX_SECTORS. Or am I missing something?
No, you're not. The naming and our code is just a desaster..