diff --git a/Makefile b/Makefile index dfecb959d..5ad94068c 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ LSI_DIR=mpt all: cd $(SCST_DIR) && $(MAKE) $@ @if [ -d $(QLA_DIR) ]; then cd $(QLA_DIR) && $(MAKE) $@; fi - @if [ -d $(LSI_DIR) ]; then cd $(LSI_DIR) && $(MAKE) $@; fi +# @if [ -d $(LSI_DIR) ]; then cd $(LSI_DIR) && $(MAKE) $@; fi install: cd $(SCST_DIR) && $(MAKE) $@ diff --git a/qla2x00t/qla2x00-target/qla2x00t.c b/qla2x00t/qla2x00-target/qla2x00t.c index 006762de0..67f0def48 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.c +++ b/qla2x00t/qla2x00-target/qla2x00t.c @@ -1348,15 +1348,21 @@ static int q2t_send_cmd_to_scst(scsi_qla_host_t *ha, atio_entry_t *atio) goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) cmd = kmem_cache_alloc(q2t_cmd_cachep, GFP_ATOMIC); +#else + cmd = kmem_cache_zalloc(q2t_cmd_cachep, GFP_ATOMIC); +#endif if (cmd == NULL) { TRACE(TRACE_OUT_OF_MEM, "%s", "Allocation of cmd failed"); res = -ENOMEM; goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) + memset(cmd, 0, sizeof(*cmd)); +#endif TRACE_BUFFER("ATIO Coming Up", atio, sizeof(*atio)); - memset(cmd, 0, sizeof(*cmd)); memcpy(&cmd->atio, atio, sizeof(*atio)); cmd->state = Q2T_STATE_NEW; diff --git a/qla2x00t/qla2x00-target/qla2x00t.h b/qla2x00t/qla2x00-target/qla2x00t.h index 67595fdd4..6d2475b2b 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.h +++ b/qla2x00t/qla2x00-target/qla2x00t.h @@ -30,7 +30,7 @@ /* Version numbers, the same as for the kernel */ #define Q2T_VERSION(a,b,c,d) (((a) << 030) + ((b) << 020) + (c) << 010 + (d)) -#define Q2T_VERSION_CODE Q2T_VERSION(0,9,5,0) +#define Q2T_VERSION_CODE Q2T_VERSION(0,9,6,0) #define Q2T_VERSION_STRING "0.9.6-pre1" #define Q2T_MAX_CDB_LEN 16 diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index d4b2cf5d0..cfda59577 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -196,13 +196,19 @@ struct scst_acg_dev *scst_alloc_acg_dev(struct scst_acg *acg, struct scst_acg_dev *res; TRACE_ENTRY(); - + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) res = kmem_cache_alloc(scst_acgd_cachep, GFP_KERNEL); +#else + res = kmem_cache_zalloc(scst_acgd_cachep, GFP_KERNEL); +#endif if (res == NULL) { TRACE(TRACE_OUT_OF_MEM, "%s", "Allocation of scst_acg_dev failed"); goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) memset(res, 0, sizeof(*res)); +#endif res->dev = dev; res->acg = acg; @@ -321,14 +327,19 @@ static struct scst_tgt_dev *scst_alloc_add_tgt_dev(struct scst_session *sess, TRACE_ENTRY(); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) tgt_dev = kmem_cache_alloc(scst_tgtd_cachep, GFP_KERNEL); - if (tgt_dev != NULL) - memset(tgt_dev, 0, sizeof(*tgt_dev)); - else { +#else + tgt_dev = kmem_cache_zalloc(scst_tgtd_cachep, GFP_KERNEL); +#endif + if (tgt_dev == NULL) { TRACE(TRACE_OUT_OF_MEM, "%s", "Allocation of scst_tgt_dev failed"); goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) + memset(tgt_dev, 0, sizeof(*tgt_dev)); +#endif tgt_dev->acg_dev = acg_dev; tgt_dev->sess = sess; @@ -922,14 +933,19 @@ struct scst_session *scst_alloc_session(struct scst_tgt *tgt, int gfp_mask, TRACE_ENTRY(); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) sess = kmem_cache_alloc(scst_sess_cachep, gfp_mask); - if (sess != NULL) - memset(sess, 0, sizeof(*sess)); - else { +#else + sess = kmem_cache_zalloc(scst_sess_cachep, gfp_mask); +#endif + if (sess == NULL) { TRACE(TRACE_OUT_OF_MEM, "%s", "Allocation of scst_session failed"); goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) + memset(sess, 0, sizeof(*sess)); +#endif sess->init_phase = SCST_SESS_IPH_INITING; atomic_set(&sess->refcnt, 0); @@ -1031,13 +1047,18 @@ struct scst_cmd *scst_alloc_cmd(int gfp_mask) TRACE_ENTRY(); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) cmd = kmem_cache_alloc(scst_cmd_cachep, gfp_mask); - if (cmd != NULL) - memset(cmd, 0, sizeof(*cmd)); - else { +#else + cmd = kmem_cache_zalloc(scst_cmd_cachep, gfp_mask); +#endif + if (cmd == NULL) { TRACE(TRACE_OUT_OF_MEM, "%s", "Allocation of scst_cmd failed"); goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) + memset(cmd, 0, sizeof(*cmd)); +#endif cmd->queue_type = SCST_CMD_QUEUE_UNTAGGED; cmd->timeout = SCST_DEFAULT_TIMEOUT;