-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Linux kernel up to 6.8
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
- Loading branch information
1 parent
038d395
commit 977a4c6
Showing
11 changed files
with
145 additions
and
82 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright(c) 2012-2022 Intel Corporation | ||
# Copyright(c) 2023-2024 Huawei Technologies Co., Ltd. | ||
# 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_get_by_path(NULL, 0, NULL);" "linux/blkdev.h" | ||
then | ||
echo $cur_name 1 >> $config_file_path | ||
elif compile_module $cur_name "blkdev_get_by_path(NULL, 0, NULL, NULL);" "linux/blkdev.h" | ||
then | ||
echo $cur_name 2 >> $config_file_path | ||
elif compile_module $cur_name "bdev_open_by_path(NULL, 0, NULL, 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_typedef "struct block_device *cas_bdev_handle_t;" | ||
add_define "cas_bdev_open_by_path(path, mode, holder) \\ | ||
blkdev_get_by_path(path, mode, holder)" | ||
add_define "cas_bdev_get_from_handle(handle) \\ | ||
((struct block_device *)handle)" ;; | ||
"2") | ||
add_typedef "struct block_device *cas_bdev_handle_t;" | ||
add_define "cas_bdev_open_by_path(path, mode, holder) \\ | ||
blkdev_get_by_path(path, mode, holder, NULL)" | ||
add_define "cas_bdev_get_from_handle(handle) \\ | ||
((struct block_device *)handle)" ;; | ||
"3") | ||
add_typedef "struct bdev_handle *cas_bdev_handle_t;" | ||
add_define "cas_bdev_open_by_path(path, mode, holder) \\ | ||
bdev_open_by_path(path, mode, holder, NULL)" | ||
add_define "cas_bdev_get_from_handle(handle) \\ | ||
(handle->bdev)" ;; | ||
*) | ||
exit 1 | ||
esac | ||
} | ||
|
||
conf_run $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright(c) 2012-2022 Intel Corporation | ||
# Copyright(c) 2023-2024 Huawei Technologies Co., Ltd. | ||
# 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 "class_create(NULL, NULL);" "linux/device.h" | ||
then | ||
echo $cur_name "1" >> $config_file_path | ||
elif compile_module $cur_name "class_create(NULL);" "linux/device.h" | ||
then | ||
echo $cur_name "2" >> $config_file_path | ||
else | ||
echo $cur_name "X" >> $config_file_path | ||
fi | ||
} | ||
|
||
apply() { | ||
case "$1" in | ||
"1") | ||
add_define "cas_class_create(owner, name) \\ | ||
class_create(owner, name)";; | ||
"2") | ||
add_define "cas_class_create(owner, name) \\ | ||
class_create(name)";; | ||
esac | ||
} | ||
|
||
conf_run $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.