Merge pull request #99 from micrakow/blk_mq_map_queue

cas_disk: Add mandatory blk_mq_ops filed required by some kernels
This commit is contained in:
Robert Bałdyga 2019-09-11 12:46:53 +02:00 committed by GitHub
commit 78e8d35c2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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; 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) const struct blk_mq_queue_data *bd)
{ {
struct casdsk_disk *dsk = hctx->driver_data; 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 = { 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) static void _casdsk_init_queues(struct casdsk_disk *dsk)