scst: Backport scst_blk_rq_cpu() to kernel versions before v2.6.28 (merge r7877 from trunk)

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.3.x@7889 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-01-13 21:30:17 +00:00
parent 2b477bd719
commit 3838f3912a

View File

@@ -123,7 +123,13 @@ static inline unsigned int queue_max_hw_sectors(struct request_queue *q)
static inline unsigned int scst_blk_rq_cpu(struct request *rq)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28)
/*
* See also commit c7c22e4d5c1f ("block: add support for IO CPU
* affinity") # v2.6.28.
*/
return 0;
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0)
return rq->cpu;
#else
return blk_mq_rq_cpu(rq);