scst_lib: Port to Linux kernel v6.14

Support for the following block layer changes in the Linux kernel v6.14:

- 6aeb4f836480 ("block: remove bio_add_pc_page")
This commit is contained in:
Gleb Chesnokov
2025-03-25 16:53:57 +03:00
parent 191a74d127
commit 1f40850809
+8 -4
View File
@@ -8554,16 +8554,20 @@ static struct request *__blk_map_kern_sg(struct request_queue *q,
TRACE_DBG("len %zd, bytes %zd, offset %zd", len, bytes, offset);
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0)
rc = bio_add_pc_page(q, bio, page, bytes, offset);
#else
rc = bio_add_page(bio, page, bytes, offset);
#endif
if (rc < bytes) {
if (unlikely(need_new_bio || rc < 0)) {
rq = ERR_PTR(rc < 0 ? rc : -EIO);
goto out_free_bios;
} else {
need_new_bio = true;
len -= rc;
offset += rc;
}
need_new_bio = true;
offset += rc;
len -= rc;
} else {
need_new_bio = false;
offset = 0;