Skip to content

Commit 3f89ac5

Browse files
Chaitanya Kulkarniaxboe
authored andcommitted
block/drivers: remove dead clear of random flag
QUEUE_FLAG_ADD_RANDOM is not set before we clear it for "null_blk", "brd", "nbd", "zram", and "bcache" since by default we don't set "QUEUE_FLAG_ADD_RANDOM" to MQ ops. Remove dead clear of QUEUE_FLAG_ADD_RANDOM in above listed drivers. Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org> #zram Link: https://lore.kernel.org/r/20230424234628.45544-2-kch@nvidia.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 38c8e3d commit 3f89ac5

5 files changed

Lines changed: 0 additions & 5 deletions

File tree

drivers/block/brd.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ static int brd_alloc(int i)
404404
/* Tell the block layer that this is not a rotational device */
405405
blk_queue_flag_set(QUEUE_FLAG_NONROT, disk->queue);
406406
blk_queue_flag_set(QUEUE_FLAG_SYNCHRONOUS, disk->queue);
407-
blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, disk->queue);
408407
blk_queue_flag_set(QUEUE_FLAG_NOWAIT, disk->queue);
409408
err = add_disk(disk);
410409
if (err)

drivers/block/nbd.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1805,7 +1805,6 @@ static struct nbd_device *nbd_dev_add(int index, unsigned int refs)
18051805
* Tell the block layer that we are not a rotational device
18061806
*/
18071807
blk_queue_flag_set(QUEUE_FLAG_NONROT, disk->queue);
1808-
blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, disk->queue);
18091808
disk->queue->limits.discard_granularity = 0;
18101809
blk_queue_max_discard_sectors(disk->queue, 0);
18111810
blk_queue_max_segment_size(disk->queue, UINT_MAX);

drivers/block/null_blk/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2145,7 +2145,6 @@ static int null_add_dev(struct nullb_device *dev)
21452145

21462146
nullb->q->queuedata = nullb;
21472147
blk_queue_flag_set(QUEUE_FLAG_NONROT, nullb->q);
2148-
blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, nullb->q);
21492148

21502149
mutex_lock(&lock);
21512150
rv = ida_simple_get(&nullb_indexes, 0, 0, GFP_KERNEL);

drivers/block/zram/zram_drv.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2323,7 +2323,6 @@ static int zram_add(void)
23232323
/* zram devices sort of resembles non-rotational disks */
23242324
blk_queue_flag_set(QUEUE_FLAG_NONROT, zram->disk->queue);
23252325
blk_queue_flag_set(QUEUE_FLAG_SYNCHRONOUS, zram->disk->queue);
2326-
blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, zram->disk->queue);
23272326

23282327
/*
23292328
* To ensure that we always get PAGE_SIZE aligned

drivers/md/bcache/super.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,6 @@ static int bcache_device_init(struct bcache_device *d, unsigned int block_size,
971971
}
972972

973973
blk_queue_flag_set(QUEUE_FLAG_NONROT, d->disk->queue);
974-
blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, d->disk->queue);
975974

976975
blk_queue_write_cache(q, true, true);
977976

0 commit comments

Comments
 (0)