Skip to content

Commit dbaeb21

Browse files
author
Rafal Stefanowski
committed
Kernel 6.13: Introduce cas_queue_limits_is_misaligned()
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com> Signed-off-by: Rafal Stefanowski <rafal.stefanowski@huawei.com>
1 parent 6a27577 commit dbaeb21

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
#
3+
# Copyright(c) 2025 Huawei Technologies
4+
# SPDX-License-Identifier: BSD-3-Clause
5+
#
6+
7+
. $(dirname $3)/conf_framework.sh
8+
9+
check() {
10+
cur_name=$(basename $2)
11+
config_file_path=$1
12+
13+
if compile_module $cur_name "struct queue_limits q; q.misaligned;" "linux/blkdev.h"
14+
then
15+
echo $cur_name 1 >> $config_file_path
16+
else
17+
echo $cur_name 2 >> $config_file_path
18+
fi
19+
}
20+
21+
apply() {
22+
case "$1" in
23+
"1")
24+
add_function "
25+
static inline bool cas_queue_limits_is_misaligned(
26+
struct queue_limits *lim)
27+
{
28+
return lim->misaligned;
29+
}" ;;
30+
"2")
31+
add_function "
32+
static inline bool cas_queue_limits_is_misaligned(
33+
struct queue_limits *lim)
34+
{
35+
return lim->features & BLK_FLAG_MISALIGNED;
36+
}" ;;
37+
*)
38+
exit 1
39+
esac
40+
}
41+
42+
conf_run $@

modules/cas_cache/layer_cache_management.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright(c) 2012-2022 Intel Corporation
3-
* Copyright(c) 2024 Huawei Technologies
3+
* Copyright(c) 2024-2025 Huawei Technologies
44
* SPDX-License-Identifier: BSD-3-Clause
55
*/
66

@@ -2405,7 +2405,8 @@ static int cache_mngt_check_bdev(struct ocf_mngt_cache_device_config *cfg,
24052405
printk(KERN_WARNING "New cache device block properties "
24062406
"differ from the previous one.\n");
24072407
}
2408-
if (tmp_limits.misaligned) {
2408+
2409+
if (cas_queue_limits_is_misaligned(&tmp_limits)) {
24092410
reattach_properties_diff = true;
24102411
printk(KERN_WARNING "New cache device block interval "
24112412
"doesn't line up with the previous one.\n");

0 commit comments

Comments
 (0)