Commit fbcd2942c8a783d386ca7b71dc8dfb5d1482a7a1

Con Kolivas 2011-07-10T14:02:23

Really correct the staged count logic failure.

diff --git a/main.c b/main.c
index 2a4124c..e2a82c4 100644
--- a/main.c
+++ b/main.c
@@ -762,8 +762,11 @@ static bool workio_submit_work(struct workio_cmd *wc)
 static void inc_staged(int inc, bool lp)
 {
 	pthread_mutex_lock(&stgd_lock);
-	if (lp)
+	if (lp) {
 		lp_staged += inc;
+		total_staged += inc;
+	} else if (lp_staged)
+		lp_staged--;
 	else
 		total_staged += inc;
 	pthread_mutex_unlock(&stgd_lock);
@@ -783,7 +786,7 @@ static int requests_staged(void)
 	int ret;
 
 	pthread_mutex_lock(&stgd_lock);
-	ret = total_staged + lp_staged;
+	ret = total_staged;
 	pthread_mutex_unlock(&stgd_lock);
 	return ret;
 }