configure/bio_max_vecs: adapt to kernel 5.12

The bio_alloc_bioset() function now BUG() if trying to allocate a bio
with more than BIO_MAX_VECS vectors.

A no-limit value (-1) is defined in order not to change old kernels'
behaviour.

Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
This commit is contained in:
Gal Hammer
2022-02-09 17:49:08 +02:00
parent 3a8e3cf37c
commit 4ed8a59402
2 changed files with 32 additions and 1 deletions

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 */
}