|
From: Gleb C. <lna...@ya...> - 2025-10-30 08:02:39
|
Commit: 6c73cc8 GitHub URL: https://github.com/SCST-project/scst/commit/6c73cc8d2ffb412c0c4173c39a2064510b1c9f24 Author: Ameer Hamza Date: 2025-10-30T11:02:08+03:00 Log Message: ----------- scst_lib: Port to Linux kernel v6.18 Support for the following block layer and memory management changes in the Linux kernel v6.18: - d86eaa0f3c56 ("block: remove the bi_inline_vecs variable sized array from struct bio") - 84efbefa26df ("mm: remove nth_page()") Modified Paths: -------------- scst/src/scst_lib.c | 17 ++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) =================================================================== diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 6b48030..d3fdd2d 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -8369,12 +8369,19 @@ scst_alloc_bio(unsigned short nr_vecs, gfp_t gfp_mask) /* * See also commit 066ff571011d ("block: turn bio_kmalloc into a * simple kmalloc wrapper"). + * See also commit d86eaa0f3c56 ("block: remove the bi_inline_vecs + * variable sized array from struct bio") # v6.18. */ struct bio *bio; bio = bio_kmalloc(nr_vecs, gfp_mask); - if (bio) + if (bio) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 18, 0) bio_init(bio, NULL, bio->bi_inline_vecs, nr_vecs, 0); +#else + bio_init(bio, NULL, bio_inline_vecs(bio), nr_vecs, 0); +#endif + } return bio; #endif @@ -8575,7 +8582,15 @@ static struct request *__blk_map_kern_sg(struct request_queue *q, need_new_bio = false; offset = 0; len -= bytes; +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 18, 0) page = nth_page(page, 1); +#else + /* + * See also commit 84efbefa26df ("mm: remove nth_page()") # v6.18. + * Use simple pointer arithmetic for contiguous pages. + */ + page = page + 1; +#endif } } } |