From: Gleb C. <lna...@ya...> - 2024-09-04 09:54:57
|
Commit: 8c6a968 GitHub URL: https://github.com/SCST-project/scst/commit/8c6a9680830e642958eb93add863db5913cc359b Author: Gleb Chesnokov Date: 2024-09-04T12:54:26+03:00 Log Message: ----------- scst_lib: Port to Linux kernel v6.11 Support for the following block layer changes in the Linux kernel v6.11: - e94b45d08b5d ("block: move dma_pad_mask into queue_limits") Modified Paths: -------------- scst/src/scst_lib.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) =================================================================== diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index c9d60c7..551afba 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -8431,6 +8431,16 @@ static struct request *blk_make_request(struct request_queue *q, } #endif +static inline unsigned int +queue_dma_pad_mask(const struct request_queue *q) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0) + return q->dma_pad_mask; +#else + return q->limits.dma_pad_mask; +#endif +} + /* __blk_map_kern_sg - map kernel data to a request for REQ_TYPE_BLOCK_PC */ static struct request *__blk_map_kern_sg(struct request_queue *q, struct scatterlist *sgl, int nents, struct blk_kern_sg_work *bw, @@ -8553,7 +8563,7 @@ static struct request *__blk_map_kern_sg(struct request_queue *q, } /* Total length must satisfy DMA padding alignment */ - if ((tot_len & q->dma_pad_mask) && bw != NULL) { + if (bw && (tot_len & queue_dma_pad_mask(q))) { rq = ERR_PTR(-EINVAL); goto out_free_bios; } |