From: <vl...@us...> - 2006-10-12 14:25:16
|
Revision: 4 http://svn.sourceforge.net/scst/?rev=4&view=rev Author: vlnb Date: 2006-10-12 07:25:08 -0700 (Thu, 12 Oct 2006) Log Message: ----------- - Fixed dev->on_dev_count underleak - Minor fixes and cosmetics Modified Paths: -------------- trunk/scst/src/scst_priv.h trunk/scst/src/scst_targ.c Modified: trunk/scst/src/scst_priv.h =================================================================== --- trunk/scst/src/scst_priv.h 2006-10-12 14:18:50 UTC (rev 3) +++ trunk/scst/src/scst_priv.h 2006-10-12 14:25:08 UTC (rev 4) @@ -346,7 +346,8 @@ __scst_block_dev(dev); spin_unlock_bh(&dev->dev_lock); - TRACE_MGMT_DBG("%s", "Waiting during blocking"); + TRACE_MGMT_DBG("Waiting during blocking outstanding %d (on_dev_count " + "%d)", outstanding, atomic_read(&dev->on_dev_count)); wait_event(dev->on_dev_waitQ, atomic_read(&dev->on_dev_count) <= outstanding); TRACE_MGMT_DBG("%s", "wait_event() returned"); Modified: trunk/scst/src/scst_targ.c =================================================================== --- trunk/scst/src/scst_targ.c 2006-10-12 14:18:50 UTC (rev 3) +++ trunk/scst/src/scst_targ.c 2006-10-12 14:25:08 UTC (rev 4) @@ -1580,7 +1580,7 @@ } count = 0; - do { + while(1) { rc = scst_do_send_to_midlev(cmd); if (rc == SCST_EXEC_NEED_THREAD) { TRACE_DBG("%s", "scst_do_send_to_midlev() requested " @@ -1597,8 +1597,11 @@ count++; expected_sn = __scst_inc_expected_sn(tgt_dev); cmd = scst_check_deferred_commands(tgt_dev, expected_sn); + if (cmd == NULL) + break; + if (unlikely(scst_inc_on_dev_cmd(cmd) != 0)) + break; } - while(cmd != NULL); out_unplug: if (dev->scsi_dev != NULL) @@ -1742,9 +1745,6 @@ TRACE_ENTRY(); - if (unlikely(cmd->sg == NULL)) - goto out; - if (cmd->cdb[0] == REQUEST_SENSE) { if (cmd->internal) cmd = scst_complete_request_sense(cmd); @@ -1775,15 +1775,12 @@ uint8_t *address; length = scst_get_buf_first(cmd, &address); - if (unlikely(length <= 0)) { + if (length <= 0) goto out; - } - if (length > 2 && cmd->cdb[0] == MODE_SENSE) { + if (length > 2 && cmd->cdb[0] == MODE_SENSE) address[2] |= 0x80; /* Write Protect*/ - } - else if (length > 3 && cmd->cdb[0] == MODE_SENSE_10) { + else if (length > 3 && cmd->cdb[0] == MODE_SENSE_10) address[3] |= 0x80; /* Write Protect*/ - } scst_put_buf(cmd, address); } @@ -1800,7 +1797,7 @@ /* ToDo: all pages ?? */ buflen = scst_get_buf_first(cmd, &buffer); - if (likely(buflen > 0)) { + if (buflen > 0) { if (buflen > SCST_INQ_BYTE3) { #ifdef EXTRACHECKS if (buffer[SCST_INQ_BYTE3] & SCST_INQ_NORMACA_BIT) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |