summaryrefslogtreecommitdiffstats
path: root/xlators/features/upcall/src/upcall-cache-invalidation.h
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2015-03-24 10:30:31 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-03-31 11:16:26 -0700
commit25f97b2788a33efcb0714ad639f8db380b864982 (patch)
tree9720bdd09e04239dcd75bdb88ddc97623ec6fb44 /xlators/features/upcall/src/upcall-cache-invalidation.h
parente6f5ace08ad0a068cb49d3ca1274a27aa031992b (diff)
Upcall: Added xlator options to enable cache-invalidation
Added two xlator options to enable cache-invalidation and set cache-invalidation-timeout. In addition, made few minor changes in the upcall processing code in gfapi. Change-Id: Ie0b32ca8348e34e3fe4f1e7df30cc925fa4aad31 BUG: 1200271 Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/9975 Reviewed-by: Meghana M <mmadhusu@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/features/upcall/src/upcall-cache-invalidation.h')
-rw-r--r--xlators/features/upcall/src/upcall-cache-invalidation.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/xlators/features/upcall/src/upcall-cache-invalidation.h b/xlators/features/upcall/src/upcall-cache-invalidation.h
index 758ddf1dae8..138595cecb6 100644
--- a/xlators/features/upcall/src/upcall-cache-invalidation.h
+++ b/xlators/features/upcall/src/upcall-cache-invalidation.h
@@ -16,13 +16,9 @@
#include "config.h"
#endif
-/* TODO: Below macros have to be replaced with
- * xlator options - Bug1200271 */
-#define ON_CACHE_INVALIDATION 0 /* disable by default */
-
/* The time period for which a client will be notified of cache_invalidation
* events post its last access */
-#define CACHE_INVALIDATION_PERIOD 60
+#define CACHE_INVALIDATION_TIMEOUT "60"
/* Flags sent for cache_invalidation */
#define UP_NLINK 0x00000001 /* update nlink */
@@ -58,13 +54,19 @@
#define UP_NLINK_FLAGS (UP_NLINK | UP_TIMES)
#define CACHE_INVALIDATE(frame, this, client, inode, p_flags) do { \
- if (ON_CACHE_INVALIDATION) { \
- (void)upcall_cache_invalidate (frame, this, client, inode, p_flags); \
- } \
+ \
+ if (!is_cache_invalidation_enabled(this)) \
+ break; \
+ \
+ (void)upcall_cache_invalidate (frame, this, client, \
+ inode, p_flags); \
} while (0)
-#define CACHE_INVALIDATE_DIR(frame, this, client, inode_p, p_flags) do { \
- if (ON_CACHE_INVALIDATION) { \
+#define CACHE_INVALIDATE_DIR(frame, this, client, inode_p, p_flags) do {\
+ \
+ if (!is_cache_invalidation_enabled(this)) \
+ break; \
+ \
dentry_t *dentry; \
dentry_t *dentry_tmp; \
list_for_each_entry_safe (dentry, dentry_tmp, \
@@ -73,7 +75,10 @@
(void)upcall_cache_invalidate (frame, this, client, \
dentry->inode, p_flags); \
} \
- } \
} while (0)
+/* xlator options */
+gf_boolean_t is_cache_invalidation_enabled(xlator_t *this);
+int32_t get_cache_invalidation_timeout(xlator_t *this);
+
#endif /* __UPCALL_CACHE_INVALIDATION_H__ */