From 572869d64a72e9cbf27f5e6ba332e9b1e4ef85b0 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 26 Mar 2015 00:06:51 +0000 Subject: [PATCH] scst_local: Kernel 3.19 build fix Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6155 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst_local/scst_local.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 71ef89be3..92a971326 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1018,6 +1018,12 @@ static int scst_local_queuecommand_lck(struct scsi_cmnd *SCpnt, } scst_cmd_set_tag(scst_cmd, SCpnt->tag); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) + if (SCpnt->device->tagged_supported && SCpnt->device->simple_tags) + scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_SIMPLE); + else + scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_UNTAGGED); +#else switch (scsi_get_tag_type(SCpnt->device)) { case MSG_SIMPLE_TAG: scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_SIMPLE); @@ -1033,6 +1039,7 @@ static int scst_local_queuecommand_lck(struct scsi_cmnd *SCpnt, scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_UNTAGGED); break; } +#endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)) /* @@ -1162,7 +1169,14 @@ static int scst_local_get_max_queue_depth(struct scsi_device *sdev) return res; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33) || \ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) + +static int scst_local_change_queue_depth(struct scsi_device *sdev, int depth) +{ + return scsi_change_queue_depth(sdev, depth); +} + +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33) || \ defined(CONFIG_SUSE_KERNEL) || \ !(!defined(RHEL_RELEASE_CODE) || \ RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(6, 1)) @@ -1242,10 +1256,12 @@ static int scst_local_slave_configure(struct scsi_device *sdev) PRINT_INFO("Configuring queue depth %d on sdev %p (tagged supported %d)", mqd, sdev, sdev->tagged_supported); +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) if (sdev->tagged_supported) scsi_activate_tcq(sdev, mqd); else scsi_deactivate_tcq(sdev, mqd); +#endif TRACE_EXIT(); return 0; @@ -1612,6 +1628,9 @@ static struct scsi_host_template scst_lcl_ini_driver_template = { #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 25)) .eh_target_reset_handler = scst_local_target_reset, #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) + .use_blk_tags = true, +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33) || \ defined(CONFIG_SUSE_KERNEL) || \ !(!defined(RHEL_RELEASE_CODE) || \