summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/performance/io-cache/src/io-cache.c6
-rw-r--r--xlators/performance/io-cache/src/io-cache.h6
-rw-r--r--xlators/performance/io-cache/src/page.c7
3 files changed, 14 insertions, 5 deletions
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c
index 2e523b15b4a..9bf20be5bb5 100644
--- a/xlators/performance/io-cache/src/io-cache.c
+++ b/xlators/performance/io-cache/src/io-cache.c
@@ -220,6 +220,7 @@ ioc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
{
if (ioc_inode->cache.mtime == 0) {
ioc_inode->cache.mtime = stbuf->ia_mtime;
+ ioc_inode->cache.mtime_nsec = stbuf->ia_mtime_nsec;
}
ioc_inode->ia_size = stbuf->ia_size;
@@ -344,8 +345,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->cache.mtime = stbuf->ia_mtime;
+ ioc_inode->cache.mtime_nsec = stbuf->ia_mtime_nsec;
+ }
}
ioc_inode_unlock (ioc_inode);
local_stbuf = NULL;
@@ -606,6 +609,7 @@ ioc_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
ioc_inode_lock (ioc_inode);
{
ioc_inode->cache.mtime = buf->ia_mtime;
+ ioc_inode->cache.mtime_nsec = buf->ia_mtime_nsec;
ioc_inode->ia_size = buf->ia_size;
if ((table->min_file_size > ioc_inode->ia_size)
diff --git a/xlators/performance/io-cache/src/io-cache.h b/xlators/performance/io-cache/src/io-cache.h
index 15a2828bbc8..0b164efe4f4 100644
--- a/xlators/performance/io-cache/src/io-cache.h
+++ b/xlators/performance/io-cache/src/io-cache.h
@@ -131,8 +131,10 @@ struct ioc_cache {
rbthash_table_t *page_table;
struct list_head page_lru;
time_t mtime; /*
- * mtime of the server file when last
- * cached
+ * seconds component of file mtime
+ */
+ time_t mtime_nsec; /*
+ * nanosecond component of file mtime
*/
struct timeval tv; /*
* time-stamp at last re-validate
diff --git a/xlators/performance/io-cache/src/page.c b/xlators/performance/io-cache/src/page.c
index c4cc8f06085..28be2b35883 100644
--- a/xlators/performance/io-cache/src/page.c
+++ b/xlators/performance/io-cache/src/page.c
@@ -292,7 +292,8 @@ ioc_cache_still_valid (ioc_inode_t *ioc_inode, struct iatt *stbuf)
cache_still_valid = 0;
#else
- if (!stbuf || (stbuf->ia_mtime != ioc_inode->cache.mtime))
+ if (!stbuf || (stbuf->ia_mtime != ioc_inode->cache.mtime)
+ || (stbuf->ia_mtime_nsec != ioc_inode->cache.mtime_nsec))
cache_still_valid = 0;
#endif
@@ -366,8 +367,10 @@ ioc_fault_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
destroy_size = __ioc_inode_flush (ioc_inode);
}
- if ((op_ret >= 0) && !zero_filled)
+ if ((op_ret >= 0) && !zero_filled) {
ioc_inode->cache.mtime = stbuf->ia_mtime;
+ ioc_inode->cache.mtime_nsec = stbuf->ia_mtime_nsec;
+ }
gettimeofday (&ioc_inode->cache.tv, NULL);