From 2dce167153e5203169159eb84c2361af2086eba2 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 5 Jan 2011 13:58:18 +0000 Subject: [PATCH] scst_local: Ported to kernel 2.6.37. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3194 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst_local/scst_local.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index ae65e8c02..8ab90c262 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -920,8 +920,8 @@ static int scst_local_send_resp(struct scsi_cmnd *cmnd, * This does the heavy lifting ... we pass all the commands on to the * target driver and have it do its magic ... */ -static int scst_local_queuecommand(struct scsi_cmnd *SCpnt, - void (*done)(struct scsi_cmnd *)) +static int scst_local_queuecommand_lck(struct scsi_cmnd *SCpnt, + void (*done)(struct scsi_cmnd *)) __acquires(&h->host_lock) __releases(&h->host_lock) { @@ -956,7 +956,7 @@ static int scst_local_queuecommand(struct scsi_cmnd *SCpnt, } tgt_specific->cmnd = SCpnt; tgt_specific->done = done; -#else +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) /* * We save a pointer to the done routine in SCpnt->scsi_done and * we save that as tgt specific stuff below. @@ -1084,6 +1084,10 @@ static int scst_local_queuecommand(struct scsi_cmnd *SCpnt, return 0; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) +static DEF_SCSI_QCMD(scst_local_queuecommand) +#endif + static int scst_local_targ_pre_exec(struct scst_cmd *scst_cmd) { int res = SCST_PREPROCESS_STATUS_SUCCESS; @@ -1385,7 +1389,11 @@ static struct scsi_host_template scst_lcl_ini_driver_template = { .info = scst_local_info, #endif .name = SCST_LOCAL_NAME, +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) + .queuecommand = scst_local_queuecommand_lck, +#else .queuecommand = scst_local_queuecommand, +#endif .eh_abort_handler = scst_local_abort, .eh_device_reset_handler = scst_local_device_reset, #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 25))