You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2014/09/03 19:49:19 UTC

git commit: updated refs/heads/master to 672bb35

Repository: cloudstack
Updated Branches:
  refs/heads/master dc3f0cbc6 -> 672bb353b


CLOUDSTACK-6236:fix a copy-and-paste error for decrRefCnt in
VolumeDataStoreVO.

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/672bb353
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/672bb353
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/672bb353

Branch: refs/heads/master
Commit: 672bb353be2f159966f351ab2de914b433a934f9
Parents: dc3f0cb
Author: Min Chen <mi...@citrix.com>
Authored: Wed Sep 3 10:33:11 2014 -0700
Committer: Min Chen <mi...@citrix.com>
Committed: Wed Sep 3 10:33:11 2014 -0700

----------------------------------------------------------------------
 .../storage/datastore/db/VolumeDataStoreVO.java       | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/672bb353/engine/schema/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java
index aa57e74..91d4ef7 100755
--- a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java
+++ b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java
@@ -350,12 +350,7 @@ public class VolumeDataStoreVO implements StateObject<ObjectInDataStoreStateMach
     }
 
     public void setRefCnt(Long refCnt) {
-        if (refCnt > 0) {
-            refCnt--;
-        }
-        else {
-            s_logger.warn("We should not try to decrement a zero reference count even though our code has guarded");
-        }
+        this.refCnt = refCnt;
     }
 
     public void incrRefCnt() {
@@ -363,7 +358,12 @@ public class VolumeDataStoreVO implements StateObject<ObjectInDataStoreStateMach
     }
 
     public void decrRefCnt() {
-        refCnt--;
+        if (refCnt > 0) {
+            refCnt--;
+        }
+        else {
+            s_logger.warn("We should not try to decrement a zero reference count even though our code has guarded");
+        }
     }
 
     public String getExtractUrl() {