cas_disk: Add mandatory blk_mq_ops filed required by some kernels

Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
This commit is contained in:
Michal Rakowski 2019-09-10 16:05:32 +02:00
parent 422e5a1031
commit f015dea539
2 changed files with 37 additions and 2 deletions

32
configure.d/1_blk_mq.conf Normal file
View File

@ -0,0 +1,32 @@
#!/bin/bash
#
# Copyright(c) 2012-2019 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
. $(dirname $3)/conf_framework
check() {
cur_name=$(basename $2)
config_file_path=$1
if compile_module $cur_name "struct blk_mq_ops ops; ops.map_queue;" "linux/blk-mq.h"
then
echo $cur_name "1" >> $config_file_path
else
echo $cur_name "2" >> $config_file_path
fi
}
apply() {
case "$1" in
"1")
add_define "CAS_BLK_MQ_OPS_MAP_QUEUE" ;;
"2")
return 0 ;;
*)
exit 1
esac
}
conf_run $@

View File

@ -428,7 +428,7 @@ static int _casdsk_exp_obj_init_kobject(struct casdsk_disk *dsk)
return result;
}
static CAS_BLK_STATUS_T _casdsk_exp_obj_queue_qr(struct blk_mq_hw_ctx *hctx,
static CAS_BLK_STATUS_T _casdsk_exp_obj_queue_rq(struct blk_mq_hw_ctx *hctx,
const struct blk_mq_queue_data *bd)
{
struct casdsk_disk *dsk = hctx->driver_data;
@ -456,7 +456,10 @@ static CAS_BLK_STATUS_T _casdsk_exp_obj_queue_qr(struct blk_mq_hw_ctx *hctx,
}
static struct blk_mq_ops casdsk_mq_ops = {
.queue_rq = _casdsk_exp_obj_queue_qr,
.queue_rq = _casdsk_exp_obj_queue_rq,
#ifdef CAS_BLK_MQ_OPS_MAP_QUEUE
.map_queue = blk_mq_map_queue,
#endif
};
static void _casdsk_init_queues(struct casdsk_disk *dsk)