From 29993da5b03996e5c1272b677dc7e47da9ddbe7f Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 19 Mar 2013 00:43:51 +0000 Subject: [PATCH] REQ_META build fix for kernels 2.6.36..3.0 The SCST trunk currently doesn't build against any of the kernels in the range 2.6.36..3.0. The patch below fixes that. Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4805 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 5c4616f12..269fd80a9 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -3854,10 +3854,22 @@ static void blockio_exec_rw(struct vdisk_cmd_params *p, bool write, bool fua) bio->bi_rw |= REQ_FUA; if (cmd->queue_type == SCST_CMD_QUEUE_HEAD_OF_QUEUE) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) || \ + defined(RHEL_MAJOR) && RHEL_MAJOR -0 >= 6 bio->bi_rw |= REQ_META; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) + /* + * Priority boosting was separated + * from REQ_META in commit 65299a3b + * (kernel 3.1.0). + */ bio->bi_rw |= REQ_PRIO; -#else +#endif +#elif !defined(RHEL_MAJOR) || RHEL_MAJOR -0 >= 6 + /* + * BIO_* and REQ_* flags were unified + * in commit 7b6d91da (kernel 2.6.36). + */ bio->bi_rw |= BIO_RW_META; #endif }