trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wei...@apache.org
Subject git commit: to make cache init a little faster
Date Tue, 19 Feb 2013 08:23:02 GMT
Updated Branches:
  refs/heads/master 49be3b65b -> 55dd89d4d


to make cache init a little faster


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

Branch: refs/heads/master
Commit: 55dd89d4d95197822a81d6cf059bf2a5713b4025
Parents: 49be3b6
Author: weijin <taorui.wj@taobao.com>
Authored: Tue Feb 19 16:16:05 2013 +0800
Committer: weijin <taorui.wj@taobao.com>
Committed: Tue Feb 19 16:18:59 2013 +0800

----------------------------------------------------------------------
 iocore/cache/Cache.cc |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/55dd89d4/iocore/cache/Cache.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index d3f4f23..1232a11 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -1106,11 +1106,11 @@ Vol::init(char *s, off_t blocks, off_t dir_skip, bool clear)
     aio->aiocb.aio_buf = &(init_info->vol_h_f[i * STORE_BLOCK_SIZE]);
     aio->aiocb.aio_nbytes = footerlen;
     aio->action = this;
-    aio->thread = this_ethread();
+    aio->thread = AIO_CALLBACK_THREAD_ANY;
     aio->then = (i < 3) ? &(init_info->vol_aio[i + 1]) : 0;
   }
 
-  eventProcessor.schedule_imm(this, ET_CALL);
+  ink_assert(ink_aio_read(init_info->vol_aio));
   return 0;
 }
 
@@ -1474,11 +1474,6 @@ Vol::handle_header_read(int event, void *data)
   AIOCallback *op;
   VolHeaderFooter *hf[4];
   switch (event) {
-  case EVENT_IMMEDIATE:
-  case EVENT_INTERVAL:
-    ink_assert(ink_aio_read(init_info->vol_aio));
-    return EVENT_CONT;
-
   case AIO_EVENT_DONE:
     op = (AIOCallback *) data;
     for (int i = 0; i < 4; i++) {
@@ -1520,8 +1515,9 @@ Vol::handle_header_read(int event, void *data)
       delete init_info;
       init_info = 0;
     }
-
     return EVENT_DONE;
+  default:
+    ink_assert(!"not reach here");
   }
   return EVENT_DONE;
 }


Mime
View raw message