mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-19 13:46:25 +00:00
scst: Fix block request allocation for kernel v4.18 and later
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7479 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
+10
-2
@@ -7925,9 +7925,13 @@ static struct request *blk_make_request(struct request_queue *q,
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
|
||||
rq = blk_get_request(q, bio_data_dir(bio), gfp_mask);
|
||||
#else
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
|
||||
rq = blk_get_request(q, bio_data_dir(bio) == READ ? REQ_OP_SCSI_IN :
|
||||
REQ_OP_SCSI_OUT, gfp_mask);
|
||||
#else
|
||||
WARN_ON_ONCE(gfp_mask != GFP_KERNEL);
|
||||
rq = blk_get_request(q, bio_data_dir(bio) == READ ? REQ_OP_SCSI_IN :
|
||||
REQ_OP_SCSI_OUT, 0);
|
||||
#endif
|
||||
|
||||
if (IS_ERR(rq))
|
||||
@@ -8169,9 +8173,13 @@ static struct request *blk_map_kern_sg(struct request_queue *q,
|
||||
if (!sgl) {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
|
||||
rq = blk_get_request(q, reading ? READ : WRITE, gfp);
|
||||
#else
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
|
||||
rq = blk_get_request(q, reading ? REQ_OP_SCSI_IN :
|
||||
REQ_OP_SCSI_OUT, gfp);
|
||||
#else
|
||||
WARN_ON_ONCE(gfp != GFP_KERNEL);
|
||||
rq = blk_get_request(q, reading ? REQ_OP_SCSI_IN :
|
||||
REQ_OP_SCSI_OUT, 0);
|
||||
#endif
|
||||
if (unlikely(!rq))
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
Reference in New Issue
Block a user