diff --git a/configure b/configure index 5e7f6ce..13aa0b4 100755 --- a/configure +++ b/configure @@ -64,8 +64,6 @@ generate_header() { 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" diff --git a/configure.d/1_bio_err.conf b/configure.d/1_bio_err.conf index da764cf..4ee02ff 100644 --- a/configure.d/1_bio_err.conf +++ b/configure.d/1_bio_err.conf @@ -15,7 +15,12 @@ check() { elif compile_module $cur_name "struct bio b;b.bi_error" "linux/bio.h" then echo $cur_name "2" >> $config_file_path - fi + elif compile_module $cur_name "bio_endio(NULL, 0)" "linux/bio.h" + then + echo $cur_name "3" >> $config_file_path + else + echo $cur_name "X" >> $config_file_path + fi } apply() { @@ -26,6 +31,10 @@ apply() { "2") add_define "CAS_BIO_OP_STATUS(bio) \\ bio->bi_error" ;; + "3") + # If bio_endio is available, we do not need to provide our own status accessors. + # This case-switch prevents false errors during executing 'configure' script. + return 0 ;; *) exit 1 esac diff --git a/configure.d/1_wtlh.conf b/configure.d/1_wtlh.conf index 1589d34..6db7d17 100644 --- a/configure.d/1_wtlh.conf +++ b/configure.d/1_wtlh.conf @@ -12,6 +12,8 @@ check() { if compile_module $cur_name "struct bio b;b.bi_write_hint" "linux/bio.h" then echo $cur_name "1" >> $config_file_path + else + echo $cur_name "2" >> $config_file_path fi } @@ -20,6 +22,8 @@ apply() { "1") add_define "CAS_WLTH_SUPPORT \\ 1" ;; + "2") + return 0 ;; *) exit 1 esac diff --git a/configure.d/2_bio_barrier.conf b/configure.d/2_bio_barrier.conf index cfa1921..11233ef 100644 --- a/configure.d/2_bio_barrier.conf +++ b/configure.d/2_bio_barrier.conf @@ -31,7 +31,7 @@ apply() { "2") add_define "CAS_CHECK_BARRIER(bio) \\ ((CAS_BIO_OP_FLAGS(bio) & REQ_SOFTBARRIER) != 0)" ;; - "3") + "3") add_define "CAS_CHECK_BARRIER(bio) \\ (bio_rw_flagged((bio), BIO_RW_BARRIER))" ;; *) diff --git a/configure.d/1_bio_cmpl.conf b/configure.d/2_bio_cmpl.conf similarity index 100% rename from configure.d/1_bio_cmpl.conf rename to configure.d/2_bio_cmpl.conf diff --git a/configure.d/2_flush_fua.conf b/configure.d/2_flush_fua.conf index 3ee5bd7..9a1fbd5 100644 --- a/configure.d/2_flush_fua.conf +++ b/configure.d/2_flush_fua.conf @@ -22,17 +22,17 @@ check() { echo $cur_name "3" >> $config_file_path else echo $cur_name "4" >> $config_file_path - fi + fi } apply() { case "$1" in - "1") + "1") add_define "CAS_WRITE_FLUSH_FUA \\ WRITE_FLUSH_FUA" add_define "CAS_IS_WRITE_FLUSH_FUA(flags) \\ ((BIO_FUA | BIO_FLUSH) == ((flags) & (BIO_FUA | BIO_FLUSH)))" ;; - "2") + "2") add_define "CAS_WRITE_FLUSH_FUA \\ WRITE_FLUSH_FUA" add_define "CAS_IS_WRITE_FLUSH_FUA(flags) \\ diff --git a/configure.d/conf_framework b/configure.d/conf_framework index 333975a..c679f20 100644 --- a/configure.d/conf_framework +++ b/configure.d/conf_framework @@ -73,10 +73,14 @@ kernel_not_supp_fail() { # $2 - path to file with valid configs # $3 - name of processed template file conf_run() { + local OLD_IFS=$IFS + IFS='?' + case "$1" in "check") check $2 $3;; "apply") apply $2 ;; esac + + IFS=$OLD_IFS } -IFS='?'