From: <vl...@us...> - 2007-01-08 17:56:41
|
Revision: 73 http://svn.sourceforge.net/scst/?rev=73&view=rev Author: vlnb Date: 2007-01-08 09:56:35 -0800 (Mon, 08 Jan 2007) Log Message: ----------- 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 Modified Paths: -------------- trunk/scst/src/scst.c trunk/scst/src/scst_lib.c trunk/scst/src/scst_priv.h trunk/scst/src/scst_proc.c trunk/scst/src/scst_targ.c Modified: trunk/scst/src/scst.c =================================================================== --- trunk/scst/src/scst.c 2007-01-08 14:05:24 UTC (rev 72) +++ trunk/scst/src/scst.c 2007-01-08 17:56:35 UTC (rev 73) @@ -197,14 +197,11 @@ 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 @@ scst_cleanup_proc_target_dir_entries(vtt); -out: TRACE_EXIT(); return; } Modified: trunk/scst/src/scst_lib.c =================================================================== --- trunk/scst/src/scst_lib.c 2007-01-08 14:05:24 UTC (rev 72) +++ trunk/scst/src/scst_lib.c 2007-01-08 17:56:35 UTC (rev 73) @@ -1363,14 +1363,12 @@ 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; Modified: trunk/scst/src/scst_priv.h =================================================================== --- trunk/scst/src/scst_priv.h 2007-01-08 14:05:24 UTC (rev 72) +++ trunk/scst/src/scst_priv.h 2007-01-08 17:56:35 UTC (rev 73) @@ -211,10 +211,9 @@ 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; } Modified: trunk/scst/src/scst_proc.c =================================================================== --- trunk/scst/src/scst_proc.c 2007-01-08 14:05:24 UTC (rev 72) +++ trunk/scst/src/scst_proc.c 2007-01-08 17:56:35 UTC (rev 73) @@ -474,6 +474,7 @@ 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 @@ 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; Modified: trunk/scst/src/scst_targ.c =================================================================== --- trunk/scst/src/scst_targ.c 2007-01-08 14:05:24 UTC (rev 72) +++ trunk/scst/src/scst_targ.c 2007-01-08 17:56:35 UTC (rev 73) @@ -1250,8 +1250,6 @@ 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; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |