summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--block/bsg-lib.c4
-rw-r--r--drivers/block/drbd/drbd_nl.c4
-rw-r--r--drivers/block/loop.c10
-rw-r--r--drivers/block/nbd.c8
-rw-r--r--drivers/block/null_blk.c6
-rw-r--r--drivers/block/rbd.c4
-rw-r--r--drivers/block/rsxx/dev.c6
-rw-r--r--drivers/block/skd_main.c4
-rw-r--r--drivers/block/xen-blkfront.c10
-rw-r--r--drivers/block/zram/zram_drv.c6
-rw-r--r--drivers/ide/ide-disk.c4
-rw-r--r--drivers/ide/ide-probe.c2
-rw-r--r--drivers/lightnvm/pblk-init.c2
-rw-r--r--drivers/md/dm-table.c16
-rw-r--r--drivers/md/md-linear.c4
-rw-r--r--drivers/md/md.c4
-rw-r--r--drivers/md/raid0.c4
-rw-r--r--drivers/md/raid1.c6
-rw-r--r--drivers/md/raid10.c6
-rw-r--r--drivers/md/raid5.c4
-rw-r--r--drivers/mmc/core/queue.c8
-rw-r--r--drivers/mtd/mtd_blkdevs.c6
-rw-r--r--drivers/nvdimm/blk.c2
-rw-r--r--drivers/nvdimm/btt.c2
-rw-r--r--drivers/nvdimm/pmem.c4
-rw-r--r--drivers/nvme/host/core.c4
-rw-r--r--drivers/nvme/host/multipath.c2
-rw-r--r--drivers/s390/block/dasd.c4
-rw-r--r--drivers/s390/block/dcssblk.c2
-rw-r--r--drivers/s390/block/scm_blk.c4
-rw-r--r--drivers/s390/block/xpram.c4
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c2
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_fusion.c2
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_scsih.c2
-rw-r--r--drivers/scsi/scsi_debug.c2
-rw-r--r--drivers/scsi/scsi_lib.c2
-rw-r--r--drivers/scsi/scsi_transport_sas.c4
-rw-r--r--drivers/scsi/sd.c8
38 files changed, 89 insertions, 89 deletions
diff --git a/block/bsg-lib.c b/block/bsg-lib.c
index 1474153f73e3..b4fe1a48f111 100644
--- a/block/bsg-lib.c
+++ b/block/bsg-lib.c
@@ -275,8 +275,8 @@ struct request_queue *bsg_setup_queue(struct device *dev, const char *name,
275 275
276 q->queuedata = dev; 276 q->queuedata = dev;
277 q->bsg_job_fn = job_fn; 277 q->bsg_job_fn = job_fn;
278 queue_flag_set_unlocked(QUEUE_FLAG_BIDI, q); 278 blk_queue_flag_set(QUEUE_FLAG_BIDI, q);
279 queue_flag_set_unlocked(QUEUE_FLAG_SCSI_PASSTHROUGH, q); 279 blk_queue_flag_set(QUEUE_FLAG_SCSI_PASSTHROUGH, q);
280 blk_queue_softirq_done(q, bsg_softirq_done); 280 blk_queue_softirq_done(q, bsg_softirq_done);
281 blk_queue_rq_timeout(q, BLK_DEFAULT_SG_TIMEOUT); 281 blk_queue_rq_timeout(q, BLK_DEFAULT_SG_TIMEOUT);
282 282
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index a12f77e6891e..b4f02768ba47 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -1212,10 +1212,10 @@ static void decide_on_discard_support(struct drbd_device *device,
1212 * topology on all peers. */ 1212 * topology on all peers. */
1213 blk_queue_discard_granularity(q, 512); 1213 blk_queue_discard_granularity(q, 512);
1214 q->limits.max_discard_sectors = drbd_max_discard_sectors(connection); 1214 q->limits.max_discard_sectors = drbd_max_discard_sectors(connection);
1215 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q); 1215 blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
1216 q->limits.max_write_zeroes_sectors = drbd_max_discard_sectors(connection); 1216 q->limits.max_write_zeroes_sectors = drbd_max_discard_sectors(connection);
1217 } else { 1217 } else {
1218 queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, q); 1218 blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
1219 blk_queue_discard_granularity(q, 0); 1219 blk_queue_discard_granularity(q, 0);
1220 q->limits.max_discard_sectors = 0; 1220 q->limits.max_discard_sectors = 0;
1221 q->limits.max_write_zeroes_sectors = 0; 1221 q->limits.max_write_zeroes_sectors = 0;
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 9d29aa6413e5..7952ed5c607b 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -214,10 +214,10 @@ static void __loop_update_dio(struct loop_device *lo, bool dio)
214 blk_mq_freeze_queue(lo->lo_queue); 214 blk_mq_freeze_queue(lo->lo_queue);
215 lo->use_dio = use_dio; 215 lo->use_dio = use_dio;
216 if (use_dio) { 216 if (use_dio) {
217 queue_flag_clear_unlocked(QUEUE_FLAG_NOMERGES, lo->lo_queue); 217 blk_queue_flag_clear(QUEUE_FLAG_NOMERGES, lo->lo_queue);
218 lo->lo_flags |= LO_FLAGS_DIRECT_IO; 218 lo->lo_flags |= LO_FLAGS_DIRECT_IO;
219 } else { 219 } else {
220 queue_flag_set_unlocked(QUEUE_FLAG_NOMERGES, lo->lo_queue); 220 blk_queue_flag_set(QUEUE_FLAG_NOMERGES, lo->lo_queue);
221 lo->lo_flags &= ~LO_FLAGS_DIRECT_IO; 221 lo->lo_flags &= ~LO_FLAGS_DIRECT_IO;
222 } 222 }
223 blk_mq_unfreeze_queue(lo->lo_queue); 223 blk_mq_unfreeze_queue(lo->lo_queue);
@@ -817,7 +817,7 @@ static void loop_config_discard(struct loop_device *lo)
817 q->limits.discard_alignment = 0; 817 q->limits.discard_alignment = 0;
818 blk_queue_max_discard_sectors(q, 0); 818 blk_queue_max_discard_sectors(q, 0);
819 blk_queue_max_write_zeroes_sectors(q, 0); 819 blk_queue_max_write_zeroes_sectors(q, 0);
820 queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, q); 820 blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
821 return; 821 return;
822 } 822 }
823 823
@@ -826,7 +826,7 @@ static void loop_config_discard(struct loop_device *lo)
826 826
827 blk_queue_max_discard_sectors(q, UINT_MAX >> 9); 827 blk_queue_max_discard_sectors(q, UINT_MAX >> 9);
828 blk_queue_max_write_zeroes_sectors(q, UINT_MAX >> 9); 828 blk_queue_max_write_zeroes_sectors(q, UINT_MAX >> 9);
829 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q); 829 blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
830} 830}
831 831
832static void loop_unprepare_queue(struct loop_device *lo) 832static void loop_unprepare_queue(struct loop_device *lo)
@@ -1808,7 +1808,7 @@ static int loop_add(struct loop_device **l, int i)
1808 * page. For directio mode, merge does help to dispatch bigger request 1808 * page. For directio mode, merge does help to dispatch bigger request
1809 * to underlayer disk. We will enable merge once directio is enabled. 1809 * to underlayer disk. We will enable merge once directio is enabled.
1810 */ 1810 */
1811 queue_flag_set_unlocked(QUEUE_FLAG_NOMERGES, lo->lo_queue); 1811 blk_queue_flag_set(QUEUE_FLAG_NOMERGES, lo->lo_queue);
1812 1812
1813 err = -ENOMEM; 1813 err = -ENOMEM;
1814 disk = lo->lo_disk = alloc_disk(1 << part_shift); 1814 disk = lo->lo_disk = alloc_disk(1 << part_shift);
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 86258b00a1d4..afbc202ca6fd 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -964,7 +964,7 @@ static void nbd_parse_flags(struct nbd_device *nbd)
964 else 964 else
965 set_disk_ro(nbd->disk, false); 965 set_disk_ro(nbd->disk, false);
966 if (config->flags & NBD_FLAG_SEND_TRIM) 966 if (config->flags & NBD_FLAG_SEND_TRIM)
967 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, nbd->disk->queue); 967 blk_queue_flag_set(QUEUE_FLAG_DISCARD, nbd->disk->queue);
968 if (config->flags & NBD_FLAG_SEND_FLUSH) { 968 if (config->flags & NBD_FLAG_SEND_FLUSH) {
969 if (config->flags & NBD_FLAG_SEND_FUA) 969 if (config->flags & NBD_FLAG_SEND_FUA)
970 blk_queue_write_cache(nbd->disk->queue, true, true); 970 blk_queue_write_cache(nbd->disk->queue, true, true);
@@ -1040,7 +1040,7 @@ static void nbd_config_put(struct nbd_device *nbd)
1040 nbd->config = NULL; 1040 nbd->config = NULL;
1041 1041
1042 nbd->tag_set.timeout = 0; 1042 nbd->tag_set.timeout = 0;
1043 queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, nbd->disk->queue); 1043 blk_queue_flag_clear(QUEUE_FLAG_DISCARD, nbd->disk->queue);
1044 1044
1045 mutex_unlock(&nbd->config_lock); 1045 mutex_unlock(&nbd->config_lock);
1046 nbd_put(nbd); 1046 nbd_put(nbd);
@@ -1488,8 +1488,8 @@ static int nbd_dev_add(int index)
1488 /* 1488 /*
1489 * Tell the block layer that we are not a rotational device 1489 * Tell the block layer that we are not a rotational device
1490 */ 1490 */
1491 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, disk->queue); 1491 blk_queue_flag_set(QUEUE_FLAG_NONROT, disk->queue);
1492 queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, disk->queue); 1492 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, disk->queue);
1493 disk->queue->limits.discard_granularity = 512; 1493 disk->queue->limits.discard_granularity = 512;
1494 blk_queue_max_discard_sectors(disk->queue, UINT_MAX); 1494 blk_queue_max_discard_sectors(disk->queue, UINT_MAX);
1495 blk_queue_max_segment_size(disk->queue, UINT_MAX); 1495 blk_queue_max_segment_size(disk->queue, UINT_MAX);
diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
index d6be7a6d8ca6..0517613afccb 100644
--- a/drivers/block/null_blk.c
+++ b/drivers/block/null_blk.c
@@ -1525,7 +1525,7 @@ static void null_config_discard(struct nullb *nullb)
1525 nullb->q->limits.discard_granularity = nullb->dev->blocksize; 1525 nullb->q->limits.discard_granularity = nullb->dev->blocksize;
1526 nullb->q->limits.discard_alignment = nullb->dev->blocksize; 1526 nullb->q->limits.discard_alignment = nullb->dev->blocksize;
1527 blk_queue_max_discard_sectors(nullb->q, UINT_MAX >> 9); 1527 blk_queue_max_discard_sectors(nullb->q, UINT_MAX >> 9);
1528 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, nullb->q); 1528 blk_queue_flag_set(QUEUE_FLAG_DISCARD, nullb->q);
1529} 1529}
1530 1530
1531static int null_open(struct block_device *bdev, fmode_t mode) 1531static int null_open(struct block_device *bdev, fmode_t mode)
@@ -1810,8 +1810,8 @@ static int null_add_dev(struct nullb_device *dev)
1810 } 1810 }
1811 1811
1812 nullb->q->queuedata = nullb; 1812 nullb->q->queuedata = nullb;
1813 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, nullb->q); 1813 blk_queue_flag_set(QUEUE_FLAG_NONROT, nullb->q);
1814 queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, nullb->q); 1814 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, nullb->q);
1815 1815
1816 mutex_lock(&lock); 1816 mutex_lock(&lock);
1817 nullb->index = ida_simple_get(&nullb_indexes, 0, 0, GFP_KERNEL); 1817 nullb->index = ida_simple_get(&nullb_indexes, 0, 0, GFP_KERNEL);
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 8e40da093766..0016170cde0a 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -4370,7 +4370,7 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
4370 goto out_tag_set; 4370 goto out_tag_set;
4371 } 4371 }
4372 4372
4373 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); 4373 blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
4374 /* QUEUE_FLAG_ADD_RANDOM is off by default for blk-mq */ 4374 /* QUEUE_FLAG_ADD_RANDOM is off by default for blk-mq */
4375 4375
4376 /* set io sizes to object size */ 4376 /* set io sizes to object size */
@@ -4383,7 +4383,7 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
4383 blk_queue_io_opt(q, segment_size); 4383 blk_queue_io_opt(q, segment_size);
4384 4384
4385 /* enable the discard support */ 4385 /* enable the discard support */
4386 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q); 4386 blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
4387 q->limits.discard_granularity = segment_size; 4387 q->limits.discard_granularity = segment_size;
4388 blk_queue_max_discard_sectors(q, segment_size / SECTOR_SIZE); 4388 blk_queue_max_discard_sectors(q, segment_size / SECTOR_SIZE);
4389 blk_queue_max_write_zeroes_sectors(q, segment_size / SECTOR_SIZE); 4389 blk_queue_max_write_zeroes_sectors(q, segment_size / SECTOR_SIZE);
diff --git a/drivers/block/rsxx/dev.c b/drivers/block/rsxx/dev.c
index e397d3ee7308..dddb3f2490b6 100644
--- a/drivers/block/rsxx/dev.c
+++ b/drivers/block/rsxx/dev.c
@@ -287,10 +287,10 @@ int rsxx_setup_dev(struct rsxx_cardinfo *card)
287 blk_queue_max_hw_sectors(card->queue, blkdev_max_hw_sectors); 287 blk_queue_max_hw_sectors(card->queue, blkdev_max_hw_sectors);
288 blk_queue_physical_block_size(card->queue, RSXX_HW_BLK_SIZE); 288 blk_queue_physical_block_size(card->queue, RSXX_HW_BLK_SIZE);
289 289
290 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, card->queue); 290 blk_queue_flag_set(QUEUE_FLAG_NONROT, card->queue);
291 queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, card->queue); 291 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, card->queue);
292 if (rsxx_discard_supported(card)) { 292 if (rsxx_discard_supported(card)) {
293 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, card->queue); 293 blk_queue_flag_set(QUEUE_FLAG_DISCARD, card->queue);
294 blk_queue_max_discard_sectors(card->queue, 294 blk_queue_max_discard_sectors(card->queue,
295 RSXX_HW_BLK_SIZE >> 9); 295 RSXX_HW_BLK_SIZE >> 9);
296 card->queue->limits.discard_granularity = RSXX_HW_BLK_SIZE; 296 card->queue->limits.discard_granularity = RSXX_HW_BLK_SIZE;
diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c
index e41935ab41ef..bc7aea6d7b7c 100644
--- a/drivers/block/skd_main.c
+++ b/drivers/block/skd_main.c
@@ -2858,8 +2858,8 @@ static int skd_cons_disk(struct skd_device *skdev)
2858 /* set optimal I/O size to 8KB */ 2858 /* set optimal I/O size to 8KB */
2859 blk_queue_io_opt(q, 8192); 2859 blk_queue_io_opt(q, 8192);
2860 2860
2861 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); 2861 blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
2862 queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, q); 2862 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q);
2863 2863
2864 blk_queue_rq_timeout(q, 8 * HZ); 2864 blk_queue_rq_timeout(q, 8 * HZ);
2865 2865
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index e126e4cac2ca..3fcdc0d8eed3 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -931,15 +931,15 @@ static void blkif_set_queue_limits(struct blkfront_info *info)
931 unsigned int segments = info->max_indirect_segments ? : 931 unsigned int segments = info->max_indirect_segments ? :
932 BLKIF_MAX_SEGMENTS_PER_REQUEST; 932 BLKIF_MAX_SEGMENTS_PER_REQUEST;
933 933
934 queue_flag_set_unlocked(QUEUE_FLAG_VIRT, rq); 934 blk_queue_flag_set(QUEUE_FLAG_VIRT, rq);
935 935
936 if (info->feature_discard) { 936 if (info->feature_discard) {
937 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, rq); 937 blk_queue_flag_set(QUEUE_FLAG_DISCARD, rq);
938 blk_queue_max_discard_sectors(rq, get_capacity(gd)); 938 blk_queue_max_discard_sectors(rq, get_capacity(gd));
939 rq->limits.discard_granularity = info->discard_granularity; 939 rq->limits.discard_granularity = info->discard_granularity;
940 rq->limits.discard_alignment = info->discard_alignment; 940 rq->limits.discard_alignment = info->discard_alignment;
941 if (info->feature_secdiscard) 941 if (info->feature_secdiscard)
942 queue_flag_set_unlocked(QUEUE_FLAG_SECERASE, rq); 942 blk_queue_flag_set(QUEUE_FLAG_SECERASE, rq);
943 } 943 }
944 944
945 /* Hard sector size and max sectors impersonate the equiv. hardware. */ 945 /* Hard sector size and max sectors impersonate the equiv. hardware. */
@@ -1610,8 +1610,8 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
1610 blkif_req(req)->error = BLK_STS_NOTSUPP; 1610 blkif_req(req)->error = BLK_STS_NOTSUPP;
1611 info->feature_discard = 0; 1611 info->feature_discard = 0;
1612 info->feature_secdiscard = 0; 1612 info->feature_secdiscard = 0;
1613 queue_flag_clear(QUEUE_FLAG_DISCARD, rq); 1613 blk_queue_flag_clear(QUEUE_FLAG_DISCARD, rq);
1614 queue_flag_clear(QUEUE_FLAG_SECERASE, rq); 1614 blk_queue_flag_clear(QUEUE_FLAG_SECERASE, rq);
1615 } 1615 }
1616 break; 1616 break;
1617 case BLKIF_OP_FLUSH_DISKCACHE: 1617 case BLKIF_OP_FLUSH_DISKCACHE:
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 85110e7931e5..71b449613cfa 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1530,8 +1530,8 @@ static int zram_add(void)
1530 /* Actual capacity set using syfs (/sys/block/zram<id>/disksize */ 1530 /* Actual capacity set using syfs (/sys/block/zram<id>/disksize */
1531 set_capacity(zram->disk, 0); 1531 set_capacity(zram->disk, 0);
1532 /* zram devices sort of resembles non-rotational disks */ 1532 /* zram devices sort of resembles non-rotational disks */
1533 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, zram->disk->queue); 1533 blk_queue_flag_set(QUEUE_FLAG_NONROT, zram->disk->queue);
1534 queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, zram->disk->queue); 1534 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, zram->disk->queue);
1535 1535
1536 /* 1536 /*
1537 * To ensure that we always get PAGE_SIZE aligned 1537 * To ensure that we always get PAGE_SIZE aligned
@@ -1544,7 +1544,7 @@ static int zram_add(void)
1544 blk_queue_io_opt(zram->disk->queue, PAGE_SIZE); 1544 blk_queue_io_opt(zram->disk->queue, PAGE_SIZE);
1545 zram->disk->queue->limits.discard_granularity = PAGE_SIZE; 1545 zram->disk->queue->limits.discard_granularity = PAGE_SIZE;
1546 blk_queue_max_discard_sectors(zram->disk->queue, UINT_MAX); 1546 blk_queue_max_discard_sectors(zram->disk->queue, UINT_MAX);
1547 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, zram->disk->queue); 1547 blk_queue_flag_set(QUEUE_FLAG_DISCARD, zram->disk->queue);
1548 1548
1549 /* 1549 /*
1550 * zram_bio_discard() will clear all logical blocks if logical block 1550 * zram_bio_discard() will clear all logical blocks if logical block
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 188d1b03715d..9c47f975567f 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -687,8 +687,8 @@ static void ide_disk_setup(ide_drive_t *drive)
687 queue_max_sectors(q) / 2); 687 queue_max_sectors(q) / 2);
688 688
689 if (ata_id_is_ssd(id)) { 689 if (ata_id_is_ssd(id)) {
690 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); 690 blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
691 queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, q); 691 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q);
692 } 692 }
693 693
694 /* calculate drive capacity, and select LBA if possible */ 694 /* calculate drive capacity, and select LBA if possible */
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index d6b8c7e1545d..2019e66eada7 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -773,7 +773,7 @@ static int ide_init_queue(ide_drive_t *drive)
773 q->request_fn = do_ide_request; 773 q->request_fn = do_ide_request;
774 q->initialize_rq_fn = ide_initialize_rq; 774 q->initialize_rq_fn = ide_initialize_rq;
775 q->cmd_size = sizeof(struct ide_request); 775 q->cmd_size = sizeof(struct ide_request);
776 queue_flag_set_unlocked(QUEUE_FLAG_SCSI_PASSTHROUGH, q); 776 blk_queue_flag_set(QUEUE_FLAG_SCSI_PASSTHROUGH, q);
777 if (blk_init_allocated_queue(q) < 0) { 777 if (blk_init_allocated_queue(q) < 0) {
778 blk_cleanup_queue(q); 778 blk_cleanup_queue(q);
779 return 1; 779 return 1;
diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
index 93d671ca518e..5b46924ac66c 100644
--- a/drivers/lightnvm/pblk-init.c
+++ b/drivers/lightnvm/pblk-init.c
@@ -1067,7 +1067,7 @@ static void *pblk_init(struct nvm_tgt_dev *dev, struct gendisk *tdisk,
1067 tqueue->limits.discard_granularity = geo->sec_per_chk * geo->sec_size; 1067 tqueue->limits.discard_granularity = geo->sec_per_chk * geo->sec_size;
1068 tqueue->limits.discard_alignment = 0; 1068 tqueue->limits.discard_alignment = 0;
1069 blk_queue_max_discard_sectors(tqueue, UINT_MAX >> 9); 1069 blk_queue_max_discard_sectors(tqueue, UINT_MAX >> 9);
1070 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, tqueue); 1070 blk_queue_flag_set(QUEUE_FLAG_DISCARD, tqueue);
1071 1071
1072 pr_info("pblk(%s): luns:%u, lines:%d, secs:%llu, buf entries:%u\n", 1072 pr_info("pblk(%s): luns:%u, lines:%d, secs:%llu, buf entries:%u\n",
1073 tdisk->disk_name, 1073 tdisk->disk_name,
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 5fe7ec356c33..54c39ad4ef01 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1861,7 +1861,7 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
1861 q->limits = *limits; 1861 q->limits = *limits;
1862 1862
1863 if (!dm_table_supports_discards(t)) { 1863 if (!dm_table_supports_discards(t)) {
1864 queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, q); 1864 blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
1865 /* Must also clear discard limits... */ 1865 /* Must also clear discard limits... */
1866 q->limits.max_discard_sectors = 0; 1866 q->limits.max_discard_sectors = 0;
1867 q->limits.max_hw_discard_sectors = 0; 1867 q->limits.max_hw_discard_sectors = 0;
@@ -1869,7 +1869,7 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
1869 q->limits.discard_alignment = 0; 1869 q->limits.discard_alignment = 0;
1870 q->limits.discard_misaligned = 0; 1870 q->limits.discard_misaligned = 0;
1871 } else 1871 } else
1872 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q); 1872 blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
1873 1873
1874 if (dm_table_supports_flush(t, (1UL << QUEUE_FLAG_WC))) { 1874 if (dm_table_supports_flush(t, (1UL << QUEUE_FLAG_WC))) {
1875 wc = true; 1875 wc = true;
@@ -1879,15 +1879,15 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
1879 blk_queue_write_cache(q, wc, fua); 1879 blk_queue_write_cache(q, wc, fua);
1880 1880
1881 if (dm_table_supports_dax(t)) 1881 if (dm_table_supports_dax(t))
1882 queue_flag_set_unlocked(QUEUE_FLAG_DAX, q); 1882 blk_queue_flag_set(QUEUE_FLAG_DAX, q);
1883 if (dm_table_supports_dax_write_cache(t)) 1883 if (dm_table_supports_dax_write_cache(t))
1884 dax_write_cache(t->md->dax_dev, true); 1884 dax_write_cache(t->md->dax_dev, true);
1885 1885
1886 /* Ensure that all underlying devices are non-rotational. */ 1886 /* Ensure that all underlying devices are non-rotational. */
1887 if (dm_table_all_devices_attribute(t, device_is_nonrot)) 1887 if (dm_table_all_devices_attribute(t, device_is_nonrot))
1888 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); 1888 blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
1889 else 1889 else
1890 queue_flag_clear_unlocked(QUEUE_FLAG_NONROT, q); 1890 blk_queue_flag_clear(QUEUE_FLAG_NONROT, q);
1891 1891
1892 if (!dm_table_supports_write_same(t)) 1892 if (!dm_table_supports_write_same(t))
1893 q->limits.max_write_same_sectors = 0; 1893 q->limits.max_write_same_sectors = 0;
@@ -1895,9 +1895,9 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
1895 q->limits.max_write_zeroes_sectors = 0; 1895 q->limits.max_write_zeroes_sectors = 0;
1896 1896
1897 if (dm_table_all_devices_attribute(t, queue_supports_sg_merge)) 1897 if (dm_table_all_devices_attribute(t, queue_supports_sg_merge))
1898 queue_flag_clear_unlocked(QUEUE_FLAG_NO_SG_MERGE, q); 1898 blk_queue_flag_clear(QUEUE_FLAG_NO_SG_MERGE, q);
1899 else 1899 else
1900 queue_flag_set_unlocked(QUEUE_FLAG_NO_SG_MERGE, q); 1900 blk_queue_flag_set(QUEUE_FLAG_NO_SG_MERGE, q);
1901 1901
1902 dm_table_verify_integrity(t); 1902 dm_table_verify_integrity(t);
1903 1903
@@ -1908,7 +1908,7 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
1908 * have it set. 1908 * have it set.
1909 */ 1909 */
1910 if (blk_queue_add_random(q) && dm_table_all_devices_attribute(t, device_is_not_random)) 1910 if (blk_queue_add_random(q) && dm_table_all_devices_attribute(t, device_is_not_random))
1911 queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, q); 1911 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q);
1912} 1912}
1913 1913
1914unsigned int dm_table_get_num_targets(struct dm_table *t) 1914unsigned int dm_table_get_num_targets(struct dm_table *t)
diff --git a/drivers/md/md-linear.c b/drivers/md/md-linear.c
index 773fc70dced7..4964323d936b 100644
--- a/drivers/md/md-linear.c
+++ b/drivers/md/md-linear.c
@@ -138,9 +138,9 @@ static struct linear_conf *linear_conf(struct mddev *mddev, int raid_disks)
138 } 138 }
139 139
140 if (!discard_supported) 140 if (!discard_supported)
141 queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, mddev->queue); 141 blk_queue_flag_clear(QUEUE_FLAG_DISCARD, mddev->queue);
142 else 142 else
143 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue); 143 blk_queue_flag_set(QUEUE_FLAG_DISCARD, mddev->queue);
144 144
145 /* 145 /*
146 * Here we calculate the device offsets. 146 * Here we calculate the device offsets.
diff --git a/drivers/md/md.c b/drivers/md/md.c
index eba7fa2f0abb..de2b26fba5d8 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5608,9 +5608,9 @@ int md_run(struct mddev *mddev)
5608 if (mddev->degraded) 5608 if (mddev->degraded)
5609 nonrot = false; 5609 nonrot = false;
5610 if (nonrot) 5610 if (nonrot)
5611 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, mddev->queue); 5611 blk_queue_flag_set(QUEUE_FLAG_NONROT, mddev->queue);
5612 else 5612 else
5613 queue_flag_clear_unlocked(QUEUE_FLAG_NONROT, mddev->queue); 5613 blk_queue_flag_clear(QUEUE_FLAG_NONROT, mddev->queue);
5614 mddev->queue->backing_dev_info->congested_data = mddev; 5614 mddev->queue->backing_dev_info->congested_data = mddev;
5615 mddev->queue->backing_dev_info->congested_fn = md_congested; 5615 mddev->queue->backing_dev_info->congested_fn = md_congested;
5616 } 5616 }
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 5ecba9eef441..584c10347267 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -399,9 +399,9 @@ static int raid0_run(struct mddev *mddev)
399 discard_supported = true; 399 discard_supported = true;
400 } 400 }
401 if (!discard_supported) 401 if (!discard_supported)
402 queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, mddev->queue); 402 blk_queue_flag_clear(QUEUE_FLAG_DISCARD, mddev->queue);
403 else 403 else
404 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue); 404 blk_queue_flag_set(QUEUE_FLAG_DISCARD, mddev->queue);
405 } 405 }
406 406
407 /* calculate array device size */ 407 /* calculate array device size */
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index b2eae332e1a2..f1635eb9e95a 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1760,7 +1760,7 @@ static int raid1_add_disk(struct mddev *mddev, struct md_rdev *rdev)
1760 } 1760 }
1761 } 1761 }
1762 if (mddev->queue && blk_queue_discard(bdev_get_queue(rdev->bdev))) 1762 if (mddev->queue && blk_queue_discard(bdev_get_queue(rdev->bdev)))
1763 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue); 1763 blk_queue_flag_set(QUEUE_FLAG_DISCARD, mddev->queue);
1764 print_conf(conf); 1764 print_conf(conf);
1765 return err; 1765 return err;
1766} 1766}
@@ -3099,10 +3099,10 @@ static int raid1_run(struct mddev *mddev)
3099 3099
3100 if (mddev->queue) { 3100 if (mddev->queue) {
3101 if (discard_supported) 3101 if (discard_supported)
3102 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, 3102 blk_queue_flag_set(QUEUE_FLAG_DISCARD,
3103 mddev->queue); 3103 mddev->queue);
3104 else 3104 else
3105 queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, 3105 blk_queue_flag_clear(QUEUE_FLAG_DISCARD,
3106 mddev->queue); 3106 mddev->queue);
3107 } 3107 }
3108 3108
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 99c9207899a7..e9c409c5f344 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1845,7 +1845,7 @@ static int raid10_add_disk(struct mddev *mddev, struct md_rdev *rdev)
1845 break; 1845 break;
1846 } 1846 }
1847 if (mddev->queue && blk_queue_discard(bdev_get_queue(rdev->bdev))) 1847 if (mddev->queue && blk_queue_discard(bdev_get_queue(rdev->bdev)))
1848 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue); 1848 blk_queue_flag_set(QUEUE_FLAG_DISCARD, mddev->queue);
1849 1849
1850 print_conf(conf); 1850 print_conf(conf);
1851 return err; 1851 return err;
@@ -3844,10 +3844,10 @@ static int raid10_run(struct mddev *mddev)
3844 3844
3845 if (mddev->queue) { 3845 if (mddev->queue) {
3846 if (discard_supported) 3846 if (discard_supported)
3847 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, 3847 blk_queue_flag_set(QUEUE_FLAG_DISCARD,
3848 mddev->queue); 3848 mddev->queue);
3849 else 3849 else
3850 queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, 3850 blk_queue_flag_clear(QUEUE_FLAG_DISCARD,
3851 mddev->queue); 3851 mddev->queue);
3852 } 3852 }
3853 /* need to check that every block has at least one working mirror */ 3853 /* need to check that every block has at least one working mirror */
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 50d01144b805..14714b23a2fa 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7444,10 +7444,10 @@ static int raid5_run(struct mddev *mddev)
7444 if (devices_handle_discard_safely && 7444 if (devices_handle_discard_safely &&
7445 mddev->queue->limits.max_discard_sectors >= (stripe >> 9) && 7445 mddev->queue->limits.max_discard_sectors >= (stripe >> 9) &&
7446 mddev->queue->limits.discard_granularity >= stripe) 7446 mddev->queue->limits.discard_granularity >= stripe)
7447 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, 7447 blk_queue_flag_set(QUEUE_FLAG_DISCARD,
7448 mddev->queue); 7448 mddev->queue);
7449 else 7449 else
7450 queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, 7450 blk_queue_flag_clear(QUEUE_FLAG_DISCARD,
7451 mddev->queue); 7451 mddev->queue);
7452 7452
7453 blk_queue_max_hw_sectors(mddev->queue, UINT_MAX); 7453 blk_queue_max_hw_sectors(mddev->queue, UINT_MAX);
diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
index 421fab7250ac..56e9a803db21 100644
--- a/drivers/mmc/core/queue.c
+++ b/drivers/mmc/core/queue.c
@@ -185,14 +185,14 @@ static void mmc_queue_setup_discard(struct request_queue *q,
185 if (!max_discard) 185 if (!max_discard)
186 return; 186 return;
187 187
188 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q); 188 blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
189 blk_queue_max_discard_sectors(q, max_discard); 189 blk_queue_max_discard_sectors(q, max_discard);
190 q->limits.discard_granularity = card->pref_erase << 9; 190 q->limits.discard_granularity = card->pref_erase << 9;
191 /* granularity must not be greater than max. discard */ 191 /* granularity must not be greater than max. discard */
192 if (card->pref_erase > max_discard) 192 if (card->pref_erase > max_discard)
193 q->limits.discard_granularity = 0; 193 q->limits.discard_granularity = 0;
194 if (mmc_can_secure_erase_trim(card)) 194 if (mmc_can_secure_erase_trim(card))
195 queue_flag_set_unlocked(QUEUE_FLAG_SECERASE, q); 195 blk_queue_flag_set(QUEUE_FLAG_SECERASE, q);
196} 196}
197 197
198/** 198/**
@@ -356,8 +356,8 @@ static void mmc_setup_queue(struct mmc_queue *mq, struct mmc_card *card)
356 if (mmc_dev(host)->dma_mask && *mmc_dev(host)->dma_mask) 356 if (mmc_dev(host)->dma_mask && *mmc_dev(host)->dma_mask)
357 limit = (u64)dma_max_pfn(mmc_dev(host)) << PAGE_SHIFT; 357 limit = (u64)dma_max_pfn(mmc_dev(host)) << PAGE_SHIFT;
358 358
359 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, mq->queue); 359 blk_queue_flag_set(QUEUE_FLAG_NONROT, mq->queue);
360 queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, mq->queue); 360 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, mq->queue);
361 if (mmc_can_erase(card)) 361 if (mmc_can_erase(card))
362 mmc_queue_setup_discard(mq->queue, card); 362 mmc_queue_setup_discard(mq->queue, card);
363 363
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 9ec8f033ac5f..16ae4ae8e8f9 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -419,11 +419,11 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
419 blk_queue_logical_block_size(new->rq, tr->blksize); 419 blk_queue_logical_block_size(new->rq, tr->blksize);
420 420
421 blk_queue_bounce_limit(new->rq, BLK_BOUNCE_HIGH); 421 blk_queue_bounce_limit(new->rq, BLK_BOUNCE_HIGH);
422 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, new->rq); 422 blk_queue_flag_set(QUEUE_FLAG_NONROT, new->rq);
423 queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, new->rq); 423 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, new->rq);
424 424
425 if (tr->discard) { 425 if (tr->discard) {
426 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, new->rq); 426 blk_queue_flag_set(QUEUE_FLAG_DISCARD, new->rq);
427 blk_queue_max_discard_sectors(new->rq, UINT_MAX); 427 blk_queue_max_discard_sectors(new->rq, UINT_MAX);
428 } 428 }
429 429
diff --git a/drivers/nvdimm/blk.c b/drivers/nvdimm/blk.c
index 345acca576b3..7bde764f939a 100644
--- a/drivers/nvdimm/blk.c
+++ b/drivers/nvdimm/blk.c
@@ -266,7 +266,7 @@ static int nsblk_attach_disk(struct nd_namespace_blk *nsblk)
266 blk_queue_make_request(q, nd_blk_make_request); 266 blk_queue_make_request(q, nd_blk_make_request);
267 blk_queue_max_hw_sectors(q, UINT_MAX); 267 blk_queue_max_hw_sectors(q, UINT_MAX);
268 blk_queue_logical_block_size(q, nsblk_sector_size(nsblk)); 268 blk_queue_logical_block_size(q, nsblk_sector_size(nsblk));
269 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); 269 blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
270 q->queuedata = nsblk; 270 q->queuedata = nsblk;
271 271
272 disk = alloc_disk(0); 272 disk = alloc_disk(0);
diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
index 2ef544f10ec8..6f311f88a8e8 100644
--- a/drivers/nvdimm/btt.c
+++ b/drivers/nvdimm/btt.c
@@ -1542,7 +1542,7 @@ static int btt_blk_init(struct btt *btt)
1542 blk_queue_make_request(btt->btt_queue, btt_make_request); 1542 blk_queue_make_request(btt->btt_queue, btt_make_request);
1543 blk_queue_logical_block_size(btt->btt_queue, btt->sector_size); 1543 blk_queue_logical_block_size(btt->btt_queue, btt->sector_size);
1544 blk_queue_max_hw_sectors(btt->btt_queue, UINT_MAX); 1544 blk_queue_max_hw_sectors(btt->btt_queue, UINT_MAX);
1545 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, btt->btt_queue); 1545 blk_queue_flag_set(QUEUE_FLAG_NONROT, btt->btt_queue);
1546 btt->btt_queue->queuedata = btt; 1546 btt->btt_queue->queuedata = btt;
1547 1547
1548 set_capacity(btt->btt_disk, 0); 1548 set_capacity(btt->btt_disk, 0);
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index cfb15ac50925..145db2ad712f 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -388,8 +388,8 @@ static int pmem_attach_disk(struct device *dev,
388 blk_queue_physical_block_size(q, PAGE_SIZE); 388 blk_queue_physical_block_size(q, PAGE_SIZE);
389 blk_queue_logical_block_size(q, pmem_sector_size(ndns)); 389 blk_queue_logical_block_size(q, pmem_sector_size(ndns));
390 blk_queue_max_hw_sectors(q, UINT_MAX); 390 blk_queue_max_hw_sectors(q, UINT_MAX);
391 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); 391 blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
392 queue_flag_set_unlocked(QUEUE_FLAG_DAX, q); 392 blk_queue_flag_set(QUEUE_FLAG_DAX, q);
393 q->queuedata = pmem; 393 q->queuedata = pmem;
394 394
395 disk = alloc_disk_node(0, nid); 395 disk = alloc_disk_node(0, nid);
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 817e5e2766da..72e241923e7d 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1358,7 +1358,7 @@ static void nvme_config_discard(struct nvme_ctrl *ctrl,
1358 1358
1359 blk_queue_max_discard_sectors(queue, UINT_MAX); 1359 blk_queue_max_discard_sectors(queue, UINT_MAX);
1360 blk_queue_max_discard_segments(queue, NVME_DSM_MAX_RANGES); 1360 blk_queue_max_discard_segments(queue, NVME_DSM_MAX_RANGES);
1361 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, queue); 1361 blk_queue_flag_set(QUEUE_FLAG_DISCARD, queue);
1362 1362
1363 if (ctrl->quirks & NVME_QUIRK_DEALLOCATE_ZEROES) 1363 if (ctrl->quirks & NVME_QUIRK_DEALLOCATE_ZEROES)
1364 blk_queue_max_write_zeroes_sectors(queue, UINT_MAX); 1364 blk_queue_max_write_zeroes_sectors(queue, UINT_MAX);
@@ -2949,7 +2949,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
2949 ns->queue = blk_mq_init_queue(ctrl->tagset); 2949 ns->queue = blk_mq_init_queue(ctrl->tagset);
2950 if (IS_ERR(ns->queue)) 2950 if (IS_ERR(ns->queue))
2951 goto out_free_ns; 2951 goto out_free_ns;
2952 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, ns->queue); 2952 blk_queue_flag_set(QUEUE_FLAG_NONROT, ns->queue);
2953 ns->queue->queuedata = ns; 2953 ns->queue->queuedata = ns;
2954 ns->ctrl = ctrl; 2954 ns->ctrl = ctrl;
2955 2955
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 88440562a197..7283d7149baf 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -168,7 +168,7 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl, struct nvme_ns_head *head)
168 q->queuedata = head; 168 q->queuedata = head;
169 blk_queue_make_request(q, nvme_ns_head_make_request); 169 blk_queue_make_request(q, nvme_ns_head_make_request);
170 q->poll_fn = nvme_ns_head_poll; 170 q->poll_fn = nvme_ns_head_poll;
171 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); 171 blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
172 /* set to a default value for 512 until disk is validated */ 172 /* set to a default value for 512 until disk is validated */
173 blk_queue_logical_block_size(q, 512); 173 blk_queue_logical_block_size(q, 512);
174 174
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index a7c15f0085e2..7be803afcb43 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -3210,7 +3210,7 @@ static void dasd_setup_queue(struct dasd_block *block)
3210 } else { 3210 } else {
3211 max = block->base->discipline->max_blocks << block->s2b_shift; 3211 max = block->base->discipline->max_blocks << block->s2b_shift;
3212 } 3212 }
3213 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); 3213 blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
3214 q->limits.max_dev_sectors = max; 3214 q->limits.max_dev_sectors = max;
3215 blk_queue_logical_block_size(q, logical_block_size); 3215 blk_queue_logical_block_size(q, logical_block_size);
3216 blk_queue_max_hw_sectors(q, max); 3216 blk_queue_max_hw_sectors(q, max);
@@ -3233,7 +3233,7 @@ static void dasd_setup_queue(struct dasd_block *block)
3233 3233
3234 blk_queue_max_discard_sectors(q, max_discard_sectors); 3234 blk_queue_max_discard_sectors(q, max_discard_sectors);
3235 blk_queue_max_write_zeroes_sectors(q, max_discard_sectors); 3235 blk_queue_max_write_zeroes_sectors(q, max_discard_sectors);
3236 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q); 3236 blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
3237 } 3237 }
3238} 3238}
3239 3239
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
index 9cae08b36b80..0a312e450207 100644
--- a/drivers/s390/block/dcssblk.c
+++ b/drivers/s390/block/dcssblk.c
@@ -633,7 +633,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
633 dev_info->gd->private_data = dev_info; 633 dev_info->gd->private_data = dev_info;
634 blk_queue_make_request(dev_info->dcssblk_queue, dcssblk_make_request); 634 blk_queue_make_request(dev_info->dcssblk_queue, dcssblk_make_request);
635 blk_queue_logical_block_size(dev_info->dcssblk_queue, 4096); 635 blk_queue_logical_block_size(dev_info->dcssblk_queue, 4096);
636 queue_flag_set_unlocked(QUEUE_FLAG_DAX, dev_info->dcssblk_queue); 636 blk_queue_flag_set(QUEUE_FLAG_DAX, dev_info->dcssblk_queue);
637 637
638 seg_byte_size = (dev_info->end - dev_info->start + 1); 638 seg_byte_size = (dev_info->end - dev_info->start + 1);
639 set_capacity(dev_info->gd, seg_byte_size >> 9); // size in sectors 639 set_capacity(dev_info->gd, seg_byte_size >> 9); // size in sectors
diff --git a/drivers/s390/block/scm_blk.c b/drivers/s390/block/scm_blk.c
index b4130c7880d8..b1fcb76dd272 100644
--- a/drivers/s390/block/scm_blk.c
+++ b/drivers/s390/block/scm_blk.c
@@ -472,8 +472,8 @@ int scm_blk_dev_setup(struct scm_blk_dev *bdev, struct scm_device *scmdev)
472 blk_queue_logical_block_size(rq, 1 << 12); 472 blk_queue_logical_block_size(rq, 1 << 12);
473 blk_queue_max_hw_sectors(rq, nr_max_blk << 3); /* 8 * 512 = blk_size */ 473 blk_queue_max_hw_sectors(rq, nr_max_blk << 3); /* 8 * 512 = blk_size */
474 blk_queue_max_segments(rq, nr_max_blk); 474 blk_queue_max_segments(rq, nr_max_blk);
475 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, rq); 475 blk_queue_flag_set(QUEUE_FLAG_NONROT, rq);
476 queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, rq); 476 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, rq);
477 477
478 bdev->gendisk = alloc_disk(SCM_NR_PARTS); 478 bdev->gendisk = alloc_disk(SCM_NR_PARTS);
479 if (!bdev->gendisk) { 479 if (!bdev->gendisk) {
diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c
index 2a6334ca750e..3df5d68d09f0 100644
--- a/drivers/s390/block/xpram.c
+++ b/drivers/s390/block/xpram.c
@@ -348,8 +348,8 @@ static int __init xpram_setup_blkdev(void)
348 put_disk(xpram_disks[i]); 348 put_disk(xpram_disks[i]);
349 goto out; 349 goto out;
350 } 350 }
351 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, xpram_queues[i]); 351 blk_queue_flag_set(QUEUE_FLAG_NONROT, xpram_queues[i]);
352 queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, xpram_queues[i]); 352 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, xpram_queues[i]);
353 blk_queue_make_request(xpram_queues[i], xpram_make_request); 353 blk_queue_make_request(xpram_queues[i], xpram_make_request);
354 blk_queue_logical_block_size(xpram_queues[i], 4096); 354 blk_queue_logical_block_size(xpram_queues[i], 4096);
355 } 355 }
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index a71ee67df084..dc234650014c 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -1864,7 +1864,7 @@ megasas_set_nvme_device_properties(struct scsi_device *sdev, u32 max_io_size)
1864 1864
1865 blk_queue_max_hw_sectors(sdev->request_queue, (max_io_size / 512)); 1865 blk_queue_max_hw_sectors(sdev->request_queue, (max_io_size / 512));
1866 1866
1867 queue_flag_set_unlocked(QUEUE_FLAG_NOMERGES, sdev->request_queue); 1867 blk_queue_flag_set(QUEUE_FLAG_NOMERGES, sdev->request_queue);
1868 blk_queue_virt_boundary(sdev->request_queue, mr_nvme_pg_size - 1); 1868 blk_queue_virt_boundary(sdev->request_queue, mr_nvme_pg_size - 1);
1869} 1869}
1870 1870
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 073ced07e662..298019cf08a2 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -1908,7 +1908,7 @@ megasas_is_prp_possible(struct megasas_instance *instance,
1908 * then sending IOs with holes. 1908 * then sending IOs with holes.
1909 * 1909 *
1910 * Though driver can request block layer to disable IO merging by calling- 1910 * Though driver can request block layer to disable IO merging by calling-
1911 * queue_flag_set_unlocked(QUEUE_FLAG_NOMERGES, sdev->request_queue) but 1911 * blk_queue_flag_set(QUEUE_FLAG_NOMERGES, sdev->request_queue) but
1912 * user may tune sysfs parameter- nomerges again to 0 or 1. 1912 * user may tune sysfs parameter- nomerges again to 0 or 1.
1913 * 1913 *
1914 * If in future IO scheduling is enabled with SCSI BLK MQ, 1914 * If in future IO scheduling is enabled with SCSI BLK MQ,
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 74fca184dba9..e3843828e59a 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -2352,7 +2352,7 @@ scsih_slave_configure(struct scsi_device *sdev)
2352 ** merged and can eliminate holes created during merging 2352 ** merged and can eliminate holes created during merging
2353 ** operation. 2353 ** operation.
2354 **/ 2354 **/
2355 queue_flag_set_unlocked(QUEUE_FLAG_NOMERGES, 2355 blk_queue_flag_set(QUEUE_FLAG_NOMERGES,
2356 sdev->request_queue); 2356 sdev->request_queue);
2357 blk_queue_virt_boundary(sdev->request_queue, 2357 blk_queue_virt_boundary(sdev->request_queue,
2358 ioc->page_size - 1); 2358 ioc->page_size - 1);
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index a5986dae9020..1cb353f18d08 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -3897,7 +3897,7 @@ static int scsi_debug_slave_alloc(struct scsi_device *sdp)
3897 if (sdebug_verbose) 3897 if (sdebug_verbose)
3898 pr_info("slave_alloc <%u %u %u %llu>\n", 3898 pr_info("slave_alloc <%u %u %u %llu>\n",
3899 sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); 3899 sdp->host->host_no, sdp->channel, sdp->id, sdp->lun);
3900 queue_flag_set_unlocked(QUEUE_FLAG_BIDI, sdp->request_queue); 3900 blk_queue_flag_set(QUEUE_FLAG_BIDI, sdp->request_queue);
3901 return 0; 3901 return 0;
3902} 3902}
3903 3903
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 71d1135f94d0..538152f3528e 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -2140,7 +2140,7 @@ void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q)
2140{ 2140{
2141 struct device *dev = shost->dma_dev; 2141 struct device *dev = shost->dma_dev;
2142 2142
2143 queue_flag_set_unlocked(QUEUE_FLAG_SCSI_PASSTHROUGH, q); 2143 blk_queue_flag_set(QUEUE_FLAG_SCSI_PASSTHROUGH, q);
2144 2144
2145 /* 2145 /*
2146 * this limit is imposed by hardware restrictions 2146 * this limit is imposed by hardware restrictions
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index 736a1f4f9676..7c0987616684 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -227,8 +227,8 @@ static int sas_bsg_initialize(struct Scsi_Host *shost, struct sas_rphy *rphy)
227 * by default assume old behaviour and bounce for any highmem page 227 * by default assume old behaviour and bounce for any highmem page
228 */ 228 */
229 blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH); 229 blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH);
230 queue_flag_set_unlocked(QUEUE_FLAG_BIDI, q); 230 blk_queue_flag_set(QUEUE_FLAG_BIDI, q);
231 queue_flag_set_unlocked(QUEUE_FLAG_SCSI_PASSTHROUGH, q); 231 blk_queue_flag_set(QUEUE_FLAG_SCSI_PASSTHROUGH, q);
232 return 0; 232 return 0;
233} 233}
234 234
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index bff21e636ddd..98de3207ac5d 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -714,7 +714,7 @@ static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode)
714 case SD_LBP_FULL: 714 case SD_LBP_FULL:
715 case SD_LBP_DISABLE: 715 case SD_LBP_DISABLE:
716 blk_queue_max_discard_sectors(q, 0); 716 blk_queue_max_discard_sectors(q, 0);
717 queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, q); 717 blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
718 return; 718 return;
719 719
720 case SD_LBP_UNMAP: 720 case SD_LBP_UNMAP:
@@ -747,7 +747,7 @@ static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode)
747 } 747 }
748 748
749 blk_queue_max_discard_sectors(q, max_blocks * (logical_block_size >> 9)); 749 blk_queue_max_discard_sectors(q, max_blocks * (logical_block_size >> 9));
750 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q); 750 blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
751} 751}
752 752
753static int sd_setup_unmap_cmnd(struct scsi_cmnd *cmd) 753static int sd_setup_unmap_cmnd(struct scsi_cmnd *cmd)
@@ -2952,8 +2952,8 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp)
2952 rot = get_unaligned_be16(&buffer[4]); 2952 rot = get_unaligned_be16(&buffer[4]);
2953 2953
2954 if (rot == 1) { 2954 if (rot == 1) {
2955 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); 2955 blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
2956 queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, q); 2956 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q);
2957 } 2957 }
2958 2958
2959 if (sdkp->device->type == TYPE_ZBC) { 2959 if (sdkp->device->type == TYPE_ZBC) {