summaryrefslogtreecommitdiffstats
path: root/xlators/features/upcall/src/upcall.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.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.h')
-rw-r--r--xlators/features/upcall/src/upcall.h31
1 files changed, 18 insertions, 13 deletions
diff --git a/xlators/features/upcall/src/upcall.h b/xlators/features/upcall/src/upcall.h
index a5aff9d091e..7cbec22bbf2 100644
--- a/xlators/features/upcall/src/upcall.h
+++ b/xlators/features/upcall/src/upcall.h
@@ -26,9 +26,9 @@
#include "upcall-messages.h"
#include "upcall-cache-invalidation.h"
-#define EXIT_IF_UPCALL_OFF(label) do { \
- if (!(ON_CACHE_INVALIDATION)) \
- goto label; \
+#define EXIT_IF_UPCALL_OFF(this, label) do { \
+ if (!is_upcall_enabled(this)) \
+ goto label; \
} while (0)
#define UPCALL_STACK_UNWIND(fop, frame, params ...) do { \
@@ -38,10 +38,10 @@
__xl = frame->this; \
__local = frame->local; \
frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, params); \
- upcall_local_wipe (__xl, __local); \
- } while (0)
+ } \
+ STACK_UNWIND_STRICT (fop, frame, params); \
+ upcall_local_wipe (__xl, __local); \
+} while (0)
#define UPCALL_STACK_DESTROY(frame) do { \
upcall_local_t *__local = NULL; \
@@ -51,12 +51,13 @@
frame->local = NULL; \
STACK_DESTROY (frame->root); \
upcall_local_wipe (__xl, __local); \
- } while (0)
+} while (0)
-struct _upcalls_private_t {
- int client_id; /* Not sure if reqd */
+struct _upcall_private_t {
+ gf_boolean_t cache_invalidation_enabled;
+ int32_t cache_invalidation_timeout;
};
-typedef struct _upcalls_private_t upcalls_private_t;
+typedef struct _upcall_private_t upcall_private_t;
enum _upcall_event_type_t {
EVENT_NULL,
@@ -122,13 +123,17 @@ int __upcall_inode_ctx_set (inode_t *inode, xlator_t *this);
upcall_inode_ctx_t *__upcall_inode_ctx_get (inode_t *inode, xlator_t *this);
upcall_inode_ctx_t *upcall_inode_ctx_get (inode_t *inode, xlator_t *this);
int upcall_cleanup_inode_ctx (xlator_t *this, inode_t *inode);
+void upcall_cache_forget (xlator_t *this, inode_t *inode,
+ upcall_inode_ctx_t *up_inode_ctx);
+/* Xlator options */
+gf_boolean_t is_upcall_enabled(xlator_t *this);
+
+/* Cache invalidation specific */
void upcall_cache_invalidate (call_frame_t *frame, xlator_t *this, client_t *client,
inode_t *inode, uint32_t flags);
void upcall_client_cache_invalidate (xlator_t *xl, uuid_t gfid,
upcall_client_t *up_client_entry,
uint32_t flags);
-void upcall_cache_forget (xlator_t *this, inode_t *inode,
- upcall_inode_ctx_t *up_inode_ctx);
#endif /* __UPCALL_H__ */