From: <vl...@us...> - 2007-02-16 11:11:38
|
Revision: 87 http://svn.sourceforge.net/scst/?rev=87&view=rev Author: vlnb Date: 2007-02-16 03:11:18 -0800 (Fri, 16 Feb 2007) Log Message: ----------- Update to work on 2.6.20 + minor fix Modified Paths: -------------- trunk/qla2x00t/qla2x00-target/qla2x00t.c trunk/qla2x00t/qla_init.c trunk/qla2x00t/qla_os.c trunk/scst/src/scst.c trunk/scst/src/scst_lib.c trunk/scst/src/scst_mem.c trunk/scst/src/scst_mem.h trunk/scst/src/scst_priv.h trunk/scst/src/scst_targ.c Modified: trunk/qla2x00t/qla2x00-target/qla2x00t.c =================================================================== --- trunk/qla2x00t/qla2x00-target/qla2x00t.c 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/qla2x00t/qla2x00-target/qla2x00t.c 2007-02-16 11:11:18 UTC (rev 87) @@ -114,7 +114,7 @@ task_mgmt_fn_done:q2t_task_mgmt_fn_done, }; -kmem_cache_t *q2t_cmd_cachep = NULL; +struct kmem_cache *q2t_cmd_cachep = NULL; static struct qla2x_tgt_target tgt_data; /* Modified: trunk/qla2x00t/qla_init.c =================================================================== --- trunk/qla2x00t/qla_init.c 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/qla2x00t/qla_init.c 2007-02-16 11:11:18 UTC (rev 87) @@ -1725,17 +1725,33 @@ } static void +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) qla2x00_rport_add(void *data) +#else +qla2x00_rport_add(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) fc_port_t *fcport = data; +#else + fc_port_t *fcport = container_of(work, struct fc_port, rport_add_work); +#endif qla2x00_reg_remote_port(fcport->ha, fcport); } static void +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) qla2x00_rport_del(void *data) +#else +qla2x00_rport_del(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) fc_port_t *fcport = data; +#else + fc_port_t *fcport = container_of(work, struct fc_port, rport_del_work); +#endif struct fc_rport *rport; unsigned long flags; @@ -1774,8 +1790,13 @@ fcport->flags = FCF_RLC_SUPPORT; fcport->supported_classes = FC_COS_UNSPECIFIED; spin_lock_init(&fcport->rport_lock); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&fcport->rport_add_work, qla2x00_rport_add, fcport); INIT_WORK(&fcport->rport_del_work, qla2x00_rport_del, fcport); +#else + INIT_WORK(&fcport->rport_add_work, qla2x00_rport_add); + INIT_WORK(&fcport->rport_del_work, qla2x00_rport_del); +#endif return (fcport); } @@ -2116,7 +2137,11 @@ unsigned long flags; if (fcport->drport) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) qla2x00_rport_del(fcport); +#else + qla2x00_rport_del(&fcport->rport_del_work); +#endif if (fcport->rport) return; @@ -3031,7 +3056,11 @@ /* Go with deferred removal of rport references. */ list_for_each_entry(fcport, &ha->fcports, list) if (fcport->drport) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) qla2x00_rport_del(fcport); +#else + qla2x00_rport_del(&fcport->rport_del_work); +#endif } /* Modified: trunk/qla2x00t/qla_os.c =================================================================== --- trunk/qla2x00t/qla_os.c 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/qla2x00t/qla_os.c 2007-02-16 11:11:18 UTC (rev 87) @@ -29,7 +29,7 @@ /* * SRB allocation cache */ -static kmem_cache_t *srb_cachep; +static struct kmem_cache *srb_cachep; /* * Ioctl related information. Modified: trunk/scst/src/scst.c =================================================================== --- trunk/scst/src/scst.c 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/scst/src/scst.c 2007-02-16 11:11:18 UTC (rev 87) @@ -49,18 +49,18 @@ LIST_HEAD(scst_dev_list); LIST_HEAD(scst_dev_type_list); -kmem_cache_t *scst_mgmt_cachep; +struct kmem_cache *scst_mgmt_cachep; mempool_t *scst_mgmt_mempool; -kmem_cache_t *scst_ua_cachep; +struct kmem_cache *scst_ua_cachep; mempool_t *scst_ua_mempool; -kmem_cache_t *scst_tgtd_cachep; -kmem_cache_t *scst_sess_cachep; -kmem_cache_t *scst_acgd_cachep; +struct kmem_cache *scst_tgtd_cachep; +struct kmem_cache *scst_sess_cachep; +struct kmem_cache *scst_acgd_cachep; LIST_HEAD(scst_acg_list); struct scst_acg *scst_default_acg; -kmem_cache_t *scst_cmd_cachep; +struct kmem_cache *scst_cmd_cachep; unsigned long scst_flags; atomic_t scst_cmd_count = ATOMIC_INIT(0); @@ -77,7 +77,11 @@ struct scst_sgv_pools scst_sgv; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) DECLARE_WORK(scst_cmd_mem_work, scst_cmd_mem_work_fn, 0); +#else +DECLARE_DELAYED_WORK(scst_cmd_mem_work, scst_cmd_mem_work_fn); +#endif unsigned long scst_max_cmd_mem; Modified: trunk/scst/src/scst_lib.c =================================================================== --- trunk/scst/src/scst_lib.c 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/scst/src/scst_lib.c 2007-02-16 11:11:18 UTC (rev 87) @@ -1362,6 +1362,8 @@ } if (cmd->no_sgv) { + if (atomic) + goto out; cmd->sg = scst_alloc(cmd->bufflen, gfp_mask, use_clustering, &cmd->sg_cnt); } else { Modified: trunk/scst/src/scst_mem.c =================================================================== --- trunk/scst/src/scst_mem.c 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/scst/src/scst_mem.c 2007-02-16 11:11:18 UTC (rev 87) @@ -316,7 +316,7 @@ goto out; } -static void sgv_ctor(void *data, kmem_cache_t *c, unsigned long flags) +static void sgv_ctor(void *data, struct kmem_cache *c, unsigned long flags) { struct sgv_pool_obj *obj = data; @@ -339,7 +339,7 @@ } #define SGV_DTOR_NAME(order) sgv_dtor##order -#define SGV_DTOR(order) static void sgv_dtor##order(void *d, kmem_cache_t *k, \ +#define SGV_DTOR(order) static void sgv_dtor##order(void *d, struct kmem_cache *k, \ unsigned long f) { __sgv_dtor(d, 1 << order); } SGV_DTOR(0); @@ -354,7 +354,7 @@ SGV_DTOR(9); SGV_DTOR(10); -typedef void (*dtor_t)(void *, kmem_cache_t *, unsigned long); +typedef void (*dtor_t)(void *, struct kmem_cache *, unsigned long); dtor_t cache_dtors[SGV_POOL_ELEMENTS] = { SGV_DTOR_NAME(0), SGV_DTOR_NAME(1), SGV_DTOR_NAME(2), SGV_DTOR_NAME(3), Modified: trunk/scst/src/scst_mem.h =================================================================== --- trunk/scst/src/scst_mem.h 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/scst/src/scst_mem.h 2007-02-16 11:11:18 UTC (rev 87) @@ -36,7 +36,7 @@ struct sgv_pool_obj { - kmem_cache_t *owner_cache; + struct kmem_cache *owner_cache; int eorder; int orig_sg; int orig_length; @@ -56,7 +56,7 @@ struct sgv_pool_acc cache_acc[SGV_POOL_ELEMENTS]; unsigned int clustered:1; /* 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048 */ - kmem_cache_t *caches[SGV_POOL_ELEMENTS]; + struct kmem_cache *caches[SGV_POOL_ELEMENTS]; char cache_names[SGV_POOL_ELEMENTS][25]; }; Modified: trunk/scst/src/scst_priv.h =================================================================== --- trunk/scst/src/scst_priv.h 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/scst/src/scst_priv.h 2007-02-16 11:11:18 UTC (rev 87) @@ -110,24 +110,24 @@ } #define SCST_MGMT_CMD_CACHE_STRING "scst_mgmt_cmd" -extern kmem_cache_t *scst_mgmt_cachep; +extern struct kmem_cache *scst_mgmt_cachep; extern mempool_t *scst_mgmt_mempool; #define SCST_UA_CACHE_STRING "scst_ua" -extern kmem_cache_t *scst_ua_cachep; +extern struct kmem_cache *scst_ua_cachep; extern mempool_t *scst_ua_mempool; #define SCST_CMD_CACHE_STRING "scst_cmd" -extern kmem_cache_t *scst_cmd_cachep; +extern struct kmem_cache *scst_cmd_cachep; #define SCST_SESSION_CACHE_STRING "scst_session" -extern kmem_cache_t *scst_sess_cachep; +extern struct kmem_cache *scst_sess_cachep; #define SCST_TGT_DEV_CACHE_STRING "scst_tgt_dev" -extern kmem_cache_t *scst_tgtd_cachep; +extern struct kmem_cache *scst_tgtd_cachep; #define SCST_ACG_DEV_CACHE_STRING "scst_acg_dev" -extern kmem_cache_t *scst_acgd_cachep; +extern struct kmem_cache *scst_acgd_cachep; extern struct scst_sgv_pools scst_sgv; @@ -151,7 +151,11 @@ extern spinlock_t scst_cmd_mem_lock; extern unsigned long scst_max_cmd_mem, scst_cur_max_cmd_mem, scst_cur_cmd_mem; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) extern struct work_struct scst_cmd_mem_work; +#else +extern struct delayed_work scst_cmd_mem_work; +#endif /* The following lists protected by scst_list_lock as well */ extern struct list_head scst_mgmt_cmd_list; @@ -225,7 +229,11 @@ void scst_cmd_tasklet(long p); int scst_mgmt_cmd_thread(void *arg); int scst_mgmt_thread(void *arg); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) void scst_cmd_mem_work_fn(void *p); +#else +void scst_cmd_mem_work_fn(struct work_struct *work); +#endif struct scst_device *scst_alloc_device(int gfp_mask); void scst_free_device(struct scst_device *tgt_dev); Modified: trunk/scst/src/scst_targ.c =================================================================== --- trunk/scst/src/scst_targ.c 2007-02-02 12:26:50 UTC (rev 86) +++ trunk/scst/src/scst_targ.c 2007-02-16 11:11:18 UTC (rev 87) @@ -495,7 +495,11 @@ goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) void scst_cmd_mem_work_fn(void *p) +#else +void scst_cmd_mem_work_fn(struct work_struct *work) +#endif { TRACE_ENTRY(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |