summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-cache/src/io-cache.c
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2010-04-06 02:16:20 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-04-08 03:08:42 -0700
commit0014fe4cc0f62cdb1d0292d37caf19c31f6d2d9e (patch)
treea6063450f233f959de4db076e15e4eb603bd13a6 /xlators/performance/io-cache/src/io-cache.c
parentab9fc36210071f95d5cb723e0fb9b738d31c8651 (diff)
performance/io-cache: make use of nano second resolution of mtime during cache validation.
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 801 (Direct io-mode support and related changes in caching translators.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=801
Diffstat (limited to 'xlators/performance/io-cache/src/io-cache.c')
-rw-r--r--xlators/performance/io-cache/src/io-cache.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c
index f16bc39..4b8a466 100644
--- a/xlators/performance/io-cache/src/io-cache.c
+++ b/xlators/performance/io-cache/src/io-cache.c
@@ -222,6 +222,7 @@ ioc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
{
if (ioc_inode->mtime == 0) {
ioc_inode->mtime = stbuf->st_mtime;
+ ioc_inode->mtime_nsec = ST_MTIM_NSEC(stbuf);
}
ioc_inode->st_size = stbuf->st_size;
@@ -346,8 +347,10 @@ ioc_cache_validate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
ioc_inode_lock (ioc_inode);
{
destroy_size = __ioc_inode_flush (ioc_inode);
- if (op_ret >= 0)
+ if (op_ret >= 0) {
ioc_inode->mtime = stbuf->st_mtime;
+ ioc_inode->mtime_nsec = ST_MTIM_NSEC(stbuf);
+ }
}
ioc_inode_unlock (ioc_inode);
local_stbuf = NULL;
@@ -589,6 +592,7 @@ ioc_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
{
ioc_inode->st_size = buf->st_size;
ioc_inode->mtime = buf->st_mtime;
+ ioc_inode->mtime_nsec = ST_MTIM_NSEC(buf);
if ((table->min_file_size > ioc_inode->st_size)
|| ((table->max_file_size >= 0)
&& (table->max_file_size < ioc_inode->st_size))) {