diff options
author | Raghavendra G <raghavendra@gluster.com> | 2009-10-26 03:01:33 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-10-28 01:46:27 -0700 |
commit | 3809bb1bbd617dbde1d943dbcf6b0346329187b6 (patch) | |
tree | c326390674d9120a731d01345d842e0e803e739a /xlators/performance/io-cache/src/io-cache.c | |
parent | 78d281d6026ad1ebe8cc65c4396055902369ea89 (diff) |
performance/io-cache: change data structure used to store page-cache.
- io-cache uses rbtree based hash tables to store page-cache instead of lists.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 335 (Io-cache optimization)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=335
Diffstat (limited to 'xlators/performance/io-cache/src/io-cache.c')
-rw-r--r-- | xlators/performance/io-cache/src/io-cache.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index 09ea4feb7..5c1f74db1 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -80,7 +80,7 @@ ioc_inode_need_revalidate (ioc_inode_t *ioc_inode) ret = gettimeofday (&tv, NULL); - if (time_elapsed (&tv, &ioc_inode->tv) >= table->cache_timeout) + if (time_elapsed (&tv, &ioc_inode->cache.tv) >= table->cache_timeout) need_revalidate = 1; return need_revalidate; @@ -100,7 +100,8 @@ __ioc_inode_flush (ioc_inode_t *ioc_inode) int32_t destroy_size = 0; int32_t ret = 0; - list_for_each_entry_safe (curr, next, &ioc_inode->pages, pages) { + list_for_each_entry_safe (curr, next, &ioc_inode->cache.page_lru, + page_lru) { ret = ioc_page_destroy (curr); if (ret != -1) @@ -185,7 +186,7 @@ ioc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, /* update the time-stamp of revalidation */ ioc_inode_lock (ioc_inode); { - gettimeofday (&ioc_inode->tv, NULL); + gettimeofday (&ioc_inode->cache.tv, NULL); } ioc_inode_unlock (ioc_inode); @@ -271,7 +272,7 @@ ioc_cache_validate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, { destroy_size = __ioc_inode_flush (ioc_inode); if (op_ret >= 0) - ioc_inode->mtime = stbuf->st_mtime; + ioc_inode->cache.mtime = stbuf->st_mtime; } ioc_inode_unlock (ioc_inode); local_stbuf = NULL; @@ -290,7 +291,7 @@ ioc_cache_validate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, ioc_inode_lock (ioc_inode); { - gettimeofday (&ioc_inode->tv, NULL); + gettimeofday (&ioc_inode->cache.tv, NULL); } ioc_inode_unlock (ioc_inode); @@ -1117,7 +1118,7 @@ ioc_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, ioc_inode_lock (ioc_inode); { - gettimeofday (&ioc_inode->tv, NULL); + gettimeofday (&ioc_inode->cache.tv, NULL); } ioc_inode_unlock (ioc_inode); |