Merge pull request #1085 from hammerg/bio_max_vecs

configure/bio_max_vecs: adapt to kernel 5.12
This commit is contained in:
Robert Baldyga 2022-03-25 22:21:45 +01:00 committed by GitHub
commit 59f2a86db0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,31 @@
#!/bin/bash
#
# Copyright(c) 2022 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
. $(dirname $3)/conf_framework
check() {
cur_name=$(basename $2)
config_file_path=$1
if compile_module $cur_name "int n; n = BIO_MAX_VECS" "linux/bio.h"
then
echo $cur_name 1 >> $config_file_path
else
echo $cur_name 2 >> $config_file_path
fi
}
apply() {
case "$1" in
"1")
;;
"2")
add_define "BIO_MAX_VECS ((uint32_t)(-1))" ;;
*)
exit 1
esac
}
conf_run $@

View File

@ -90,7 +90,7 @@ static inline uint32_t cas_io_iter_size_done(struct bio_vec_iter *iter)
static inline uint32_t cas_io_iter_size_left(struct bio_vec_iter *iter)
{
if (iter->idx < iter->vec_size)
return iter->vec_size - iter->idx;
return min(iter->vec_size - iter->idx, BIO_MAX_VECS);
return 0;
/* TODO UNITTEST */
}