Minor fixes and cleanups from Ming Zhang:

- Fixed scst_cur_cmd_mem leak for real devices
 - Since scst_unregister_target_template() returnes void it should use down() instead of down_interruptible()
 - Cleanups


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@73 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2007-01-08 17:56:35 +00:00
parent b09e1e7d46
commit a0ef0b8fb2
5 changed files with 6 additions and 13 deletions
+1 -5
View File
@@ -197,14 +197,11 @@ void scst_unregister_target_template(struct scst_tgt_template *vtt)
TRACE_ENTRY();
if (down_interruptible(&scst_mutex) != 0)
goto out;
restart:
down(&scst_mutex);
list_for_each_entry(tgt, &vtt->tgt_list, tgt_list_entry) {
up(&scst_mutex);
scst_unregister(tgt);
down(&scst_mutex);
goto restart;
}
list_del(&vtt->scst_template_list_entry);
@@ -212,7 +209,6 @@ restart:
scst_cleanup_proc_target_dir_entries(vtt);
out:
TRACE_EXIT();
return;
}
+2 -4
View File
@@ -1363,14 +1363,12 @@ int scst_alloc_space(struct scst_cmd *cmd)
if (cmd->no_sgv) {
cmd->sg = scst_alloc(cmd->bufflen, gfp_mask, use_clustering,
&cmd->sg_cnt);
if (cmd->sg == NULL)
goto out;
} else {
cmd->sg = sgv_pool_alloc(pool, cmd->bufflen, gfp_mask,
&cmd->sg_cnt, &cmd->sgv);
if (cmd->sg == NULL)
goto out;
}
if (cmd->sg == NULL)
goto out;
if (unlikely(cmd->sg_cnt > ini_sg)) {
static int ll;
+1 -2
View File
@@ -211,10 +211,9 @@ static inline int __scst_inc_expected_sn(struct scst_tgt_dev *tgt_dev)
typeof(tgt_dev->expected_sn) e;
e = tgt_dev->expected_sn;
tgt_dev->expected_sn++;
e = tgt_dev->expected_sn;
smp_mb(); /* write must be before def_cmd_count read */
e++;
TRACE(TRACE_DEBUG/*TRACE_SCSI_SERIALIZING*/, "Next expected_sn: %d", e);
return e;
}
+2
View File
@@ -474,6 +474,7 @@ static void scst_proc_del_acg_tree(struct proc_dir_entry *acg_proc_root,
return;
}
/* scst_mutex supposed to be held */
static int scst_proc_group_add(const char *p)
{
int res = 0, len = strlen(p) + 1;
@@ -514,6 +515,7 @@ out_nomem:
goto out;
}
/* scst_mutex supposed to be held */
static int scst_proc_del_free_acg(struct scst_acg *acg, int remove_proc)
{
const char *name;
-2
View File
@@ -1250,8 +1250,6 @@ static void scst_cmd_done(struct scsi_cmnd *scsi_cmd)
req->sr_underflow = 0;
req->sr_request->rq_disk = NULL; /* disown request blk */
cmd->bufflen = req->sr_bufflen; //??
scst_release_request(cmd);
cmd->state = next_state;