Handle all io on bio handler
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
34
configure.d/1_bio_gendisk.conf
Normal file
34
configure.d/1_bio_gendisk.conf
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright(c) 2012-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
#
|
||||
|
||||
. $(dirname $3)/conf_framework
|
||||
|
||||
check() {
|
||||
cur_name=$(basename $2)
|
||||
config_file_path=$1
|
||||
if compile_module $cur_name "struct bio *bio; bio->bi_disk;" "linux/blk_types.h"
|
||||
then
|
||||
echo $cur_name "1" >> $config_file_path
|
||||
elif compile_module $cur_name "struct bio *bio; bio->bi_bdev;" "linux/blk_types.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_BIO_GET_GENDISK(bio) (bio->bi_disk)" ;;
|
||||
"2")
|
||||
add_define "CAS_BIO_GET_GENDISK(bio) (bio->bi_bdev->bd_disk)" ;;
|
||||
*)
|
||||
exit 1
|
||||
esac
|
||||
}
|
||||
|
||||
conf_run $@
|
||||
@@ -9,12 +9,15 @@
|
||||
check() {
|
||||
cur_name=$(basename $2)
|
||||
config_file_path=$1
|
||||
if compile_module $cur_name "REQ_PREFLUSH" "linux/blk_types.h"
|
||||
if compile_module $cur_name "BIO_FLUSH" "linux/bio.h"
|
||||
then
|
||||
echo $cur_name "1" >> $config_file_path
|
||||
elif compile_module $cur_name "REQ_FLUSH" "linux/blk_types.h"
|
||||
then
|
||||
echo $cur_name "2" >> $config_file_path
|
||||
elif compile_module $cur_name "REQ_PREFLUSH" "linux/blk_types.h"
|
||||
then
|
||||
echo $cur_name "3" >> $config_file_path
|
||||
else
|
||||
echo $cur_name "X" >> $config_file_path
|
||||
fi
|
||||
@@ -23,15 +26,26 @@ check() {
|
||||
apply() {
|
||||
case "$1" in
|
||||
"1")
|
||||
add_define "CAS_REQ_FLUSH \\
|
||||
REQ_PREFLUSH"
|
||||
add_define "CAS_FLUSH_SUPPORTED \\
|
||||
1" ;;
|
||||
add_define "CAS_IS_SET_FLUSH(flags) \\
|
||||
((flags) & BIO_FLUSH)"
|
||||
add_define "CAS_SET_FLUSH(flags) \\
|
||||
((flags) | BIO_FLUSH)"
|
||||
add_define "CAS_CLEAR_FLUSH(flags) \\
|
||||
((flags) & ~BIO_FLUSH)" ;;
|
||||
"2")
|
||||
add_define "CAS_REQ_FLUSH \\
|
||||
REQ_FLUSH"
|
||||
add_define "CAS_FLUSH_SUPPORTED \\
|
||||
1" ;;
|
||||
add_define "CAS_IS_SET_FLUSH(flags) \\
|
||||
((flags) & REQ_FLUSH)"
|
||||
add_define "CAS_SET_FLUSH(flags) \\
|
||||
((flags) | REQ_FLUSH)"
|
||||
add_define "CAS_CLEAR_FLUSH(flags) \\
|
||||
((flags) & ~REQ_FLUSH)" ;;
|
||||
"3")
|
||||
add_define "CAS_IS_SET_FLUSH(flags) \\
|
||||
((flags) & REQ_PREFLUSH)"
|
||||
add_define "CAS_SET_FLUSH(flags) \\
|
||||
((flags) | REQ_PREFLUSH)"
|
||||
add_define "CAS_CLEAR_FLUSH(flags) \\
|
||||
((flags) & ~REQ_PREFLUSH)" ;;
|
||||
*)
|
||||
exit 1
|
||||
esac
|
||||
|
||||
@@ -12,8 +12,11 @@ check() {
|
||||
if compile_module $cur_name "blk_queue_make_request" "linux/blkdev.h"
|
||||
then
|
||||
echo $cur_name "1" >> $config_file_path
|
||||
else
|
||||
elif compile_module $cur_name "struct request_queue *q; q->make_request_fn;" "linux/blkdev.h"
|
||||
then
|
||||
echo $cur_name "2" >> $config_file_path
|
||||
else
|
||||
echo $cur_name "3" >> $config_file_path
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -33,6 +36,13 @@ apply() {
|
||||
{
|
||||
q->make_request_fn = mfn;
|
||||
}" ;;
|
||||
"3")
|
||||
add_define "make_request_fn void"
|
||||
add_function "
|
||||
static inline void cas_blk_queue_make_request(struct request_queue *q,
|
||||
make_request_fn *mfn)
|
||||
{
|
||||
}" ;;
|
||||
*)
|
||||
exit 1
|
||||
esac
|
||||
|
||||
40
configure.d/1_req_flush.conf
Normal file
40
configure.d/1_req_flush.conf
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright(c) 2012-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
#
|
||||
|
||||
. $(dirname $3)/conf_framework
|
||||
|
||||
check() {
|
||||
cur_name=$(basename $2)
|
||||
config_file_path=$1
|
||||
if compile_module $cur_name "REQ_PREFLUSH" "linux/blk_types.h"
|
||||
then
|
||||
echo $cur_name "1" >> $config_file_path
|
||||
elif compile_module $cur_name "REQ_FLUSH" "linux/blk_types.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_REQ_FLUSH \\
|
||||
REQ_PREFLUSH"
|
||||
add_define "CAS_FLUSH_SUPPORTED \\
|
||||
1" ;;
|
||||
"2")
|
||||
add_define "CAS_REQ_FLUSH \\
|
||||
REQ_FLUSH"
|
||||
add_define "CAS_FLUSH_SUPPORTED \\
|
||||
1" ;;
|
||||
*)
|
||||
exit 1
|
||||
esac
|
||||
}
|
||||
|
||||
conf_run $@
|
||||
31
configure.d/1_set_submit_bio.conf
Normal file
31
configure.d/1_set_submit_bio.conf
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright(c) 2012-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
#
|
||||
|
||||
. $(dirname $3)/conf_framework
|
||||
|
||||
check() {
|
||||
cur_name=$(basename $2)
|
||||
config_file_path=$1
|
||||
if compile_module $cur_name "struct block_device_operations *ops; ops->submit_bio;" "linux/blkdev.h"
|
||||
then
|
||||
echo $cur_name "1" >> $config_file_path
|
||||
else
|
||||
echo $cur_name "2" >> $config_file_path
|
||||
fi
|
||||
}
|
||||
|
||||
apply() {
|
||||
case "$1" in
|
||||
"1")
|
||||
add_define "CAS_SET_SUBMIT_BIO(_fn) .submit_bio = _fn," ;;
|
||||
"2")
|
||||
add_define "CAS_SET_SUBMIT_BIO(_fn)" ;;
|
||||
*)
|
||||
exit 1
|
||||
esac
|
||||
}
|
||||
|
||||
conf_run $@
|
||||
@@ -35,7 +35,7 @@ apply() {
|
||||
}" ;;
|
||||
"2")
|
||||
add_define "CAS_CHECK_QUEUE_FLUSH(q) \\
|
||||
((q)->flush_flags & CAS_REQ_FLUSH)"
|
||||
CAS_IS_SET_FLUSH((q)->flush_flags)"
|
||||
add_define "CAS_CHECK_QUEUE_FUA(q) \\
|
||||
((q)->flush_flags & REQ_FUA)"
|
||||
add_function "static inline void cas_set_queue_flush_fua(struct request_queue *q,
|
||||
@@ -43,7 +43,7 @@ apply() {
|
||||
{
|
||||
unsigned int flags = 0;
|
||||
if (flush)
|
||||
flags |= CAS_REQ_FLUSH;
|
||||
flags = CAS_SET_FLUSH(flags);
|
||||
if (fua)
|
||||
flags |= REQ_FUA;
|
||||
if (flags)
|
||||
|
||||
Reference in New Issue
Block a user