Commit f363b089 authored by Eric Biggers's avatar Eric Biggers Committed by Jens Axboe

blk-mq: constify struct blk_mq_ops

Constify all instances of blk_mq_ops, as they are never modified.
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent db5bcf87
......@@ -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,
};
......
......@@ -3889,7 +3889,7 @@ static enum blk_eh_timer_return mtip_cmd_timeout(struct request *req,
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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
};
......
......@@ -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,
......
......@@ -907,7 +907,7 @@ static int blkif_queue_rq(struct blk_mq_hw_ctx *hctx,
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,
};
......
......@@ -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,
......
......@@ -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,
};
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment