open-cas-linux/configure.d/1_bdev_release.conf
Robert Baldyga b9aa65f254 Add support for Linux kernel up to 6.8
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-05-14 08:47:45 +02:00

45 lines
1.0 KiB
Bash

#!/bin/bash
#
# Copyright(c) 2012-2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies
# SPDX-License-Identifier: BSD-3-Clause
#
. $(dirname $3)/conf_framework.sh
check() {
cur_name=$(basename $2)
config_file_path=$1
if compile_module $cur_name "blkdev_put(NULL, FMODE_READ);" "linux/blkdev.h"
then
echo $cur_name 1 >> $config_file_path
elif compile_module $cur_name "blkdev_put(NULL, NULL);" "linux/blkdev.h"
then
echo $cur_name 2 >> $config_file_path
elif compile_module $cur_name "bdev_release(NULL);" "linux/blkdev.h"
then
echo $cur_name 3 >> $config_file_path
else
echo $cur_name X >> $config_file_path
fi
}
apply() {
case "$1" in
"1")
add_define "cas_bdev_release(handle, mode, holder) \\
blkdev_put((struct block_device *)handle, mode)" ;;
"2")
add_define "cas_bdev_release(handle, mode, holder) \\
blkdev_put((struct block_device *)handle, holder)" ;;
"3")
add_define "cas_bdev_release(handle, mode, holder) \\
bdev_release(handle)" ;;
*)
exit 1
esac
}
conf_run $@