summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-cache/src
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/performance/io-cache/src')
-rw-r--r--xlators/performance/io-cache/src/io-cache.c6
-rw-r--r--xlators/performance/io-cache/src/io-cache.h10
-rw-r--r--xlators/performance/io-cache/src/page.c7
3 files changed, 17 insertions, 6 deletions
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c
index f16bc393f..4b8a4666a 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))) {
diff --git a/xlators/performance/io-cache/src/io-cache.h b/xlators/performance/io-cache/src/io-cache.h
index 2ff7e2dbb..2f354c67f 100644
--- a/xlators/performance/io-cache/src/io-cache.h
+++ b/xlators/performance/io-cache/src/io-cache.h
@@ -141,10 +141,14 @@ struct ioc_inode {
* weight of the inode, increases on each
* read
*/
- time_t mtime; /*
- * mtime of the server file when last
- * cached
+ uint32_t mtime; /*
+ * seconds component of file mtime on
+ * server
*/
+ uint32_t mtime_nsec; /* nanosecond component of file mtime
+ * on server
+ */
+
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 b3833fff0..c469a2620 100644
--- a/xlators/performance/io-cache/src/page.c
+++ b/xlators/performance/io-cache/src/page.c
@@ -284,7 +284,8 @@ ioc_cache_still_valid (ioc_inode_t *ioc_inode, struct stat *stbuf)
cache_still_valid = 0;
#else
- if (!stbuf || (stbuf->st_mtime != ioc_inode->mtime))
+ if (!stbuf || (stbuf->st_mtime != ioc_inode->mtime)
+ || (ST_MTIM_NSEC(stbuf) != ioc_inode->mtime_nsec))
cache_still_valid = 0;
#endif
@@ -359,8 +360,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->mtime = stbuf->st_mtime;
+ ST_MTIM_NSEC_SET(stbuf, ioc_inode->mtime_nsec);
+ }
gettimeofday (&ioc_inode->tv, NULL);