You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2012/03/20 03:33:01 UTC

[2/4] git commit: interm

interm


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/9310f113
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/9310f113
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/9310f113

Branch: refs/heads/3.0.x
Commit: 9310f113af338143d71e03f02dcd9ef948116fdb
Parents: d91e29c
Author: John Plevyak <jp...@acm.org>
Authored: Sun Mar 18 20:20:15 2012 -0700
Committer: John Plevyak <jp...@acm.org>
Committed: Sun Mar 18 20:20:15 2012 -0700

----------------------------------------------------------------------
 iocore/cache/CacheWrite.cc |   47 ++++++++++++++++++--------------------
 1 files changed, 22 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9310f113/iocore/cache/CacheWrite.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/CacheWrite.cc b/iocore/cache/CacheWrite.cc
index f87dea7..42e7396 100644
--- a/iocore/cache/CacheWrite.cc
+++ b/iocore/cache/CacheWrite.cc
@@ -1543,36 +1543,33 @@ CacheVC::openWriteStartDone(int event, Event *e)
       first_buf = buf;
       goto Lsuccess;
     }
-  }
 
 Lcollision:
-  {
-    int if_writers = ((uintptr_t) info == CACHE_ALLOW_MULTIPLE_WRITES);
-    CACHE_TRY_LOCK(lock, vol->mutex, mutex->thread_holding);
-    if (!lock)
-      VC_LOCK_RETRY_EVENT();
-    if (!od) {
-      if ((err = vol->open_write(
-             this, if_writers, cache_config_http_max_alts > 1 ? cache_config_http_max_alts : 0)) > 0)
+    {
+      int if_writers = ((uintptr_t) info == CACHE_ALLOW_MULTIPLE_WRITES);
+      if (!od) {
+        if ((err = vol->open_write(
+                this, if_writers, cache_config_http_max_alts > 1 ? cache_config_http_max_alts : 0)) > 0)
+          goto Lfailure;
+        if (od->has_multiple_writers()) {
+          MUTEX_RELEASE(lock);
+          SET_HANDLER(&CacheVC::openWriteMain);
+          return callcont(CACHE_EVENT_OPEN_WRITE);
+        }
+      }
+      // check for collision
+      if (dir_probe(&first_key, vol, &dir, &last_collision)) {
+        od->reading_vec = 1;
+        int ret = do_read_call(&first_key);
+        if (ret == EVENT_RETURN)
+          goto Lcallreturn;
+        return ret;
+      }
+      if (f.update) {
+        // fail update because vector has been GC'd
         goto Lfailure;
-      if (od->has_multiple_writers()) {
-        MUTEX_RELEASE(lock);
-        SET_HANDLER(&CacheVC::openWriteMain);
-        return callcont(CACHE_EVENT_OPEN_WRITE);
       }
     }
-    // check for collision
-    if (dir_probe(&first_key, vol, &dir, &last_collision)) {
-      od->reading_vec = 1;
-      int ret = do_read_call(&first_key);
-      if (ret == EVENT_RETURN)
-        goto Lcallreturn;
-      return ret;
-    }
-    if (f.update) {
-      // fail update because vector has been GC'd
-      goto Lfailure;
-    }
   }
 Lsuccess:
   od->reading_vec = 0;