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
|
||||
#
|
||||
# Copyright(c) 2012-2022 Intel Corporation
|
||||
# Copyright(c) 2025 Huawei Technologies
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
@ -9,12 +10,15 @@
|
||||
check() {
|
||||
cur_name=$(basename $2)
|
||||
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
|
||||
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
|
||||
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
|
||||
echo $cur_name "X" >> $config_file_path
|
||||
fi
|
||||
@ -23,21 +27,39 @@ check() {
|
||||
apply() {
|
||||
case "$1" in
|
||||
"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) \\
|
||||
test_bit(QUEUE_FLAG_WC, &(q)->queue_flags)"
|
||||
add_define "CAS_CHECK_QUEUE_FUA(q) \\
|
||||
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 "
|
||||
static inline void cas_set_queue_flush_fua(struct request_queue *q,
|
||||
bool flush, bool fua)
|
||||
{
|
||||
blk_queue_write_cache(q, flush, fua);
|
||||
}" ;;
|
||||
"2")
|
||||
"3")
|
||||
add_define "CAS_CHECK_QUEUE_FLUSH(q) \\
|
||||
CAS_IS_SET_FLUSH((q)->flush_flags)"
|
||||
add_define "CAS_CHECK_QUEUE_FUA(q) \\
|
||||
((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,
|
||||
bool flush, bool fua)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user