From b2416e0f490370aa6ba4383a9116216b7e0f4a30 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 10 Jul 2018 04:13:57 +0000 Subject: [PATCH] scst_local: Port to kernel v4.17 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7409 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 10 ++++++++++ scst_local/scst_local.c | 4 +--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index 2f65a9061..dc14ab255 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -90,6 +90,16 @@ static inline unsigned int queue_max_hw_sectors(struct request_queue *q) } #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) +static inline void blk_queue_flag_set(unsigned int flag, + struct request_queue *q) +{ +#if !defined(RHEL_MAJOR) || RHEL_MAJOR -0 >= 6 + queue_flag_set_unlocked(flag, q); +#endif +} +#endif + /* */ #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 932ff9f2b..eef75fa97 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1230,9 +1230,7 @@ static int scst_local_change_queue_depth(struct scsi_device *sdev, int qdepth) static int scst_local_slave_alloc(struct scsi_device *sdev) { -#if !defined(RHEL_MAJOR) || RHEL_MAJOR -0 >= 6 - queue_flag_set_unlocked(QUEUE_FLAG_BIDI, sdev->request_queue); -#endif + blk_queue_flag_set(QUEUE_FLAG_BIDI, sdev->request_queue); return 0; }