diff options
author | Raghavendra G <rgowdapp@redhat.com> | 2018-06-15 17:01:38 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2018-06-18 09:37:08 +0000 |
commit | 67de708df134cc9f2edf408f2dd9a7ed1a1ef817 (patch) | |
tree | 01cdbe04a78823ac4c70dc3122b5286332921d61 /xlators/performance/quick-read/src/quick-read.h | |
parent | ce8290db83427535b532c6df72ef07fae89407eb (diff) |
performance/quick-read: provide an invalidation based on ctime
Quick-read by default uses mtime to identify changes to file
data. However there are applications like rsync which explicitly set
mtime making it unreliable for the purpose of identifying change in
file content. Since ctime also changes when content of a file changes
and it cannot be set explicitly, it becomes suitable for identifying
staleness of cached data. This option makes quick-read to prefer ctime
over mtime to validate its cache. However, using ctime can result in
false positives as ctime changes with just attribute changes like
permission without changes to file data. So, use this option only when
mtime is not reliable.
credits to Kotresh Hiremath Ravishankar <khiremat@redhat.com> for
suggestion on using ctime instead of mtime.
Change-Id: Ib3ae39a3252b2876c8ffe81f471d02a87190e9b9
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
Updates: bz#1591621
Diffstat (limited to 'xlators/performance/quick-read/src/quick-read.h')
-rw-r--r-- | xlators/performance/quick-read/src/quick-read.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.h b/xlators/performance/quick-read/src/quick-read.h index cdbf3dfbd63..8ef0f9802b8 100644 --- a/xlators/performance/quick-read/src/quick-read.h +++ b/xlators/performance/quick-read/src/quick-read.h @@ -36,6 +36,8 @@ struct qr_inode { int priority; uint32_t ia_mtime; uint32_t ia_mtime_nsec; + uint32_t ia_ctime; + uint32_t ia_ctime_nsec; struct iatt buf; struct timeval last_refresh; struct list_head lru; @@ -57,6 +59,7 @@ struct qr_conf { uint64_t cache_size; int max_pri; gf_boolean_t qr_invalidation; + gf_boolean_t ctime_invalidation; struct list_head priority_list; }; typedef struct qr_conf qr_conf_t; |