|
From: <vl...@us...> - 2009-11-19 11:58:05
|
Revision: 1350
http://scst.svn.sourceforge.net/scst/?rev=1350&view=rev
Author: vlnb
Date: 2009-11-19 11:57:57 +0000 (Thu, 19 Nov 2009)
Log Message:
-----------
Ordered reads groupped under single config symbol.
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2009-11-19 10:22:25 UTC (rev 1349)
+++ trunk/scst/src/scst_targ.c 2009-11-19 11:57:57 UTC (rev 1350)
@@ -33,6 +33,11 @@
#include "scst.h"
#include "scst_priv.h"
+#if 0 /* Temporary, left for future performance investigations */
+/* Deleting it don't forget to delete write_cmd_count */
+#define CONFIG_SCST_ORDERED_READS
+#endif
+
static void scst_cmd_set_sn(struct scst_cmd *cmd);
static int __scst_init_cmd(struct scst_cmd *cmd);
static void scst_finish_cmd_mgmt(struct scst_cmd *cmd);
@@ -2855,10 +2860,11 @@
if (likely(cmd->tgt_dev != NULL)) {
atomic_dec(&cmd->tgt_dev->tgt_dev_cmd_count);
atomic_dec(&cmd->dev->dev_cmd_count);
+#ifdef CONFIG_SCST_ORDERED_READS
/* If expected values not set, expected direction is UNKNOWN */
if (cmd->expected_data_direction & SCST_DATA_WRITE)
atomic_dec(&cmd->dev->write_cmd_count);
-
+#endif
if (unlikely(cmd->queue_type == SCST_CMD_QUEUE_HEAD_OF_QUEUE))
scst_on_hq_cmd_response(cmd);
@@ -3136,7 +3142,7 @@
switch (cmd->queue_type) {
case SCST_CMD_QUEUE_SIMPLE:
case SCST_CMD_QUEUE_UNTAGGED:
-#if 0 /* left for future performance investigations */
+#ifdef CONFIG_SCST_ORDERED_READS
if (scst_cmd_is_expected_set(cmd)) {
if ((cmd->expected_data_direction == SCST_DATA_READ) &&
(atomic_read(&cmd->dev->write_cmd_count) == 0))
@@ -3332,9 +3338,11 @@
}
}
+#ifdef CONFIG_SCST_ORDERED_READS
/* If expected values not set, expected direction is UNKNOWN */
if (cmd->expected_data_direction & SCST_DATA_WRITE)
atomic_inc(&cmd->dev->write_cmd_count);
+#endif
if (unlikely(failure))
goto out_busy;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|