summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2010-04-06 02:16:35 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-04-08 03:08:46 -0700
commit03847ffada833ea7126f2118063245dff013c23f (patch)
treeca7f4f92f3c0de1533c00133c62541ac7321c25b
parent0014fe4cc0f62cdb1d0292d37caf19c31f6d2d9e (diff)
performance/quick-read: make use of nanosecond resolution of mtime to decide whether to keep cache or not.
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
-rw-r--r--xlators/performance/quick-read/src/quick-read.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c
index e9a4124..53da888 100644
--- a/xlators/performance/quick-read/src/quick-read.c
+++ b/xlators/performance/quick-read/src/quick-read.c
@@ -214,7 +214,9 @@ unlock:
LOCK (&qr_file->lock);
{
if (qr_file->xattr
- && (qr_file->stbuf.st_mtime != buf->st_mtime)) {
+ && ((qr_file->stbuf.st_mtime != buf->st_mtime)
+ || (ST_MTIM_NSEC(&qr_file->stbuf)
+ != ST_MTIM_NSEC(buf)))) {
dict_unref (qr_file->xattr);
qr_file->xattr = NULL;
}
@@ -576,7 +578,9 @@ qr_validate_cache_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
LOCK (&qr_file->lock);
{
- if (qr_file->stbuf.st_mtime != buf->st_mtime) {
+ if ((qr_file->stbuf.st_mtime != buf->st_mtime)
+ || (ST_MTIM_NSEC(&qr_file->stbuf) !=
+ ST_MTIM_NSEC(buf))) {
dict_unref (qr_file->xattr);
qr_file->xattr = NULL;
}