diff --git a/configure.d/1_bio_max_vecs.conf b/configure.d/1_bio_max_vecs.conf index 08de2c9..369f83d 100644 --- a/configure.d/1_bio_max_vecs.conf +++ b/configure.d/1_bio_max_vecs.conf @@ -20,9 +20,9 @@ check() { apply() { case "$1" in "1") - ;; + add_define "CAS_BIO_MAX_VECS ((uint32_t)BIO_MAX_VECS)" ;; "2") - add_define "BIO_MAX_VECS ((uint32_t)(-1))" ;; + add_define "CAS_BIO_MAX_VECS ((uint32_t)BIO_MAX_PAGES)" ;; *) exit 1 esac diff --git a/modules/cas_cache/volume/vol_blk_utils.h b/modules/cas_cache/volume/vol_blk_utils.h index 34a3e15..ddbad01 100644 --- a/modules/cas_cache/volume/vol_blk_utils.h +++ b/modules/cas_cache/volume/vol_blk_utils.h @@ -1,5 +1,5 @@ /* -* Copyright(c) 2012-2021 Intel Corporation +* Copyright(c) 2012-2022 Intel Corporation * SPDX-License-Identifier: BSD-3-Clause */ @@ -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 min(iter->vec_size - iter->idx, BIO_MAX_VECS); + return min(iter->vec_size - iter->idx, CAS_BIO_MAX_VECS); return 0; /* TODO UNITTEST */ }