blk-mq: constify struct blk_mq_ops
authorEric Biggers <ebiggers@google.com>
Thu, 30 Mar 2017 20:39:16 +0000 (13:39 -0700)
committerJens Axboe <axboe@fb.com>
Fri, 31 Mar 2017 14:28:58 +0000 (08:28 -0600)
Constify all instances of blk_mq_ops, as they are never modified.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
14 files changed:
drivers/block/loop.c
drivers/block/mtip32xx/mtip32xx.c
drivers/block/nbd.c
drivers/block/null_blk.c
drivers/block/rbd.c
drivers/block/virtio_blk.c
drivers/block/xen-blkfront.c
drivers/md/dm-rq.c
drivers/mtd/ubi/block.c
drivers/nvme/host/fc.c
drivers/nvme/host/pci.c
drivers/nvme/host/rdma.c
drivers/nvme/target/loop.c
drivers/scsi/scsi_lib.c

index 0ecb6461ed81e20b5483b0622850d0cb64e3b642..cc981f34e0177022c31be6711de53b25742076c2 100644 (file)
@@ -1710,7 +1710,7 @@ static int loop_init_request(void *data, struct request *rq,
        return 0;
 }
 
-static struct blk_mq_ops loop_mq_ops = {
+static const struct blk_mq_ops loop_mq_ops = {
        .queue_rq       = loop_queue_rq,
        .init_request   = loop_init_request,
 };
index c96c35ab39dffed324fc568fb679a7a72826c8b6..30076e7753bc70bfe7c2a0f8d0381958fa94ab39 100644 (file)
@@ -3889,7 +3889,7 @@ exit_handler:
        return BLK_EH_RESET_TIMER;
 }
 
-static struct blk_mq_ops mtip_mq_ops = {
+static const struct blk_mq_ops mtip_mq_ops = {
        .queue_rq       = mtip_queue_rq,
        .init_request   = mtip_init_cmd,
        .exit_request   = mtip_free_cmd,
index 7e4287bc19e52991a82cf218906fe7384112921b..d3be8ea2f80dc4dcb177134e2fe9ae6ab5a8a77b 100644 (file)
@@ -965,7 +965,7 @@ static int nbd_init_request(void *data, struct request *rq,
        return 0;
 }
 
-static struct blk_mq_ops nbd_mq_ops = {
+static const struct blk_mq_ops nbd_mq_ops = {
        .queue_rq       = nbd_queue_rq,
        .init_request   = nbd_init_request,
        .timeout        = nbd_xmit_timeout,
index 444f8d88f1a81eb27d8a05a053b2105ac9b4c5f4..f93906ff31e8ee2eeccbb9b528f1973202c1770a 100644 (file)
@@ -398,7 +398,7 @@ static int null_init_hctx(struct blk_mq_hw_ctx *hctx, void *data,
        return 0;
 }
 
-static struct blk_mq_ops null_mq_ops = {
+static const struct blk_mq_ops null_mq_ops = {
        .queue_rq       = null_queue_rq,
        .init_hctx      = null_init_hctx,
        .complete       = null_softirq_done_fn,
index 517838b659646d3e02bd0a2ba9e5de2bdf8539f8..f24ade333e0c2b9ab3411cc3f99de5405e1b0f6a 100644 (file)
@@ -4317,7 +4317,7 @@ static int rbd_init_request(void *data, struct request *rq,
        return 0;
 }
 
-static struct blk_mq_ops rbd_mq_ops = {
+static const struct blk_mq_ops rbd_mq_ops = {
        .queue_rq       = rbd_queue_rq,
        .init_request   = rbd_init_request,
 };
index 1d4c9f8bc1e16e012aba5d98a54b3e0f55e40565..2d82901692714225c5212a530693e5128e041e93 100644 (file)
@@ -597,7 +597,7 @@ static int virtblk_map_queues(struct blk_mq_tag_set *set)
        return blk_mq_virtio_map_queues(set, vblk->vdev, 0);
 }
 
-static struct blk_mq_ops virtio_mq_ops = {
+static const struct blk_mq_ops virtio_mq_ops = {
        .queue_rq       = virtio_queue_rq,
        .complete       = virtblk_request_done,
        .init_request   = virtblk_init_request,
index 5067a0a952cb2161aec7da6168adfcb874aa02bc..d137ef8a72be9f4be226b6a5da306c8a074e799e 100644 (file)
@@ -907,7 +907,7 @@ out_busy:
        return BLK_MQ_RQ_QUEUE_BUSY;
 }
 
-static struct blk_mq_ops blkfront_mq_ops = {
+static const struct blk_mq_ops blkfront_mq_ops = {
        .queue_rq = blkif_queue_rq,
 };
 
index 28955b94d2b26f47d7c54217d84c2a8a11af692a..6886bf160fb23fc6673a60055f2731abeebe4eec 100644 (file)
@@ -761,7 +761,7 @@ static int dm_mq_queue_rq(struct blk_mq_hw_ctx *hctx,
        return BLK_MQ_RQ_QUEUE_OK;
 }
 
-static struct blk_mq_ops dm_mq_ops = {
+static const struct blk_mq_ops dm_mq_ops = {
        .queue_rq = dm_mq_queue_rq,
        .complete = dm_softirq_done,
        .init_request = dm_mq_init_request,
index c80869e60909c91f66ea4a1bb532bd18368e724d..51f2be8889b575cdc1a1f207696d41d620753108 100644 (file)
@@ -347,7 +347,7 @@ static int ubiblock_init_request(void *data, struct request *req,
        return 0;
 }
 
-static struct blk_mq_ops ubiblock_mq_ops = {
+static const struct blk_mq_ops ubiblock_mq_ops = {
        .queue_rq       = ubiblock_queue_rq,
        .init_request   = ubiblock_init_request,
 };
index 9690beb15e69ab47bb04345da5f142ec56141035..5939a0a4f7a5282ee9eaaf23992b05532cced04b 100644 (file)
@@ -1948,7 +1948,7 @@ nvme_fc_complete_rq(struct request *rq)
        blk_mq_end_request(rq, error);
 }
 
-static struct blk_mq_ops nvme_fc_mq_ops = {
+static const struct blk_mq_ops nvme_fc_mq_ops = {
        .queue_rq       = nvme_fc_queue_rq,
        .complete       = nvme_fc_complete_rq,
        .init_request   = nvme_fc_init_request,
@@ -1959,7 +1959,7 @@ static struct blk_mq_ops nvme_fc_mq_ops = {
        .timeout        = nvme_fc_timeout,
 };
 
-static struct blk_mq_ops nvme_fc_admin_mq_ops = {
+static const struct blk_mq_ops nvme_fc_admin_mq_ops = {
        .queue_rq       = nvme_fc_queue_rq,
        .complete       = nvme_fc_complete_rq,
        .init_request   = nvme_fc_init_admin_request,
index 26a5fd05fe88aa003a00dc4ece6e9900bd95e618..095b061416bfe2170054159713303cdc5397ad72 100644 (file)
@@ -1129,7 +1129,7 @@ static int nvme_create_queue(struct nvme_queue *nvmeq, int qid)
        return result;
 }
 
-static struct blk_mq_ops nvme_mq_admin_ops = {
+static const struct blk_mq_ops nvme_mq_admin_ops = {
        .queue_rq       = nvme_queue_rq,
        .complete       = nvme_complete_rq,
        .init_hctx      = nvme_admin_init_hctx,
@@ -1138,7 +1138,7 @@ static struct blk_mq_ops nvme_mq_admin_ops = {
        .timeout        = nvme_timeout,
 };
 
-static struct blk_mq_ops nvme_mq_ops = {
+static const struct blk_mq_ops nvme_mq_ops = {
        .queue_rq       = nvme_queue_rq,
        .complete       = nvme_complete_rq,
        .init_hctx      = nvme_init_hctx,
index 779f516e7a4ec405ff919f9b248d21ff0f748b8b..3a677a43450f2870242c732112ca6cc0be474448 100644 (file)
@@ -1517,7 +1517,7 @@ static void nvme_rdma_complete_rq(struct request *rq)
        blk_mq_end_request(rq, error);
 }
 
-static struct blk_mq_ops nvme_rdma_mq_ops = {
+static const struct blk_mq_ops nvme_rdma_mq_ops = {
        .queue_rq       = nvme_rdma_queue_rq,
        .complete       = nvme_rdma_complete_rq,
        .init_request   = nvme_rdma_init_request,
@@ -1528,7 +1528,7 @@ static struct blk_mq_ops nvme_rdma_mq_ops = {
        .timeout        = nvme_rdma_timeout,
 };
 
-static struct blk_mq_ops nvme_rdma_admin_mq_ops = {
+static const struct blk_mq_ops nvme_rdma_admin_mq_ops = {
        .queue_rq       = nvme_rdma_queue_rq,
        .complete       = nvme_rdma_complete_rq,
        .init_request   = nvme_rdma_init_admin_request,
index d1f06e7768ff1d7ff6ee787ff6d94eb01576252f..4bfb285c32e812b234d04555677e2de99fd40d2c 100644 (file)
@@ -270,7 +270,7 @@ static int nvme_loop_init_admin_hctx(struct blk_mq_hw_ctx *hctx, void *data,
        return 0;
 }
 
-static struct blk_mq_ops nvme_loop_mq_ops = {
+static const struct blk_mq_ops nvme_loop_mq_ops = {
        .queue_rq       = nvme_loop_queue_rq,
        .complete       = nvme_loop_complete_rq,
        .init_request   = nvme_loop_init_request,
@@ -278,7 +278,7 @@ static struct blk_mq_ops nvme_loop_mq_ops = {
        .timeout        = nvme_loop_timeout,
 };
 
-static struct blk_mq_ops nvme_loop_admin_mq_ops = {
+static const struct blk_mq_ops nvme_loop_admin_mq_ops = {
        .queue_rq       = nvme_loop_queue_rq,
        .complete       = nvme_loop_complete_rq,
        .init_request   = nvme_loop_init_admin_request,
index 19125d72f322c934d84d2d71c748ca9c08418846..c1519660824b63d6e8cd428fea3786992f021f3c 100644 (file)
@@ -2154,7 +2154,7 @@ struct request_queue *scsi_alloc_queue(struct scsi_device *sdev)
        return q;
 }
 
-static struct blk_mq_ops scsi_mq_ops = {
+static const struct blk_mq_ops scsi_mq_ops = {
        .queue_rq       = scsi_queue_rq,
        .complete       = scsi_softirq_done,
        .timeout        = scsi_timeout,