-
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.
Merge pull request #1468 from robertbaldyga/kernel-6.8
Add support for kernel up to 6.8
- Loading branch information
Showing
24 changed files
with
372 additions
and
91 deletions.
There are no files selected for viewing
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) 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_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/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 $@ |
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,42 @@ | ||
#!/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 "int x = FMODE_EXCL;" "linux/fs.h" | ||
then | ||
echo $cur_name 1 >> $config_file_path | ||
elif compile_module $cur_name "int x = BLK_OPEN_EXCL;" "linux/blkdev.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_BLK_MODE fmode_t" | ||
add_define "CAS_BLK_MODE_READ FMODE_READ" | ||
add_define "CAS_BLK_MODE_WRITE FMODE_WRITE" | ||
add_define "CAS_BLK_MODE_EXCL FMODE_EXCL" ;; | ||
"2") | ||
add_define "CAS_BLK_MODE blk_mode_t" | ||
add_define "CAS_BLK_MODE_READ BLK_OPEN_READ" | ||
add_define "CAS_BLK_MODE_WRITE BLK_OPEN_WRITE" | ||
add_define "CAS_BLK_MODE_EXCL BLK_OPEN_EXCL" ;; | ||
*) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/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 "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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/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 "struct block_device_operations bdo; bdo.release(NULL, 0);" "linux/blkdev.h" | ||
then | ||
echo $cur_name "1" >> $config_file_path | ||
elif compile_module $cur_name "struct block_device_operations bdo; bdo.release(NULL);" "linux/blkdev.h" | ||
then | ||
echo $cur_name "2" >> $config_file_path | ||
else | ||
echo $cur_name "X" >> $config_file_path | ||
fi | ||
} | ||
|
||
apply() { | ||
add_define "CAS_REFER_BDEV_CLOSE_CALLBACK(name) \\ | ||
name##_callback_wrapper" | ||
case "$1" in | ||
"1") | ||
add_define "CAS_BDEV_CLOSE(name, DISK) \\ | ||
static void name##_callback(DISK); \\ | ||
static void name##_callback_wrapper(struct gendisk *gd, \\ | ||
CAS_BLK_MODE _mode) \\ | ||
{ \\ | ||
name##_callback(gd); \\ | ||
} \\ | ||
static void name##_callback(DISK)";; | ||
"2") | ||
add_define "CAS_BDEV_CLOSE(name, DISK) \\ | ||
static void name##_callback(DISK); \\ | ||
static void name##_callback_wrapper(struct gendisk *gd) \\ | ||
{ \\ | ||
name##_callback(gd); \\ | ||
} \\ | ||
static void name##_callback(DISK)";; | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/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 "struct block_device_operations *ops; struct block_device *bd; ops->open(bd, 0);" "linux/blkdev.h" | ||
then | ||
echo $cur_name "1" >> $config_file_path | ||
elif compile_module $cur_name "struct block_device_operations *ops; struct gendisk *gd; ops->open(gd, 0);" "linux/blkdev.h" | ||
then | ||
echo $cur_name "2" >> $config_file_path | ||
else | ||
echo $cur_name "X" >> $config_file_path | ||
fi | ||
} | ||
|
||
apply() { | ||
add_define "CAS_REFER_BDEV_OPEN_CALLBACK(name) \\ | ||
name##_callback_wrapper" | ||
case "$1" in | ||
"1") | ||
add_define "CAS_BDEV_OPEN(name, DISK) \\ | ||
static int name##_callback(DISK); \\ | ||
static int name##_callback_wrapper(struct block_device *bdev, \\ | ||
CAS_BLK_MODE _mode) \\ | ||
{ \\ | ||
return name##_callback(bdev->bd_disk); \\ | ||
} \\ | ||
static int name##_callback(DISK)";; | ||
"2") | ||
add_define "CAS_BDEV_OPEN(name, DISK) \\ | ||
static int name##_callback(DISK); \\ | ||
static int name##_callback_wrapper(struct gendisk *gd, \\ | ||
CAS_BLK_MODE _mode) \\ | ||
{ \\ | ||
return name##_callback(gd->part0->bd_disk); \\ | ||
} \\ | ||
static int name##_callback(DISK)";; | ||
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
Oops, something went wrong.