Merge pull request #67 from mmichal10/execute-configure-in-parallel
Execute configure in parallel
This commit is contained in:
commit
a493b9d3fc
74
configure
vendored
74
configure
vendored
@ -3,23 +3,83 @@
|
|||||||
# Copyright(c) 2012-2019 Intel Corporation
|
# Copyright(c) 2012-2019 Intel Corporation
|
||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
which dirname 2>&1 > /dev/null || { echo >&2 "Eror: missing 'dirname' utility"; exit 1; }
|
|
||||||
which realpath 2>&1 > /dev/null || { echo >&2 "Eror: missing 'realpath' utility"; exit 1; }
|
check_util() {
|
||||||
|
which $1 2>&1 > /dev/null || { echo >&2 "Error: missing '$1' utility"; exit 1; }
|
||||||
|
}
|
||||||
|
|
||||||
|
check_util dirname
|
||||||
|
check_util realpath
|
||||||
|
check_util basename
|
||||||
|
check_util awk
|
||||||
|
|
||||||
SCRIPTPATH=`dirname $0`
|
SCRIPTPATH=`dirname $0`
|
||||||
SCRIPTPATH=`realpath $SCRIPTPATH`
|
SCRIPTPATH=`realpath $SCRIPTPATH`
|
||||||
|
|
||||||
CONFIG_FILES=`ls $SCRIPTPATH/configure.d/*.conf | sort`
|
CONFIG_FILES=`ls $SCRIPTPATH/configure.d/*.conf | sort`
|
||||||
|
FILES_COUNT=`echo $CONFIG_FILES | wc -w`
|
||||||
|
|
||||||
rm -f $SCRIPTPATH/modules/generated_defines.h
|
CONFIG_FILE=$SCRIPTPATH/"config.out"
|
||||||
|
|
||||||
files_count=`echo $CONFIG_FILES | wc -w`
|
generate_config() {
|
||||||
|
rm -f ${CONFIG_FILE}
|
||||||
|
touch ${CONFIG_FILE}
|
||||||
|
declare -a pid_list
|
||||||
progress=0
|
progress=0
|
||||||
|
|
||||||
|
# Compile each test module in background
|
||||||
|
echo "Preparing configuration"
|
||||||
for file in $CONFIG_FILES; do
|
for file in $CONFIG_FILES; do
|
||||||
progress=$((progress+1))
|
progress=$((progress+1))
|
||||||
echo -ne "Configuring OpenCAS: $progress/$files_count\033[0K\r"
|
# $1 - Action to be performed
|
||||||
/bin/bash $file
|
# $2 - File with stored configuration
|
||||||
|
# $3 - Name of called script (since script is running as subprocess
|
||||||
|
# it has to be passed explicitly)
|
||||||
|
source $file "check" "$CONFIG_FILE" "$file" &
|
||||||
|
pid_list+=($!)
|
||||||
done
|
done
|
||||||
echo -ne " \033[0K\r"
|
|
||||||
|
|
||||||
|
# Wait for all compilation processes to finish
|
||||||
|
wait
|
||||||
|
|
||||||
|
grep "X" ${CONFIG_FILE} &> /dev/null
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
echo "ERROR! Following steps failed while preparing config:"
|
||||||
|
grep "X" ${CONFIG_FILE} | cut -f1 -d ' '
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
generate_header() {
|
||||||
|
rm -f $SCRIPTPATH/modules/generated_defines.h
|
||||||
|
# Configs starting with '1_' have to be put as first in header
|
||||||
|
FIRST=$(echo $CONFIG_FILES | tr ' ' '\n' | grep '1_')
|
||||||
|
SECOND=$(echo $CONFIG_FILES | tr ' ' '\n' | grep '2_')
|
||||||
|
|
||||||
|
echo "Configuring OpenCAS"
|
||||||
|
for file in $FIRST; do
|
||||||
|
CONF=$(cat ${CONFIG_FILE} | grep $(basename $file) | cut -d' ' -f2)
|
||||||
|
source $file "apply" "$CONF" "$file" &
|
||||||
|
done
|
||||||
|
|
||||||
|
wait
|
||||||
|
|
||||||
|
for file in $SECOND; do
|
||||||
|
CONF=$(cat ${CONFIG_FILE} | grep $(basename $file) | cut -d' ' -f2)
|
||||||
|
source $file "apply" "$CONF" "$file" &
|
||||||
|
done
|
||||||
|
|
||||||
|
wait
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
generate_config
|
||||||
|
else
|
||||||
|
CONFIG_FILE=$(realpath $1)
|
||||||
|
if [ $? -ne 0 ] ; then
|
||||||
|
echo "Invaild path to config file!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
generate_header
|
||||||
|
@ -4,13 +4,31 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "struct bio *b;blk_rq_append_bio(NULL, &b)" "linux/blkdev.h"
|
|
||||||
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "struct bio *b;blk_rq_append_bio(NULL, &b)" "linux/blkdev.h"
|
||||||
then
|
then
|
||||||
add_define "cas_blk_rq_append_bio(rq, bounce_bio) \\
|
echo $cur_name 1 >> $config_file_path
|
||||||
blk_rq_append_bio(rq, &bounce_bio)"
|
|
||||||
else
|
else
|
||||||
add_define "cas_blk_rq_append_bio(rq, bounce_bio) \\
|
echo $cur_name 2 >> $config_file_path
|
||||||
blk_rq_append_bio(rq, bounce_bio)"
|
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
|
add_define "cas_blk_rq_append_bio(rq, bounce_bio) \\
|
||||||
|
blk_rq_append_bio(rq, &bounce_bio)" ;;
|
||||||
|
"2")
|
||||||
|
add_define "cas_blk_rq_append_bio(rq, bounce_bio) \\
|
||||||
|
blk_rq_append_bio(rq, bounce_bio)" ;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,14 +4,33 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "lookup_bdev(\"some_path\")" "linux/fs.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "lookup_bdev(\"some_path\")" "linux/fs.h"
|
||||||
then
|
then
|
||||||
add_define "CAS_LOOKUP_BDEV(PATH) \\
|
echo $cur_name "1" >> $config_file_path
|
||||||
lookup_bdev(PATH)"
|
elif compile_module $cur_name "lookup_bdev(\"some_path\", 0)" "linux/fs.h"
|
||||||
elif compile_module "lookup_bdev(\"some_path\", 0)" "linux/fs.h"
|
|
||||||
then
|
then
|
||||||
add_define "CAS_LOOKUP_BDEV(PATH) \\
|
echo $cur_name "2" >> $config_file_path
|
||||||
lookup_bdev(PATH, 0)"
|
else
|
||||||
|
echo $cur_name "X" >> $config_file_path
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
|
add_define "CAS_LOOKUP_BDEV(PATH) \\
|
||||||
|
lookup_bdev(PATH)" ;;
|
||||||
|
"2")
|
||||||
|
add_define "CAS_LOOKUP_BDEV(PATH) \\
|
||||||
|
lookup_bdev(PATH, 0)" ;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,24 +4,45 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "bio_clone(NULL, 0)" "linux/bio.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "bio_clone(NULL, 0)" "linux/bio.h"
|
||||||
then
|
then
|
||||||
|
echo $cur_name "1" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "bio_clone_kmalloc(NULL, 0)" "linux/bio.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "2" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "bio_clone_fast(NULL, 0, NULL)" "linux/bio.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "3" >> $config_file_path
|
||||||
|
else
|
||||||
|
echo $cur_name "X" >> $config_file_path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
add_function "static inline struct bio *cas_bio_clone(struct bio *bio, gfp_t gfp_mask)
|
add_function "static inline struct bio *cas_bio_clone(struct bio *bio, gfp_t gfp_mask)
|
||||||
{
|
{
|
||||||
return bio_clone(bio, gfp_mask);
|
return bio_clone(bio, gfp_mask);
|
||||||
}"
|
}" ;;
|
||||||
elif compile_module "bio_clone_kmalloc(NULL, 0)" "linux/bio.h"
|
"2")
|
||||||
then
|
|
||||||
add_function "static inline struct bio *cas_bio_clone(struct bio *bio, gfp_t gfp_mask)
|
add_function "static inline struct bio *cas_bio_clone(struct bio *bio, gfp_t gfp_mask)
|
||||||
{
|
{
|
||||||
return bio_clone_kmalloc(bio, gfp_mask);
|
return bio_clone_kmalloc(bio, gfp_mask);
|
||||||
}"
|
}" ;;
|
||||||
elif compile_module "bio_clone_fast(NULL, 0, NULL)" "linux/bio.h"
|
"3")
|
||||||
then
|
|
||||||
add_function "static inline struct bio *cas_bio_clone(struct bio *bio, gfp_t gfp_mask)
|
add_function "static inline struct bio *cas_bio_clone(struct bio *bio, gfp_t gfp_mask)
|
||||||
{
|
{
|
||||||
return bio_clone_fast(bio, gfp_mask, NULL);
|
return bio_clone_fast(bio, gfp_mask, NULL);
|
||||||
}"
|
}" ;;
|
||||||
fi
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,28 +4,46 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "struct bio b;b.bi_end_io(NULL, 0)" "linux/bio.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "struct bio b;b.bi_end_io(NULL, 0)" "linux/bio.h"
|
||||||
then
|
then
|
||||||
add_define "CAS_BIO_ENDIO(BIO, BYTES_DONE, ERROR) \\
|
echo $cur_name "1" >> $config_file_path
|
||||||
bio_endio(BIO, ERROR)"
|
elif compile_module $cur_name "struct bio b;b.bi_end_io(NULL)" "linux/bio.h"
|
||||||
add_define "CAS_DECLARE_BLOCK_CALLBACK(name, BIO, BYTES_DONE, ERROR) \\
|
|
||||||
void name##_callback(BIO, ERROR)"
|
|
||||||
add_define "CAS_BLOCK_CALLBACK_ERROR(BIO, ERROR) \\
|
|
||||||
ERROR"
|
|
||||||
elif compile_module "struct bio b;b.bi_end_io(NULL)" "linux/bio.h"
|
|
||||||
then
|
then
|
||||||
add_define "CAS_BIO_ENDIO(BIO, BYTES_DONE, ERROR) \\
|
echo $cur_name "2" >> $config_file_path
|
||||||
({ CAS_BIO_OP_STATUS(BIO) = ERROR; bio_endio(BIO); })"
|
else
|
||||||
add_define "CAS_DECLARE_BLOCK_CALLBACK(name, BIO, BYTES_DONE, ERROR) \\
|
echo $cur_name "X" >> $config_file_path
|
||||||
void name##_callback(BIO)"
|
|
||||||
add_define "CAS_BLOCK_CALLBACK_ERROR(BIO, ERROR) \\
|
|
||||||
CAS_BIO_OP_STATUS(BIO)"
|
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
add_define "CAS_REFER_BLOCK_CALLBACK(name) \\
|
add_define "CAS_REFER_BLOCK_CALLBACK(name) \\
|
||||||
name##_callback"
|
name##_callback"
|
||||||
add_define "CAS_BLOCK_CALLBACK_INIT(BIO) \\
|
add_define "CAS_BLOCK_CALLBACK_INIT(BIO) \\
|
||||||
{; }"
|
{; }"
|
||||||
add_define "CAS_BLOCK_CALLBACK_RETURN(BIO) \\
|
add_define "CAS_BLOCK_CALLBACK_RETURN(BIO) \\
|
||||||
{ return; }"
|
{ return; }"
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
|
add_define "CAS_BIO_ENDIO(BIO, BYTES_DONE, ERROR) \\
|
||||||
|
bio_endio(BIO, ERROR)"
|
||||||
|
add_define "CAS_DECLARE_BLOCK_CALLBACK(name, BIO, BYTES_DONE, ERROR) \\
|
||||||
|
void name##_callback(BIO, ERROR)"
|
||||||
|
add_define "CAS_BLOCK_CALLBACK_ERROR(BIO, ERROR) \\
|
||||||
|
ERROR" ;;
|
||||||
|
"2")
|
||||||
|
add_define "CAS_BIO_ENDIO(BIO, BYTES_DONE, ERROR) \\
|
||||||
|
({ CAS_BIO_OP_STATUS(BIO) = ERROR; bio_endio(BIO); })"
|
||||||
|
add_define "CAS_DECLARE_BLOCK_CALLBACK(name, BIO, BYTES_DONE, ERROR) \\
|
||||||
|
void name##_callback(BIO)"
|
||||||
|
add_define "CAS_BLOCK_CALLBACK_ERROR(BIO, ERROR) \\
|
||||||
|
CAS_BIO_OP_STATUS(BIO)" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,30 +4,53 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "bio_op(NULL)" "linux/bio.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "bio_op(NULL)" "linux/bio.h"
|
||||||
then
|
then
|
||||||
|
echo $cur_name "1" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "REQ_OP_MASK" "linux/blk_types.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "2" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "REQ_OP_DISCARD" "linux/blk_types.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "3" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "REQ_DISCARD" "linux/blk_types.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "4" >> $config_file_path
|
||||||
|
else
|
||||||
|
echo $cur_name "X" >> $config_file_path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
add_define "CAS_IS_DISCARD(bio) \\
|
add_define "CAS_IS_DISCARD(bio) \\
|
||||||
(bio_op(bio) == REQ_OP_DISCARD)"
|
(bio_op(bio) == REQ_OP_DISCARD)"
|
||||||
add_define "CAS_BIO_DISCARD \\
|
add_define "CAS_BIO_DISCARD \\
|
||||||
(REQ_OP_DISCARD)"
|
(REQ_OP_DISCARD)" ;;
|
||||||
elif compile_module "REQ_OP_MASK" "linux/blk_types.h"
|
"2")
|
||||||
then
|
|
||||||
add_define "CAS_IS_DISCARD(bio) \\
|
add_define "CAS_IS_DISCARD(bio) \\
|
||||||
(((CAS_BIO_OP_FLAGS(bio)) & REQ_OP_MASK) == REQ_OP_DISCARD)"
|
(((CAS_BIO_OP_FLAGS(bio)) & REQ_OP_MASK) == REQ_OP_DISCARD)"
|
||||||
add_define "CAS_BIO_DISCARD \\
|
add_define "CAS_BIO_DISCARD \\
|
||||||
((REQ_OP_WRITE | REQ_OP_DISCARD))"
|
((REQ_OP_WRITE | REQ_OP_DISCARD))" ;;
|
||||||
elif compile_module "REQ_OP_DISCARD" "linux/blk_types.h"
|
"3")
|
||||||
then
|
|
||||||
add_define "CAS_IS_DISCARD(bio) \\
|
add_define "CAS_IS_DISCARD(bio) \\
|
||||||
((CAS_BIO_OP_FLAGS(bio)) & REQ_OP_DISCARD)"
|
((CAS_BIO_OP_FLAGS(bio)) & REQ_OP_DISCARD)"
|
||||||
add_define "CAS_BIO_DISCARD \\
|
add_define "CAS_BIO_DISCARD \\
|
||||||
((REQ_OP_WRITE | REQ_OP_DISCARD))"
|
((REQ_OP_WRITE | REQ_OP_DISCARD))" ;;
|
||||||
elif compile_module "REQ_DISCARD" "linux/blk_types.h"
|
"4")
|
||||||
then
|
|
||||||
add_define "CAS_IS_DISCARD(bio) \\
|
add_define "CAS_IS_DISCARD(bio) \\
|
||||||
((CAS_BIO_OP_FLAGS(bio)) & REQ_DISCARD)"
|
((CAS_BIO_OP_FLAGS(bio)) & REQ_DISCARD)"
|
||||||
add_define "CAS_BIO_DISCARD \\
|
add_define "CAS_BIO_DISCARD \\
|
||||||
(REQ_WRITE | REQ_DISCARD)"
|
(REQ_WRITE | REQ_DISCARD)" ;;
|
||||||
fi
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,14 +4,32 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "struct bio b;b.bi_status" "linux/bio.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "struct bio b;b.bi_status" "linux/bio.h"
|
||||||
then
|
then
|
||||||
add_define "CAS_BIO_OP_STATUS(bio) \\
|
echo $cur_name "1" >> $config_file_path
|
||||||
bio->bi_status"
|
elif compile_module $cur_name "struct bio b;b.bi_error" "linux/bio.h"
|
||||||
elif compile_module "struct bio b;b.bi_error" "linux/bio.h"
|
|
||||||
then
|
then
|
||||||
add_define "CAS_BIO_OP_STATUS(bio) \\
|
echo $cur_name "2" >> $config_file_path
|
||||||
bio->bi_error"
|
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
|
add_define "CAS_BIO_OP_STATUS(bio) \\
|
||||||
|
bio->bi_status" ;;
|
||||||
|
"2")
|
||||||
|
add_define "CAS_BIO_OP_STATUS(bio) \\
|
||||||
|
bio->bi_error" ;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
|
||||||
|
@ -4,16 +4,35 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "struct bio b;b.bi_opf" "linux/bio.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "struct bio b;b.bi_opf" "linux/bio.h"
|
||||||
then
|
then
|
||||||
|
echo $cur_name "1" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "struct bio b;b.bi_rw" "linux/bio.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_OP_FLAGS_FORMAT \"0x%016X\""
|
add_define "CAS_BIO_OP_FLAGS_FORMAT \"0x%016X\""
|
||||||
add_define "CAS_BIO_OP_FLAGS(bio) \\
|
add_define "CAS_BIO_OP_FLAGS(bio) \\
|
||||||
(bio)->bi_opf"
|
(bio)->bi_opf" ;;
|
||||||
elif compile_module "struct bio b;b.bi_rw" "linux/bio.h"
|
"2")
|
||||||
then
|
|
||||||
add_define "CAS_BIO_OP_FLAGS_FORMAT \"0x%016lX\""
|
add_define "CAS_BIO_OP_FLAGS_FORMAT \"0x%016lX\""
|
||||||
add_define "CAS_BIO_OP_FLAGS(bio) \\
|
add_define "CAS_BIO_OP_FLAGS(bio) \\
|
||||||
(bio)->bi_rw"
|
(bio)->bi_rw" ;;
|
||||||
fi
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,22 +4,41 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "struct bio b;b.bi_iter.bi_size" "linux/bio.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "struct bio b;b.bi_iter.bi_size" "linux/bio.h"
|
||||||
then
|
then
|
||||||
|
echo $cur_name "1" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "struct bio b;b.bi_size" "linux/bio.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_BISIZE(bio) \\
|
add_define "CAS_BIO_BISIZE(bio) \\
|
||||||
bio->bi_iter.bi_size"
|
bio->bi_iter.bi_size"
|
||||||
add_define "CAS_BIO_BIIDX(bio) \\
|
add_define "CAS_BIO_BIIDX(bio) \\
|
||||||
bio->bi_iter.bi_idx"
|
bio->bi_iter.bi_idx"
|
||||||
add_define "CAS_BIO_BISECTOR(bio) \\
|
add_define "CAS_BIO_BISECTOR(bio) \\
|
||||||
bio->bi_iter.bi_sector"
|
bio->bi_iter.bi_sector" ;;
|
||||||
elif compile_module "struct bio b;b.bi_size" "linux/bio.h"
|
"2")
|
||||||
then
|
|
||||||
add_define "CAS_BIO_BISIZE(bio) \\
|
add_define "CAS_BIO_BISIZE(bio) \\
|
||||||
bio->bi_size"
|
bio->bi_size"
|
||||||
add_define "CAS_BIO_BIIDX(bio) \\
|
add_define "CAS_BIO_BIIDX(bio) \\
|
||||||
bio->bi_idx"
|
bio->bi_idx"
|
||||||
add_define "CAS_BIO_BISECTOR(bio) \\
|
add_define "CAS_BIO_BISECTOR(bio) \\
|
||||||
bio->bi_sector"
|
bio->bi_sector" ;;
|
||||||
fi
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,13 +4,30 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "struct bio b;&bio_iovec(&b)" "linux/bio.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "struct bio b;&bio_iovec(&b)" "linux/bio.h"
|
||||||
then
|
then
|
||||||
add_define "CAS_SEGMENT_BVEC(vec) \\
|
echo $cur_name "1" >> $config_file_path
|
||||||
(&(vec))"
|
|
||||||
else
|
else
|
||||||
add_define "CAS_SEGMENT_BVEC(vec) \\
|
echo $cur_name "2" >> $config_file_path
|
||||||
(vec)"
|
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
|
add_define "CAS_SEGMENT_BVEC(vec) \\
|
||||||
|
(&(vec))" ;;
|
||||||
|
"2")
|
||||||
|
add_define "CAS_SEGMENT_BVEC(vec) \\
|
||||||
|
(vec)" ;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,13 +4,30 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "blk_rq_set_block_pc(NULL)" "linux/blkdev.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "blk_rq_set_block_pc(NULL)" "linux/blkdev.h"
|
||||||
then
|
then
|
||||||
add_define "cas_blk_rq_set_block_pc(rq) \\
|
echo $cur_name "1" >> $config_file_path
|
||||||
blk_rq_set_block_pc(rq)"
|
|
||||||
else
|
else
|
||||||
add_define "cas_blk_rq_set_block_pc(rq) \\
|
echo $cur_name "2" >> $config_file_path
|
||||||
{}"
|
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
|
add_define "cas_blk_rq_set_block_pc(rq) \\
|
||||||
|
blk_rq_set_block_pc(rq)" ;;
|
||||||
|
"2")
|
||||||
|
add_define "cas_blk_rq_set_block_pc(rq) \\
|
||||||
|
{}" ;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,13 +4,30 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "deamonize(\"some_name\", NULL)" "linux/sched.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "deamonize(\"some_name\", NULL)" "linux/sched.h"
|
||||||
then
|
then
|
||||||
add_define "CAS_DAEMONIZE(name, arg...) \\
|
echo $cur_name "1" >> $config_file_path
|
||||||
daemonize(name, ##arg)"
|
|
||||||
else
|
else
|
||||||
add_define "CAS_DAEMONIZE(name, arg...) \\
|
echo $cur_name "2" >> $config_file_path
|
||||||
do { } while (0)"
|
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
|
add_define "CAS_DAEMONIZE(name, arg...) \\
|
||||||
|
daemonize(name, ##arg)" ;;
|
||||||
|
"2")
|
||||||
|
add_define "CAS_DAEMONIZE(name, arg...) \\
|
||||||
|
do { } while (0)" ;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,14 +4,33 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "struct dentry dentry;dentry.d_u.d_alias" "linux/dcache.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "struct dentry dentry;dentry.d_u.d_alias" "linux/dcache.h"
|
||||||
then
|
then
|
||||||
add_define "CAS_ALIAS_NODE_TO_DENTRY(alias) \\
|
echo $cur_name "1" >> $config_file_path
|
||||||
container_of(alias, struct dentry, d_u.d_alias)"
|
elif compile_module $cur_name "struct dentry dentry;dentry.d_alias" "linux/dcache.h"
|
||||||
elif compile_module "struct dentry dentry;dentry.d_alias" "linux/dcache.h"
|
|
||||||
then
|
then
|
||||||
add_define "CAS_ALIAS_NODE_TO_DENTRY(alias) \\
|
echo $cur_name "2" >> $config_file_path
|
||||||
container_of(alias, struct dentry, d_alias)"
|
else
|
||||||
|
echo $cur_name "X" >> $config_file_path
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
|
add_define "CAS_ALIAS_NODE_TO_DENTRY(alias) \\
|
||||||
|
container_of(alias, struct dentry, d_u.d_alias)" ;;
|
||||||
|
"2")
|
||||||
|
add_define "CAS_ALIAS_NODE_TO_DENTRY(alias) \\
|
||||||
|
container_of(alias, struct dentry, d_alias)" ;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,13 +4,30 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "struct queue_limits q;q.discard_zeroes_data" "linux/blkdev.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "struct queue_limits q;q.discard_zeroes_data" "linux/blkdev.h"
|
||||||
then
|
then
|
||||||
add_define "CAS_SET_DISCARD_ZEROES_DATA(queue_limits, val) \\
|
echo $cur_name "1" >> $config_file_path
|
||||||
queue_limits.discard_zeroes_data = val"
|
|
||||||
else
|
else
|
||||||
add_define "CAS_SET_DISCARD_ZEROES_DATA(queue_limits, val) \\
|
echo $cur_name "2" >> $config_file_path
|
||||||
({})"
|
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
|
add_define "CAS_SET_DISCARD_ZEROES_DATA(queue_limits, val) \\
|
||||||
|
queue_limits.discard_zeroes_data = val" ;;
|
||||||
|
"2")
|
||||||
|
add_define "CAS_SET_DISCARD_ZEROES_DATA(queue_limits, val) \\
|
||||||
|
({})" ;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,18 +4,37 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "REQ_PREFLUSH" "linux/blk_types.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "REQ_PREFLUSH" "linux/blk_types.h"
|
||||||
then
|
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 \\
|
add_define "CAS_REQ_FLUSH \\
|
||||||
REQ_PREFLUSH"
|
REQ_PREFLUSH"
|
||||||
add_define "CAS_FLUSH_SUPPORTED \\
|
add_define "CAS_FLUSH_SUPPORTED \\
|
||||||
1"
|
1" ;;
|
||||||
elif compile_module "REQ_FLUSH" "linux/blk_types.h"
|
"2")
|
||||||
then
|
|
||||||
add_define "CAS_REQ_FLUSH \\
|
add_define "CAS_REQ_FLUSH \\
|
||||||
REQ_FLUSH"
|
REQ_FLUSH"
|
||||||
add_define "CAS_FLUSH_SUPPORTED \\
|
add_define "CAS_FLUSH_SUPPORTED \\
|
||||||
1"
|
1" ;;
|
||||||
fi
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,11 +4,31 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if
|
check() {
|
||||||
compile_module "generic_start_io_acct(NULL, 0, 0, NULL)" "linux/bio.h"
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "generic_start_io_acct(NULL, 0, 0, NULL)" "linux/bio.h"
|
||||||
then
|
then
|
||||||
|
echo $cur_name "1" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "generic_start_io_acct(0, 0, NULL)" "linux/bio.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "2" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "part_round_stats(1, 1)" "linux/genhd.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "3" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "part_round_stats(NULL, 1, 1)" "linux/genhd.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "4" >> $config_file_path
|
||||||
|
else
|
||||||
|
echo $cur_name "X" >> $config_file_path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
add_function "
|
add_function "
|
||||||
static inline void cas_generic_start_io_acct(struct request_queue *q,
|
static inline void cas_generic_start_io_acct(struct request_queue *q,
|
||||||
int rw, unsigned long sectors, struct hd_struct *part) {
|
int rw, unsigned long sectors, struct hd_struct *part) {
|
||||||
@ -19,9 +39,8 @@ static inline void cas_generic_end_io_acct(struct request_queue *q,
|
|||||||
int rw, struct hd_struct *part, unsigned long start_time)
|
int rw, struct hd_struct *part, unsigned long start_time)
|
||||||
{
|
{
|
||||||
generic_end_io_acct(q, rw, part, start_time);
|
generic_end_io_acct(q, rw, part, start_time);
|
||||||
}"
|
}" ;;
|
||||||
elif compile_module "generic_start_io_acct(0, 0, NULL)" "linux/bio.h"
|
"2")
|
||||||
then
|
|
||||||
add_function "
|
add_function "
|
||||||
static inline void cas_generic_start_io_acct(struct request_queue *q,
|
static inline void cas_generic_start_io_acct(struct request_queue *q,
|
||||||
int rw, unsigned long sectors, struct hd_struct *part)
|
int rw, unsigned long sectors, struct hd_struct *part)
|
||||||
@ -33,9 +52,8 @@ static inline void cas_generic_end_io_acct(struct request_queue *q,
|
|||||||
int rw, struct hd_struct *part, unsigned long start_time)
|
int rw, struct hd_struct *part, unsigned long start_time)
|
||||||
{
|
{
|
||||||
generic_end_io_acct(rw, part, start_time);
|
generic_end_io_acct(rw, part, start_time);
|
||||||
}"
|
}" ;;
|
||||||
elif compile_module "part_round_stats(1, 1)" "linux/genhd.h"
|
"3")
|
||||||
then
|
|
||||||
add_function "
|
add_function "
|
||||||
static inline void cas_generic_start_io_acct(struct request_queue *q,
|
static inline void cas_generic_start_io_acct(struct request_queue *q,
|
||||||
int rw, unsigned long sectors, struct hd_struct *part)
|
int rw, unsigned long sectors, struct hd_struct *part)
|
||||||
@ -57,9 +75,8 @@ static inline void cas_generic_end_io_acct(struct request_queue *q,
|
|||||||
part_round_stats(cpu, part);
|
part_round_stats(cpu, part);
|
||||||
part_dec_in_flight(part, rw);
|
part_dec_in_flight(part, rw);
|
||||||
part_stat_unlock();
|
part_stat_unlock();
|
||||||
}"
|
}" ;;
|
||||||
elif compile_module "part_round_stats(NULL, 1, 1)" "linux/genhd.h"
|
"4")
|
||||||
then
|
|
||||||
add_function "
|
add_function "
|
||||||
static inline void cas_generic_start_io_acct(struct request_queue *q,
|
static inline void cas_generic_start_io_acct(struct request_queue *q,
|
||||||
int rw, unsigned long sectors, struct hd_struct *part)
|
int rw, unsigned long sectors, struct hd_struct *part)
|
||||||
@ -81,5 +98,10 @@ static inline void cas_generic_end_io_acct(struct request_queue *q,
|
|||||||
part_round_stats(NULL, cpu, part);
|
part_round_stats(NULL, cpu, part);
|
||||||
part_dec_in_flight(NULL, part, rw);
|
part_dec_in_flight(NULL, part, rw);
|
||||||
part_stat_unlock();
|
part_stat_unlock();
|
||||||
}"
|
}" ;;
|
||||||
fi
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,11 +4,25 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
|
check() {
|
||||||
if compile_module "global_zone_page_state(1)" "linux/mm.h"
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "global_zone_page_state(1)" "linux/mm.h"
|
||||||
then
|
then
|
||||||
|
echo $cur_name "1" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "global_page_state(1)" "linux/mm.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "2" >> $config_file_path
|
||||||
|
else
|
||||||
|
echo $cur_name "X" >> $config_file_path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
add_function "
|
add_function "
|
||||||
static inline unsigned long cas_global_zone_page_state(enum zone_stat_item item)
|
static inline unsigned long cas_global_zone_page_state(enum zone_stat_item item)
|
||||||
{
|
{
|
||||||
@ -17,9 +31,8 @@ static inline unsigned long cas_global_zone_page_state(enum zone_stat_item item)
|
|||||||
add_define "CAS_BIO_SET_DEV(bio, bdev) \\
|
add_define "CAS_BIO_SET_DEV(bio, bdev) \\
|
||||||
bio_set_dev(bio, bdev)"
|
bio_set_dev(bio, bdev)"
|
||||||
add_define "CAS_BIO_GET_DEV(bio) \\
|
add_define "CAS_BIO_GET_DEV(bio) \\
|
||||||
bio->bi_disk"
|
bio->bi_disk" ;;
|
||||||
elif compile_module "global_page_state(1)" "linux/mm.h"
|
"2")
|
||||||
then
|
|
||||||
add_function "
|
add_function "
|
||||||
static inline unsigned long cas_global_zone_page_state(enum zone_stat_item item)
|
static inline unsigned long cas_global_zone_page_state(enum zone_stat_item item)
|
||||||
{
|
{
|
||||||
@ -28,5 +41,10 @@ static inline unsigned long cas_global_zone_page_state(enum zone_stat_item item)
|
|||||||
add_define "CAS_BIO_SET_DEV(bio, bdev) \\
|
add_define "CAS_BIO_SET_DEV(bio, bdev) \\
|
||||||
bio->bi_bdev = bdev"
|
bio->bi_bdev = bdev"
|
||||||
add_define "CAS_BIO_GET_DEV(bio) \\
|
add_define "CAS_BIO_GET_DEV(bio) \\
|
||||||
bio->bi_bdev->bd_disk"
|
bio->bi_bdev->bd_disk" ;;
|
||||||
fi
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,22 +4,41 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "struct hlist_node list" "linux/types.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "struct hlist_node list" "linux/types.h"
|
||||||
then
|
then
|
||||||
|
echo $cur_name "1" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "struct list_head list" "linux/list.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_ALIAS_NODE_TYPE \\
|
add_define "CAS_ALIAS_NODE_TYPE \\
|
||||||
struct hlist_node"
|
struct hlist_node"
|
||||||
add_define "CAS_DENTRY_LIST_EMPTY(head) \\
|
add_define "CAS_DENTRY_LIST_EMPTY(head) \\
|
||||||
hlist_empty(head)"
|
hlist_empty(head)"
|
||||||
add_define "CAS_INODE_FOR_EACH_DENTRY(pos, head) \\
|
add_define "CAS_INODE_FOR_EACH_DENTRY(pos, head) \\
|
||||||
hlist_for_each(pos, head)"
|
hlist_for_each(pos, head)" ;;
|
||||||
elif compile_module "struct list_head list" "linux/list.h"
|
"2")
|
||||||
then
|
|
||||||
add_define "CAS_ALIAS_NODE_TYPE \\
|
add_define "CAS_ALIAS_NODE_TYPE \\
|
||||||
struct list_head"
|
struct list_head"
|
||||||
add_define "CAS_DENTRY_LIST_EMPTY(head) \\
|
add_define "CAS_DENTRY_LIST_EMPTY(head) \\
|
||||||
list_empty(head)"
|
list_empty(head)"
|
||||||
add_define "CAS_INODE_FOR_EACH_DENTRY(pos, head) \\
|
add_define "CAS_INODE_FOR_EACH_DENTRY(pos, head) \\
|
||||||
list_for_each(pos, head)"
|
list_for_each(pos, head)" ;;
|
||||||
fi
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,14 +4,33 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "struct file file;file.f_inode" "linux/fs.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "struct file file;file.f_inode" "linux/fs.h"
|
||||||
then
|
then
|
||||||
add_define "CAS_FILE_INODE(file) \\
|
echo $cur_name "1" >> $config_file_path
|
||||||
file->f_inode"
|
elif compile_module $cur_name "struct file file;file->f_dentry->d_inode" "linux/fs.h"
|
||||||
elif compile_module "struct file file;file->f_dentry->d_inode" "linux/fs.h"
|
|
||||||
then
|
then
|
||||||
add_define "CAS_FILE_INODE(file) \\
|
echo $cur_name "2" >> $config_file_path
|
||||||
file->f_dentry->d_inode"
|
else
|
||||||
|
echo $cur_name "X" >> $config_file_path
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
|
add_define "CAS_FILE_INODE(file) \\
|
||||||
|
file->f_inode" ;;
|
||||||
|
"2")
|
||||||
|
add_define "CAS_FILE_INODE(file) \\
|
||||||
|
file->f_dentry->d_inode" ;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,10 +4,25 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "vm_munmap(0, 0)" "linux/mm.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "vm_munmap(0, 0)" "linux/mm.h"
|
||||||
then
|
then
|
||||||
|
echo $cur_name "1" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "do_munmap(NULL, 0)" "linux/mm.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "2" >> $config_file_path
|
||||||
|
else
|
||||||
|
echo $cur_name "X" >> $config_file_path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
add_function "
|
add_function "
|
||||||
#include <uapi/asm-generic/mman-common.h>
|
#include <uapi/asm-generic/mman-common.h>
|
||||||
static inline unsigned long cas_vm_mmap(struct file *file,
|
static inline unsigned long cas_vm_mmap(struct file *file,
|
||||||
@ -20,9 +35,8 @@ static inline unsigned long cas_vm_mmap(struct file *file,
|
|||||||
static inline int cas_vm_munmap(unsigned long start, size_t len)
|
static inline int cas_vm_munmap(unsigned long start, size_t len)
|
||||||
{
|
{
|
||||||
return vm_munmap(start, len);
|
return vm_munmap(start, len);
|
||||||
}"
|
}" ;;
|
||||||
elif compile_module "do_munmap(NULL, 0)" "linux/mm.h"
|
"2")
|
||||||
then
|
|
||||||
add_function "
|
add_function "
|
||||||
#include <asm-generic/mman-common.h>
|
#include <asm-generic/mman-common.h>
|
||||||
static inline unsigned long cas_vm_mmap(struct file *file,
|
static inline unsigned long cas_vm_mmap(struct file *file,
|
||||||
@ -35,5 +49,10 @@ static inline unsigned long cas_vm_mmap(struct file *file,
|
|||||||
static inline int cas_vm_munmap(unsigned long start, size_t len)
|
static inline int cas_vm_munmap(unsigned long start, size_t len)
|
||||||
{
|
{
|
||||||
return do_munmap(current->mm, start, len);
|
return do_munmap(current->mm, start, len);
|
||||||
}"
|
}" ;;
|
||||||
fi
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,13 +4,30 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "blk_queue_bounce(NULL, NULL);" "linux/blkdev.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "blk_queue_bounce(NULL, NULL);" "linux/blkdev.h"
|
||||||
then
|
then
|
||||||
add_define "cas_blk_queue_bounce(q, bounce_bio) \\
|
echo $cur_name "1" >> $config_file_path
|
||||||
blk_queue_bounce(q, bounce_bio)"
|
|
||||||
else
|
else
|
||||||
add_define "cas_blk_queue_bounce(q, bounce_bio) \\
|
echo $cur_name "2" >> $config_file_path
|
||||||
({})"
|
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
|
add_define "cas_blk_queue_bounce(q, bounce_bio) \\
|
||||||
|
blk_queue_bounce(q, bounce_bio)" ;;
|
||||||
|
"2")
|
||||||
|
add_define "cas_blk_queue_bounce(q, bounce_bio) \\
|
||||||
|
({})" ;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,13 +4,30 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "struct request_queue q;q.limits.chunk_sectors" "linux/blkdev.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "struct request_queue q;q.limits.chunk_sectors" "linux/blkdev.h"
|
||||||
then
|
then
|
||||||
add_define "CAS_SET_QUEUE_CHUNK_SECTORS(queue, chunk_size) \\
|
echo $cur_name "1" >> $config_file_path
|
||||||
queue->limits.chunk_sectors = chunk_size"
|
|
||||||
else
|
else
|
||||||
add_define "CAS_SET_QUEUE_CHUNK_SECTORS(queue, chunk_size) \\
|
echo $cur_name "2" >> $config_file_path
|
||||||
{;}"
|
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
|
add_define "CAS_SET_QUEUE_CHUNK_SECTORS(queue, chunk_size) \\
|
||||||
|
queue->limits.chunk_sectors = chunk_size" ;;
|
||||||
|
"2")
|
||||||
|
add_define "CAS_SET_QUEUE_CHUNK_SECTORS(queue, chunk_size) \\
|
||||||
|
{;}" ;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,13 +4,30 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "blk_queue_flag_set(0, NULL)" "linux/blkdev.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "blk_queue_flag_set(0, NULL)" "linux/blkdev.h"
|
||||||
then
|
then
|
||||||
add_define "cas_queue_flag_set_unlocked(flag, request_queue) \\
|
echo $cur_name "1" >> $config_file_path
|
||||||
blk_queue_flag_set(flag, request_queue)"
|
|
||||||
else
|
else
|
||||||
add_define "cas_queue_flag_set_unlocked(flag, request_queue) \\
|
echo $cur_name "2" >> $config_file_path
|
||||||
queue_flag_set_unlocked(flag, request_queue)"
|
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
|
add_define "cas_queue_flag_set_unlocked(flag, request_queue) \\
|
||||||
|
blk_queue_flag_set(flag, request_queue)" ;;
|
||||||
|
"2")
|
||||||
|
add_define "cas_queue_flag_set_unlocked(flag, request_queue) \\
|
||||||
|
queue_flag_set_unlocked(flag, request_queue)" ;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,11 +4,29 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
# RHEL 7.3
|
# RHEL 7.3
|
||||||
if compile_module "struct queue_limits q;q.limits_aux" "linux/blkdev.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "struct queue_limits q;q.limits_aux" "linux/blkdev.h"
|
||||||
then
|
then
|
||||||
|
echo $cur_name "1" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "struct queue_limits q;q.max_write_zeroes_sectors" "linux/blkdev.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "2" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "struct queue_limits q;q.max_write_same_sectors" "linux/blkdev.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "3" >> $config_file_path
|
||||||
|
else
|
||||||
|
echo $cur_name "X" >> $config_file_path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
add_function "
|
add_function "
|
||||||
static inline void cas_copy_queue_limits(struct request_queue *exp_q,
|
static inline void cas_copy_queue_limits(struct request_queue *exp_q,
|
||||||
struct request_queue *cache_q, struct request_queue *core_q)
|
struct request_queue *cache_q, struct request_queue *core_q)
|
||||||
@ -24,9 +42,8 @@ static inline void cas_copy_queue_limits(struct request_queue *exp_q,
|
|||||||
exp_q->limits.max_write_same_sectors = 0;
|
exp_q->limits.max_write_same_sectors = 0;
|
||||||
if (queue_virt_boundary(cache_q))
|
if (queue_virt_boundary(cache_q))
|
||||||
queue_flag_set(QUEUE_FLAG_NOMERGES, cache_q);
|
queue_flag_set(QUEUE_FLAG_NOMERGES, cache_q);
|
||||||
}"
|
}" ;;
|
||||||
elif compile_module "struct queue_limits q;q.max_write_zeroes_sectors" "linux/blkdev.h"
|
"2")
|
||||||
then
|
|
||||||
add_function "
|
add_function "
|
||||||
static inline void cas_copy_queue_limits(struct request_queue *exp_q,
|
static inline void cas_copy_queue_limits(struct request_queue *exp_q,
|
||||||
struct request_queue *cache_q, struct request_queue *core_q)
|
struct request_queue *cache_q, struct request_queue *core_q)
|
||||||
@ -37,9 +54,8 @@ static inline void cas_copy_queue_limits(struct request_queue *exp_q,
|
|||||||
exp_q->limits.max_segments = core_q->limits.max_segments;
|
exp_q->limits.max_segments = core_q->limits.max_segments;
|
||||||
exp_q->limits.max_write_same_sectors = 0;
|
exp_q->limits.max_write_same_sectors = 0;
|
||||||
exp_q->limits.max_write_zeroes_sectors = 0;
|
exp_q->limits.max_write_zeroes_sectors = 0;
|
||||||
}"
|
}" ;;
|
||||||
elif compile_module "struct queue_limits q;q.max_write_same_sectors" "linux/blkdev.h"
|
"3")
|
||||||
then
|
|
||||||
add_function "
|
add_function "
|
||||||
static inline void cas_copy_queue_limits(struct request_queue *exp_q,
|
static inline void cas_copy_queue_limits(struct request_queue *exp_q,
|
||||||
struct request_queue *cache_q, struct request_queue *core_q)
|
struct request_queue *cache_q, struct request_queue *core_q)
|
||||||
@ -49,5 +65,10 @@ static inline void cas_copy_queue_limits(struct request_queue *exp_q,
|
|||||||
exp_q->limits.max_hw_sectors = core_q->limits.max_hw_sectors;
|
exp_q->limits.max_hw_sectors = core_q->limits.max_hw_sectors;
|
||||||
exp_q->limits.max_segments = core_q->limits.max_segments;
|
exp_q->limits.max_segments = core_q->limits.max_segments;
|
||||||
exp_q->limits.max_write_same_sectors = 0;
|
exp_q->limits.max_write_same_sectors = 0;
|
||||||
}"
|
}" ;;
|
||||||
fi
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,16 +4,28 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "REQ_TYPE_FS" "linux/blkdev.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "REQ_TYPE_FS" "linux/blkdev.h"
|
||||||
then
|
then
|
||||||
|
echo $cur_name "1" >> $config_file_path
|
||||||
|
else
|
||||||
|
echo $cur_name "2" >> $config_file_path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
add_function "
|
add_function "
|
||||||
static inline int cas_is_rq_type_fs(struct request *rq)
|
static inline int cas_is_rq_type_fs(struct request *rq)
|
||||||
{
|
{
|
||||||
return rq->cmd_type == REQ_TYPE_FS;
|
return rq->cmd_type == REQ_TYPE_FS;
|
||||||
}"
|
}" ;;
|
||||||
else
|
"2")
|
||||||
add_function "
|
add_function "
|
||||||
static inline int cas_is_rq_type_fs(struct request *rq)
|
static inline int cas_is_rq_type_fs(struct request *rq)
|
||||||
{
|
{
|
||||||
@ -26,5 +38,10 @@ static inline int cas_is_rq_type_fs(struct request *rq)
|
|||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}"
|
}" ;;
|
||||||
fi
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,41 +4,64 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
# submit_bio() can be defined in "bio.h" or in "fs.h"
|
# submit_bio() can be defined in "bio.h" or in "fs.h"
|
||||||
# If it is defind in fs.h, three possibilities are available:
|
# If it is defind in fs.h, three possibilities are available:
|
||||||
# * it takes one argument and retuns non-void
|
# * it takes one argument and retuns non-void
|
||||||
# * it takes two arguments and returns non-void
|
# * it takes two arguments and returns non-void
|
||||||
# * it takse two arguments and is void-type
|
# * it takse two arguments and is void-type
|
||||||
if compile_module "submit_bio(NULL)" "linux/bio.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "submit_bio(NULL)" "linux/bio.h"
|
||||||
then
|
then
|
||||||
|
echo $cur_name "1" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "submit_bio(NULL)" "linux/fs.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "2" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "void *t=submit_bio(0, NULL)" "linux/fs.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "4" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "submit_bio(0, NULL)" "linux/fs.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "4" >> $config_file_path
|
||||||
|
else
|
||||||
|
echo $cur_name "X" >> $config_file_path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
add_function "
|
add_function "
|
||||||
static inline blk_qc_t cas_submit_bio(int rw, struct bio *bio)
|
static inline blk_qc_t cas_submit_bio(int rw, struct bio *bio)
|
||||||
{
|
{
|
||||||
CAS_BIO_OP_FLAGS(bio) |= rw;
|
CAS_BIO_OP_FLAGS(bio) |= rw;
|
||||||
return submit_bio(bio);
|
return submit_bio(bio);
|
||||||
}"
|
}" ;;
|
||||||
elif compile_module "submit_bio(NULL)" "linux/fs.h"
|
"2")
|
||||||
then
|
|
||||||
add_function "
|
add_function "
|
||||||
static inline blk_qc_t cas_submit_bio(int rw, struct bio *bio)
|
static inline blk_qc_t cas_submit_bio(int rw, struct bio *bio)
|
||||||
{
|
{
|
||||||
CAS_BIO_OP_FLAGS(bio) |= rw;
|
CAS_BIO_OP_FLAGS(bio) |= rw;
|
||||||
return submit_bio(bio);
|
return submit_bio(bio);
|
||||||
}"
|
}" ;;
|
||||||
elif compile_module "void *t=submit_bio(0, NULL)" "linux/fs.h"
|
"3")
|
||||||
then
|
|
||||||
add_function "
|
add_function "
|
||||||
static inline blk_qc_t cas_submit_bio(int rw, struct bio *bio)
|
static inline blk_qc_t cas_submit_bio(int rw, struct bio *bio)
|
||||||
{
|
{
|
||||||
return submit_bio(rw, bio);
|
return submit_bio(rw, bio);
|
||||||
}"
|
}" ;;
|
||||||
elif compile_module "submit_bio(0, NULL)" "linux/fs.h"
|
"4")
|
||||||
then
|
|
||||||
add_function "
|
add_function "
|
||||||
static inline void cas_submit_bio(int rw, struct bio *bio)
|
static inline void cas_submit_bio(int rw, struct bio *bio)
|
||||||
{
|
{
|
||||||
submit_bio(rw, bio);
|
submit_bio(rw, bio);
|
||||||
}"
|
}" ;;
|
||||||
fi
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Copyright(c) 2012-2019 Intel Corporation
|
|
||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
|
||||||
#
|
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
|
||||||
|
|
||||||
if compile_module "struct bio b;b.bi_write_hint" "linux/bio.h"
|
|
||||||
then
|
|
||||||
add_define "CAS_WLTH_SUPPORT \\
|
|
||||||
1"
|
|
||||||
fi
|
|
@ -4,14 +4,33 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "WRITE" "linux/blk_types.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "WRITE" "linux/blk_types.h"
|
||||||
then
|
then
|
||||||
add_define "CAS_RQ_DATA_DIR_WR \\
|
echo $cur_name "1" >> $config_file_path
|
||||||
WRITE"
|
elif compile_module $cur_name "REQ_WRITE" "linux/blk_types.h"
|
||||||
elif compile_module "REQ_WRITE" "linux/blk_types.h"
|
|
||||||
then
|
then
|
||||||
add_define "CAS_RQ_DATA_DIR_WR \\
|
echo $cur_name "2" >> $config_file_path
|
||||||
REQ_WRITE"
|
else
|
||||||
|
echo $cur_name "X" >> $config_file_path
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
|
add_define "CAS_RQ_DATA_DIR_WR \\
|
||||||
|
WRITE" ;;
|
||||||
|
"2")
|
||||||
|
add_define "CAS_RQ_DATA_DIR_WR \\
|
||||||
|
REQ_WRITE" ;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,29 +4,52 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "WRITE_FUA" "linux/fs.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "WRITE_FUA" "linux/fs.h"
|
||||||
then
|
then
|
||||||
|
if compile_module $cur_name "BIO_FUA" "linux/bio.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "1" >> $config_file_path
|
||||||
|
else
|
||||||
|
echo $cur_name "2" >> $config_file_path
|
||||||
|
fi
|
||||||
|
elif compile_module $cur_name "REQ_FUA" "linux/blk_types.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "3" >> $config_file_path
|
||||||
|
else
|
||||||
|
echo $cur_name "4" >> $config_file_path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
add_define "CAS_WRITE_FUA \\
|
add_define "CAS_WRITE_FUA \\
|
||||||
WRITE_FUA"
|
WRITE_FUA"
|
||||||
if compile_module "BIO_FUA" "linux/bio.h"
|
|
||||||
then
|
|
||||||
add_define "CAS_IS_WRITE_FUA(flags) \\
|
add_define "CAS_IS_WRITE_FUA(flags) \\
|
||||||
((flags) & BIO_FUA)"
|
((flags) & BIO_FUA)" ;;
|
||||||
else
|
"2")
|
||||||
|
add_define "CAS_WRITE_FUA \\
|
||||||
|
WRITE_FUA"
|
||||||
add_define "CAS_IS_WRITE_FUA(flags) \\
|
add_define "CAS_IS_WRITE_FUA(flags) \\
|
||||||
((flags) & REQ_FUA)"
|
((flags) & REQ_FUA)" ;;
|
||||||
fi
|
"3")
|
||||||
elif compile_module "REQ_FUA" "linux/blk_types.h"
|
|
||||||
then
|
|
||||||
add_define "CAS_IS_WRITE_FUA(flags) \\
|
add_define "CAS_IS_WRITE_FUA(flags) \\
|
||||||
((flags) & REQ_FUA)"
|
((flags) & REQ_FUA)"
|
||||||
add_define "CAS_WRITE_FUA \\
|
add_define "CAS_WRITE_FUA \\
|
||||||
REQ_FUA"
|
REQ_FUA" ;;
|
||||||
else
|
"4")
|
||||||
add_define "CAS_IS_WRITE_FUA(flags) \\
|
add_define "CAS_IS_WRITE_FUA(flags) \\
|
||||||
0"
|
0"
|
||||||
add_define "CAS_WRITE_FUA \\
|
add_define "CAS_WRITE_FUA \\
|
||||||
WRITE_BARRIER"
|
WRITE_BARRIER" ;;
|
||||||
fi
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
28
configure.d/1_wtlh.conf
Normal file
28
configure.d/1_wtlh.conf
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright(c) 2012-2019 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 b;b.bi_write_hint" "linux/bio.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "1" >> $config_file_path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
|
add_define "CAS_WLTH_SUPPORT \\
|
||||||
|
1" ;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
@ -4,18 +4,39 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "RQF_SOFTBARRIER" "linux/blkdev.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "RQF_SOFTBARRIER" "linux/blkdev.h"
|
||||||
then
|
then
|
||||||
add_define "CAS_CHECK_BARRIER(bio) \\
|
echo $cur_name "1" >> $config_file_path
|
||||||
((CAS_BIO_OP_FLAGS(bio) & RQF_SOFTBARRIER) != 0)"
|
elif compile_module $cur_name "REQ_SOFTBARRIER" "linux/blk_types.h"
|
||||||
elif compile_module "REQ_SOFTBARRIER" "linux/blk_types.h"
|
|
||||||
then
|
then
|
||||||
add_define "CAS_CHECK_BARRIER(bio) \\
|
echo $cur_name "2" >> $config_file_path
|
||||||
((CAS_BIO_OP_FLAGS(bio) & REQ_SOFTBARRIER) != 0)"
|
elif compile_module $cur_name "BIO_RW_BARRIER" "linux/fs.h"
|
||||||
elif compile_module "BIO_RW_BARRIER" "linux/fs.h"
|
|
||||||
then
|
then
|
||||||
add_define "CAS_CHECK_BARRIER(bio) \\
|
echo $cur_name "3" >> $config_file_path
|
||||||
(bio_rw_flagged((bio), BIO_RW_BARRIER))"
|
else
|
||||||
|
echo $cur_name "X" >> $config_file_path
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
|
add_define "CAS_CHECK_BARRIER(bio) \\
|
||||||
|
((CAS_BIO_OP_FLAGS(bio) & RQF_SOFTBARRIER) != 0)" ;;
|
||||||
|
"2")
|
||||||
|
add_define "CAS_CHECK_BARRIER(bio) \\
|
||||||
|
((CAS_BIO_OP_FLAGS(bio) & REQ_SOFTBARRIER) != 0)" ;;
|
||||||
|
"3")
|
||||||
|
add_define "CAS_CHECK_BARRIER(bio) \\
|
||||||
|
(bio_rw_flagged((bio), BIO_RW_BARRIER))" ;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,29 +4,52 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "WRITE_FLUSH_FUA" "linux/fs.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "WRITE_FLUSH_FUA" "linux/fs.h"
|
||||||
then
|
then
|
||||||
|
if compile_module $cur_name "BIO_FUA" "linux/bio.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "1" >> $config_file_path
|
||||||
|
else
|
||||||
|
echo $cur_name "2" >> $config_file_path
|
||||||
|
fi
|
||||||
|
elif compile_module $cur_name "REQ_PREFLUSH" "linux/blk_types.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "3" >> $config_file_path
|
||||||
|
else
|
||||||
|
echo $cur_name "4" >> $config_file_path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
add_define "CAS_WRITE_FLUSH_FUA \\
|
add_define "CAS_WRITE_FLUSH_FUA \\
|
||||||
WRITE_FLUSH_FUA"
|
WRITE_FLUSH_FUA"
|
||||||
if compile_module "BIO_FUA" "linux/bio.h"
|
|
||||||
then
|
|
||||||
add_define "CAS_IS_WRITE_FLUSH_FUA(flags) \\
|
add_define "CAS_IS_WRITE_FLUSH_FUA(flags) \\
|
||||||
((BIO_FUA | BIO_FLUSH) == ((flags) & (BIO_FUA | BIO_FLUSH)))"
|
((BIO_FUA | BIO_FLUSH) == ((flags) & (BIO_FUA | BIO_FLUSH)))" ;;
|
||||||
else
|
"2")
|
||||||
|
add_define "CAS_WRITE_FLUSH_FUA \\
|
||||||
|
WRITE_FLUSH_FUA"
|
||||||
add_define "CAS_IS_WRITE_FLUSH_FUA(flags) \\
|
add_define "CAS_IS_WRITE_FLUSH_FUA(flags) \\
|
||||||
((REQ_FUA | CAS_REQ_FLUSH) == ((flags) & (REQ_FUA | CAS_REQ_FLUSH)))"
|
((REQ_FUA | CAS_REQ_FLUSH) == ((flags) & (REQ_FUA | CAS_REQ_FLUSH)))" ;;
|
||||||
fi
|
"3")
|
||||||
elif compile_module "REQ_PREFLUSH" "linux/blk_types.h"
|
|
||||||
then
|
|
||||||
add_define "CAS_IS_WRITE_FLUSH_FUA(flags) \\
|
add_define "CAS_IS_WRITE_FLUSH_FUA(flags) \\
|
||||||
((REQ_PREFLUSH | REQ_FUA) == ((flags) & (REQ_PREFLUSH |REQ_FUA)))"
|
((REQ_PREFLUSH | REQ_FUA) == ((flags) & (REQ_PREFLUSH |REQ_FUA)))"
|
||||||
add_define "CAS_WRITE_FLUSH_FUA \\
|
add_define "CAS_WRITE_FLUSH_FUA \\
|
||||||
(REQ_PREFLUSH | REQ_FUA)"
|
(REQ_PREFLUSH | REQ_FUA)" ;;
|
||||||
else
|
"4")
|
||||||
add_define "CAS_IS_WRITE_FLUSH_FUA(flags) \\
|
add_define "CAS_IS_WRITE_FLUSH_FUA(flags) \\
|
||||||
0"
|
0"
|
||||||
add_define "CAS_WRITE_FLUSH_FUA \\
|
add_define "CAS_WRITE_FLUSH_FUA \\
|
||||||
WRITE_BARRIER"
|
WRITE_BARRIER" ;;
|
||||||
fi
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,17 +4,29 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "blk_make_request(NULL, NULL, 0)" "linux/blkdev.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "blk_make_request(NULL, NULL, 0)" "linux/blkdev.h"
|
||||||
then
|
then
|
||||||
|
echo $cur_name "1" >> $config_file_path
|
||||||
|
else
|
||||||
|
echo $cur_name "2" >> $config_file_path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
add_function "
|
add_function "
|
||||||
static inline struct request *cas_blk_make_request(struct request_queue *q,
|
static inline struct request *cas_blk_make_request(struct request_queue *q,
|
||||||
struct bio *bio, gfp_t gfp_mask)
|
struct bio *bio, gfp_t gfp_mask)
|
||||||
{
|
{
|
||||||
return blk_make_request(q, bio, gfp_mask);
|
return blk_make_request(q, bio, gfp_mask);
|
||||||
}"
|
}" ;;
|
||||||
else
|
"2")
|
||||||
add_function "
|
add_function "
|
||||||
static inline struct request *cas_blk_make_request(struct request_queue *q,
|
static inline struct request *cas_blk_make_request(struct request_queue *q,
|
||||||
struct bio *bio, gfp_t gfp_mask)
|
struct bio *bio, gfp_t gfp_mask)
|
||||||
@ -35,5 +47,10 @@ static inline struct request *cas_blk_make_request(struct request_queue *q,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rq;
|
return rq;
|
||||||
}"
|
}" ;;
|
||||||
fi
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,10 +4,25 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "blk_queue_write_cache(NULL, 0, 0)" "linux/blkdev.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "blk_queue_write_cache(NULL, 0, 0)" "linux/blkdev.h"
|
||||||
then
|
then
|
||||||
|
echo $cur_name "1" >> $config_file_path
|
||||||
|
elif compile_module $cur_name "struct request_queue rq;rq.flush_flags" "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_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) \\
|
||||||
@ -17,9 +32,8 @@ 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);
|
||||||
}"
|
}" ;;
|
||||||
elif compile_module "struct request_queue rq;rq.flush_flags" "linux/blkdev.h"
|
"2")
|
||||||
then
|
|
||||||
add_define "CAS_CHECK_QUEUE_FLUSH(q) \\
|
add_define "CAS_CHECK_QUEUE_FLUSH(q) \\
|
||||||
((q)->flush_flags & CAS_REQ_FLUSH)"
|
((q)->flush_flags & CAS_REQ_FLUSH)"
|
||||||
add_define "CAS_CHECK_QUEUE_FUA(q) \\
|
add_define "CAS_CHECK_QUEUE_FUA(q) \\
|
||||||
@ -34,5 +48,10 @@ then
|
|||||||
flags |= REQ_FUA;
|
flags |= REQ_FUA;
|
||||||
if (flags)
|
if (flags)
|
||||||
blk_queue_flush(q, flags);
|
blk_queue_flush(q, flags);
|
||||||
}"
|
}" ;;
|
||||||
fi
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -4,35 +4,60 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
. `dirname $0`/conf_framework
|
. $(dirname $3)/conf_framework
|
||||||
|
|
||||||
if compile_module "WRITE_FLUSH" "linux/fs.h"
|
check() {
|
||||||
|
cur_name=$(basename $2)
|
||||||
|
config_file_path=$1
|
||||||
|
if compile_module $cur_name "WRITE_FLUSH" "linux/fs.h"
|
||||||
then
|
then
|
||||||
|
if compile_module $cur_name "BIO_FLUSH" "linux/bio.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "1" >> $config_file_path
|
||||||
|
else
|
||||||
|
echo $cur_name "2" >> $config_file_path
|
||||||
|
fi
|
||||||
|
elif compile_module $cur_name "REQ_PREFLUSH" "linux/blk_types.h"
|
||||||
|
then
|
||||||
|
echo $cur_name "3" >> $config_file_path
|
||||||
|
else
|
||||||
|
echo $cur_name "4" >> $config_file_path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
apply() {
|
||||||
|
case "$1" in
|
||||||
|
"1")
|
||||||
add_define "CAS_RQ_IS_FLUSH(rq) \\
|
add_define "CAS_RQ_IS_FLUSH(rq) \\
|
||||||
((rq)->cmd_flags & CAS_REQ_FLUSH)"
|
((rq)->cmd_flags & CAS_REQ_FLUSH)"
|
||||||
add_define "CAS_WRITE_FLUSH \\
|
add_define "CAS_WRITE_FLUSH \\
|
||||||
WRITE_FLUSH"
|
WRITE_FLUSH"
|
||||||
if compile_module "BIO_FLUSH" "linux/bio.h"
|
|
||||||
then
|
|
||||||
add_define "CAS_IS_WRITE_FLUSH(flags) \\
|
add_define "CAS_IS_WRITE_FLUSH(flags) \\
|
||||||
((flags) & BIO_FLUSH)"
|
((flags) & BIO_FLUSH)" ;;
|
||||||
else
|
"2")
|
||||||
|
add_define "CAS_RQ_IS_FLUSH(rq) \\
|
||||||
|
((rq)->cmd_flags & CAS_REQ_FLUSH)"
|
||||||
|
add_define "CAS_WRITE_FLUSH \\
|
||||||
|
WRITE_FLUSH"
|
||||||
add_define "CAS_IS_WRITE_FLUSH(flags) \\
|
add_define "CAS_IS_WRITE_FLUSH(flags) \\
|
||||||
((flags) & CAS_REQ_FLUSH)"
|
((flags) & CAS_REQ_FLUSH)" ;;
|
||||||
fi
|
"3")
|
||||||
elif compile_module "REQ_PREFLUSH" "linux/blk_types.h"
|
|
||||||
then
|
|
||||||
add_define "CAS_RQ_IS_FLUSH(rq) \\
|
add_define "CAS_RQ_IS_FLUSH(rq) \\
|
||||||
((rq)->cmd_flags & REQ_PREFLUSH)"
|
((rq)->cmd_flags & REQ_PREFLUSH)"
|
||||||
add_define "CAS_WRITE_FLUSH \\
|
add_define "CAS_WRITE_FLUSH \\
|
||||||
(REQ_OP_WRITE | REQ_PREFLUSH)"
|
(REQ_OP_WRITE | REQ_PREFLUSH)"
|
||||||
add_define "CAS_IS_WRITE_FLUSH(flags) \\
|
add_define "CAS_IS_WRITE_FLUSH(flags) \\
|
||||||
(CAS_WRITE_FLUSH == ((flags) & CAS_WRITE_FLUSH))"
|
(CAS_WRITE_FLUSH == ((flags) & CAS_WRITE_FLUSH))" ;;
|
||||||
else
|
"4")
|
||||||
add_define "CAS_RQ_IS_FLUSH(rq) \\
|
add_define "CAS_RQ_IS_FLUSH(rq) \\
|
||||||
0"
|
0"
|
||||||
add_define "CAS_IS_WRITE_FLUSH(flags) \\
|
add_define "CAS_IS_WRITE_FLUSH(flags) \\
|
||||||
(WRITE_BARRIER == ((flags) & WRITE_BARRIER))"
|
(WRITE_BARRIER == ((flags) & WRITE_BARRIER))"
|
||||||
add_define "CAS_WRITE_FLUSH \\
|
add_define "CAS_WRITE_FLUSH \\
|
||||||
WRITE_BARRIER"
|
WRITE_BARRIER" ;;
|
||||||
fi
|
*)
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
conf_run $@
|
||||||
|
@ -6,12 +6,10 @@
|
|||||||
|
|
||||||
SCRIPTPATH=`dirname $0`
|
SCRIPTPATH=`dirname $0`
|
||||||
SCRIPTPATH=`realpath $SCRIPTPATH`
|
SCRIPTPATH=`realpath $SCRIPTPATH`
|
||||||
MODULE_FILE=$SCRIPTPATH/test_mod.c
|
|
||||||
OBJ_MOD=$SCRIPTPATH/test_mod.o
|
|
||||||
KERNEL_DIR="${KERNEL_DIR:-/lib/modules/$(uname -r)/build/}"
|
KERNEL_DIR="${KERNEL_DIR:-/lib/modules/$(uname -r)/build/}"
|
||||||
KERNEL_VER="$(cd $KERNEL_DIR; make kernelversion)"
|
KERNEL_VER="$(cd $KERNEL_DIR; make kernelversion)"
|
||||||
NPROC=`nproc`
|
NPROC=`nproc`
|
||||||
DEFINE_FILE=$SCRIPTPATH/../modules/generated_defines.h
|
DEFINE_FILE=$SCRIPTPATH/modules/generated_defines.h
|
||||||
|
|
||||||
|
|
||||||
add_define() {
|
add_define() {
|
||||||
@ -23,33 +21,40 @@ add_function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compile_module(){
|
compile_module(){
|
||||||
if [ $# -gt 1 ]
|
if [ $# -gt 2 ]
|
||||||
then
|
then
|
||||||
INCLUDE="#include <$2>"
|
INCLUDE="#include <$3>"
|
||||||
else
|
else
|
||||||
INCLUDE=""
|
INCLUDE=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
config_file=$1
|
||||||
|
test_module_dir=$SCRIPTPATH/configure.d/${config_file}_dir
|
||||||
|
test_module_file=$test_module_dir/test_mod.c
|
||||||
|
test_module_obj=$test_module_dir/test_mod.o
|
||||||
|
|
||||||
|
mkdir -p $test_module_dir
|
||||||
|
cp -f $SCRIPTPATH/configure.d/Makefile $test_module_dir
|
||||||
|
|
||||||
############# TEST MODULE #############
|
############# TEST MODULE #############
|
||||||
cat > $MODULE_FILE <<- EOF
|
cat > $test_module_file <<- EOF
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
$INCLUDE
|
$INCLUDE
|
||||||
|
|
||||||
int init_module(void) {
|
int init_module(void) {
|
||||||
$1;
|
$2;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
void cleanup_module(void) {};
|
void cleanup_module(void) {};
|
||||||
EOF
|
EOF
|
||||||
#######################################
|
#######################################
|
||||||
|
|
||||||
make -C $SCRIPTPATH KERNEL_DIR=${KERNEL_DIR} &> /dev/null
|
make -C $test_module_dir KERNEL_DIR=${KERNEL_DIR} &> /dev/null
|
||||||
|
|
||||||
local ret=$?
|
local ret=$?
|
||||||
if [ $ret -eq 0 ]; then
|
|
||||||
make -C $SCRIPTPATH clean &> /dev/null
|
rm -Rf $test_module_dir
|
||||||
fi
|
|
||||||
|
|
||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
@ -60,4 +65,14 @@ kernel_not_supp_fail() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# $1 - name of function to be called
|
||||||
|
# $2 - path to file with valid configs
|
||||||
|
# $3 - name of processed template file
|
||||||
|
conf_run() {
|
||||||
|
case "$1" in
|
||||||
|
"check") check $2 $3;;
|
||||||
|
"apply") apply $2 ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
IFS='?'
|
IFS='?'
|
||||||
|
Loading…
Reference in New Issue
Block a user