mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-18 05:06:31 +00:00
Update to work on 2.6.20 + minor fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@87 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -114,7 +114,7 @@ struct scst_tgt_template tgt_template = {
|
||||
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;
|
||||
|
||||
/*
|
||||
|
||||
@@ -1725,17 +1725,33 @@ out:
|
||||
}
|
||||
|
||||
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 @@ qla2x00_alloc_fcport(scsi_qla_host_t *ha, gfp_t flags)
|
||||
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 @@ qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport)
|
||||
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 @@ qla2x00_update_fcports(scsi_qla_host_t *ha)
|
||||
/* 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
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ char qla2x00_version_str[40];
|
||||
/*
|
||||
* SRB allocation cache
|
||||
*/
|
||||
static kmem_cache_t *srb_cachep;
|
||||
static struct kmem_cache *srb_cachep;
|
||||
|
||||
/*
|
||||
* Ioctl related information.
|
||||
|
||||
+10
-6
@@ -49,18 +49,18 @@ LIST_HEAD(scst_template_list);
|
||||
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 tasklet_struct scst_tasklets[NR_CPUS];
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@@ -1362,6 +1362,8 @@ int scst_alloc_space(struct scst_cmd *cmd)
|
||||
}
|
||||
|
||||
if (cmd->no_sgv) {
|
||||
if (atomic)
|
||||
goto out;
|
||||
cmd->sg = scst_alloc(cmd->bufflen, gfp_mask, use_clustering,
|
||||
&cmd->sg_cnt);
|
||||
} else {
|
||||
|
||||
+3
-3
@@ -316,7 +316,7 @@ out_free:
|
||||
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 @@ static void __sgv_dtor(void *data, int pages)
|
||||
}
|
||||
|
||||
#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(8);
|
||||
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),
|
||||
|
||||
+2
-2
@@ -36,7 +36,7 @@ struct trans_tbl_ent {
|
||||
|
||||
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
|
||||
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];
|
||||
};
|
||||
|
||||
|
||||
+14
-6
@@ -110,24 +110,24 @@ static inline int scst_get_context(void) {
|
||||
}
|
||||
|
||||
#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 struct list_head scst_cmd_list;
|
||||
|
||||
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 @@ int scst_cmd_thread(void *arg);
|
||||
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);
|
||||
|
||||
@@ -495,7 +495,11 @@ out_xmit:
|
||||
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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user