-
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.5
Signed-off-by: Tamar Levovitz <[email protected]> Signed-off-by: Robert Baldyga <[email protected]>
- Loading branch information
1 parent
ab0d7d0
commit 0fedbbf
Showing
8 changed files
with
239 additions
and
22 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,38 @@ | ||
#!/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 | ||
else | ||
echo $cur_name X >> $config_file_path | ||
fi | ||
} | ||
|
||
apply() { | ||
case "$1" in | ||
"1") | ||
add_define "cas_blkdev_get_by_path(path, mode, holder) \\ | ||
blkdev_get_by_path(path, mode, holder)" ;; | ||
"2") | ||
add_define "cas_blkdev_get_by_path(path, mode, holder) \\ | ||
blkdev_get_by_path(path, mode, holder, NULL)" ;; | ||
*) | ||
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,38 @@ | ||
#!/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 | ||
else | ||
echo $cur_name X >> $config_file_path | ||
fi | ||
} | ||
|
||
apply() { | ||
case "$1" in | ||
"1") | ||
add_define "cas_blkdev_put(bdev, mode, holder) \\ | ||
blkdev_put(bdev, mode)" ;; | ||
"2") | ||
add_define "cas_blkdev_put(bdev, mode, holder) \\ | ||
blkdev_put(bdev, holder)" ;; | ||
*) | ||
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_MODE fmode_t" | ||
add_define "CAS_MODE_READ FMODE_READ" | ||
add_define "CAS_MODE_WRITE FMODE_WRITE" | ||
add_define "CAS_MODE_EXCL FMODE_EXCL" ;; | ||
"2") | ||
add_define "CAS_MODE blk_mode_t" | ||
add_define "CAS_MODE_READ BLK_OPEN_READ" | ||
add_define "CAS_MODE_WRITE BLK_OPEN_WRITE" | ||
add_define "CAS_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,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_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_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_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