diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-07-29 17:26:39 -0700 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-08-27 08:35:13 -0600 |
commit | 4fcf812ca392303aa79dd50e96e83a29faa13bd0 (patch) | |
tree | 411c33d701989b44ba2f4ecb64fd0cba92214958 /include/scsi | |
parent | 7ca3c803e85080afdff4097e60fefec865027809 (diff) | |
download | linux-4fcf812ca392303aa79dd50e96e83a29faa13bd0.tar.gz linux-4fcf812ca392303aa79dd50e96e83a29faa13bd0.tar.bz2 linux-4fcf812ca392303aa79dd50e96e83a29faa13bd0.zip |
[SCSI] libsas: export sas_alloc_task()
Now that isci has added a 3rd open coded user of this functionality just
share the libsas version.
Acked-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/libsas.h | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index ee866060f8a4..2517254b8403 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -555,36 +555,14 @@ struct sas_task { struct work_struct abort_work; }; -extern struct kmem_cache *sas_task_cache; - #define SAS_TASK_STATE_PENDING 1 #define SAS_TASK_STATE_DONE 2 #define SAS_TASK_STATE_ABORTED 4 #define SAS_TASK_NEED_DEV_RESET 8 #define SAS_TASK_AT_INITIATOR 16 -static inline struct sas_task *sas_alloc_task(gfp_t flags) -{ - struct sas_task *task = kmem_cache_zalloc(sas_task_cache, flags); - - if (task) { - INIT_LIST_HEAD(&task->list); - spin_lock_init(&task->task_state_lock); - task->task_state_flags = SAS_TASK_STATE_PENDING; - init_timer(&task->timer); - init_completion(&task->completion); - } - - return task; -} - -static inline void sas_free_task(struct sas_task *task) -{ - if (task) { - BUG_ON(!list_empty(&task->list)); - kmem_cache_free(sas_task_cache, task); - } -} +extern struct sas_task *sas_alloc_task(gfp_t flags); +extern void sas_free_task(struct sas_task *task); struct sas_domain_function_template { /* The class calls these to notify the LLDD of an event. */ |