Kernel 6.13: Add another definition of cas_set_queue_flush_fua()
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com> Signed-off-by: Rafal Stefanowski <rafal.stefanowski@huawei.com>
This commit is contained in:
parent
efa2c0ad5e
commit
3badd8b621
@ -1,6 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright(c) 2012-2022 Intel Corporation
|
# Copyright(c) 2012-2022 Intel Corporation
|
||||||
|
# Copyright(c) 2025 Huawei Technologies
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
|
||||||
@ -9,12 +10,15 @@
|
|||||||
check() {
|
check() {
|
||||||
cur_name=$(basename $2)
|
cur_name=$(basename $2)
|
||||||
config_file_path=$1
|
config_file_path=$1
|
||||||
if compile_module $cur_name "blk_queue_write_cache(NULL, 0, 0);" "linux/blkdev.h"
|
if compile_module $cur_name "BLK_FEAT_WRITE_CACHE;" "linux/blk-mq.h"
|
||||||
then
|
then
|
||||||
echo $cur_name "1" >> $config_file_path
|
echo $cur_name "1" >> $config_file_path
|
||||||
elif compile_module $cur_name "struct request_queue rq; rq.flush_flags;" "linux/blkdev.h"
|
elif compile_module $cur_name "blk_queue_write_cache(NULL, 0, 0);" "linux/blkdev.h"
|
||||||
then
|
then
|
||||||
echo $cur_name "2" >> $config_file_path
|
echo $cur_name "2" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "struct request_queue rq; rq.flush_flags;" "linux/blkdev.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "3" >> $config_file_path
|
||||||
else
|
else
|
||||||
echo $cur_name "X" >> $config_file_path
|
echo $cur_name "X" >> $config_file_path
|
||||||
fi
|
fi
|
||||||
@ -23,21 +27,39 @@ check() {
|
|||||||
apply() {
|
apply() {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"1")
|
"1")
|
||||||
|
add_define "CAS_CHECK_QUEUE_FLUSH(q) \\
|
||||||
|
(q->limits.features & BLK_FEAT_WRITE_CACHE)"
|
||||||
|
add_define "CAS_CHECK_QUEUE_FUA(q) \\
|
||||||
|
(q->limits.features & BLK_FEAT_FUA)"
|
||||||
|
add_define "CAS_BLK_FEAT_WRITE_CACHE BLK_FEAT_WRITE_CACHE"
|
||||||
|
add_define "CAS_BLK_FEAT_FUA BLK_FEAT_FUA"
|
||||||
|
add_define "CAS_SET_QUEUE_LIMIT(lim, flag) \\
|
||||||
|
({ lim->features |= flag; })"
|
||||||
|
add_function "
|
||||||
|
static inline void cas_set_queue_flush_fua(struct request_queue *q,
|
||||||
|
bool flush, bool fua) {}" ;;
|
||||||
|
"2")
|
||||||
add_define "CAS_CHECK_QUEUE_FLUSH(q) \\
|
add_define "CAS_CHECK_QUEUE_FLUSH(q) \\
|
||||||
test_bit(QUEUE_FLAG_WC, &(q)->queue_flags)"
|
test_bit(QUEUE_FLAG_WC, &(q)->queue_flags)"
|
||||||
add_define "CAS_CHECK_QUEUE_FUA(q) \\
|
add_define "CAS_CHECK_QUEUE_FUA(q) \\
|
||||||
test_bit(QUEUE_FLAG_FUA, &(q)->queue_flags)"
|
test_bit(QUEUE_FLAG_FUA, &(q)->queue_flags)"
|
||||||
|
add_define "CAS_BLK_FEAT_WRITE_CACHE 0"
|
||||||
|
add_define "CAS_BLK_FEAT_FUA 0"
|
||||||
|
add_define "CAS_SET_QUEUE_LIMIT(lim, flag)"
|
||||||
add_function "
|
add_function "
|
||||||
static inline void cas_set_queue_flush_fua(struct request_queue *q,
|
static inline void cas_set_queue_flush_fua(struct request_queue *q,
|
||||||
bool flush, bool fua)
|
bool flush, bool fua)
|
||||||
{
|
{
|
||||||
blk_queue_write_cache(q, flush, fua);
|
blk_queue_write_cache(q, flush, fua);
|
||||||
}" ;;
|
}" ;;
|
||||||
"2")
|
"3")
|
||||||
add_define "CAS_CHECK_QUEUE_FLUSH(q) \\
|
add_define "CAS_CHECK_QUEUE_FLUSH(q) \\
|
||||||
CAS_IS_SET_FLUSH((q)->flush_flags)"
|
CAS_IS_SET_FLUSH((q)->flush_flags)"
|
||||||
add_define "CAS_CHECK_QUEUE_FUA(q) \\
|
add_define "CAS_CHECK_QUEUE_FUA(q) \\
|
||||||
((q)->flush_flags & REQ_FUA)"
|
((q)->flush_flags & REQ_FUA)"
|
||||||
|
add_define "CAS_BLK_FEAT_WRITE_CACHE 0"
|
||||||
|
add_define "CAS_BLK_FEAT_FUA 0"
|
||||||
|
add_define "CAS_SET_QUEUE_LIMIT(lim, flag)"
|
||||||
add_function "static inline void cas_set_queue_flush_fua(struct request_queue *q,
|
add_function "static inline void cas_set_queue_flush_fua(struct request_queue *q,
|
||||||
bool flush, bool fua)
|
bool flush, bool fua)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user