Add support for kernel v6.9

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
This commit is contained in:
Robert Baldyga 2024-07-05 15:27:17 +02:00
parent 4ad71a55b6
commit d3a1ce8987
4 changed files with 46 additions and 4 deletions

View File

@ -20,6 +20,9 @@ check() {
elif compile_module $cur_name "bdev_open_by_path(NULL, 0, NULL, NULL);" "linux/blkdev.h" elif compile_module $cur_name "bdev_open_by_path(NULL, 0, NULL, NULL);" "linux/blkdev.h"
then then
echo $cur_name 3 >> $config_file_path echo $cur_name 3 >> $config_file_path
elif compile_module $cur_name "bdev_file_open_by_path(NULL, 0, NULL, NULL);" "linux/blkdev.h"
then
echo $cur_name 4 >> $config_file_path
else else
echo $cur_name X >> $config_file_path echo $cur_name X >> $config_file_path
fi fi
@ -45,6 +48,12 @@ apply() {
bdev_open_by_path(path, mode, holder, NULL)" bdev_open_by_path(path, mode, holder, NULL)"
add_define "cas_bdev_get_from_handle(handle) \\ add_define "cas_bdev_get_from_handle(handle) \\
(handle->bdev)" ;; (handle->bdev)" ;;
"4")
add_typedef "struct file *cas_bdev_handle_t;"
add_define "cas_bdev_open_by_path(path, mode, holder) \\
bdev_file_open_by_path(path, mode, holder, NULL)"
add_define "cas_bdev_get_from_handle(handle) \\
file_bdev(handle)" ;;
*) *)
exit 1 exit 1
esac esac

View File

@ -20,6 +20,9 @@ check() {
elif compile_module $cur_name "bdev_release(NULL);" "linux/blkdev.h" elif compile_module $cur_name "bdev_release(NULL);" "linux/blkdev.h"
then then
echo $cur_name 3 >> $config_file_path echo $cur_name 3 >> $config_file_path
elif compile_module $cur_name "bdev_file_open_by_path(NULL, 0, NULL, NULL);" "linux/blkdev.h"
then
echo $cur_name 4 >> $config_file_path
else else
echo $cur_name X >> $config_file_path echo $cur_name X >> $config_file_path
fi fi
@ -36,6 +39,9 @@ apply() {
"3") "3")
add_define "cas_bdev_release(handle, mode, holder) \\ add_define "cas_bdev_release(handle, mode, holder) \\
bdev_release(handle)" ;; bdev_release(handle)" ;;
"4")
add_define "cas_bdev_release(handle, mode, holder) \\
fput(handle)" ;;
*) *)
exit 1 exit 1
esac esac

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# Copyright(c) 2012-2022 Intel Corporation # Copyright(c) 2012-2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# #
@ -10,17 +11,43 @@
check() { check() {
cur_name=$(basename $2) cur_name=$(basename $2)
config_file_path=$1 config_file_path=$1
if compile_module $cur_name "blk_mq_alloc_disk(NULL, NULL);" "linux/blk-mq.h" if compile_module $cur_name "blk_mq_alloc_disk(NULL, NULL, NULL);" "linux/blk-mq.h"
then then
echo $cur_name 1 >> $config_file_path echo $cur_name 1 >> $config_file_path
else elif compile_module $cur_name "blk_mq_alloc_disk(NULL, NULL);" "linux/blk-mq.h"
then
echo $cur_name 2 >> $config_file_path echo $cur_name 2 >> $config_file_path
elif compile_module $cur_name "alloc_disk(0);" "linux/genhd.h"
then
echo $cur_name 3 >> $config_file_path
else
echo $cur_name X >> $config_file_path
fi fi
} }
apply() { apply() {
case "$1" in case "$1" in
"1") "1")
add_function "
static inline int cas_alloc_mq_disk(struct gendisk **gd, struct request_queue **queue,
struct blk_mq_tag_set *tag_set)
{
*gd = blk_mq_alloc_disk(tag_set, NULL, NULL);
if (!(*gd))
return -ENOMEM;
*queue = (*gd)->queue;
return 0;
}"
add_function "
static inline void cas_cleanup_mq_disk(struct gendisk *gd)
{
cas_cleanup_disk(gd);
}"
;;
"2")
add_function " add_function "
static inline int cas_alloc_mq_disk(struct gendisk **gd, struct request_queue **queue, static inline int cas_alloc_mq_disk(struct gendisk **gd, struct request_queue **queue,
struct blk_mq_tag_set *tag_set) struct blk_mq_tag_set *tag_set)
@ -40,7 +67,7 @@ apply() {
}" }"
;; ;;
"2") "3")
add_function " add_function "
static inline int cas_alloc_mq_disk(struct gendisk **gd, struct request_queue **queue, static inline int cas_alloc_mq_disk(struct gendisk **gd, struct request_queue **queue,

2
ocf

@ -1 +1 @@
Subproject commit 7c8ac29ab982eb33abd42c9049fe42ddc491a7b2 Subproject commit 283a897eebfd00fd14df271b03861898947de1d3