You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2013/03/09 01:48:37 UTC
[2/50] git commit: to make cache init a little faster
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/3.3.x
Commit: 55dd89d4d95197822a81d6cf059bf2a5713b4025
Parents: 49be3b6
Author: weijin <ta...@taobao.com>
Authored: Tue Feb 19 16:16:05 2013 +0800
Committer: weijin <ta...@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;
}