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:
@@ -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 */
|
||||
}
|
||||
|
Reference in New Issue
Block a user