summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2015-06-12 13:45:09 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-06-27 16:22:51 -0700
commitb68f671b2b8a0aafef8f98145aee7044edaa907d (patch)
tree96a8e2d6a252692887161b3e255aae2cf1db62ce /libglusterfs/src
parent58a736111fa1db4f10c6646e81066434260f674f (diff)
Upcall/gfapi: Return ENOTSUP when upcall feature is disabled
Changes to detect the list of upcall events enabled using GF_FOP_IPC and return ENOTSUP to applications in case if they poll for any of the events disabled. Change-Id: Icc748054ef903598288119dbe99b1e337174662a BUG: 1231132 Signed-off-by: Niels de Vos <ndevos@redhat.com> Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/11196 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/common-utils.h1
-rw-r--r--libglusterfs/src/upcall-utils.h15
2 files changed, 14 insertions, 2 deletions
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h
index 86ea42ee849..9b07e8c7565 100644
--- a/libglusterfs/src/common-utils.h
+++ b/libglusterfs/src/common-utils.h
@@ -125,6 +125,7 @@ enum _gf_client_pid
enum _gf_xlator_ipc_targets {
GF_IPC_TARGET_CHANGELOG = 0,
+ GF_IPC_UPCALL_FEATURES = 1,
};
typedef enum _gf_boolean gf_boolean_t;
diff --git a/libglusterfs/src/upcall-utils.h b/libglusterfs/src/upcall-utils.h
index 001566fd85e..5f6970fe7e1 100644
--- a/libglusterfs/src/upcall-utils.h
+++ b/libglusterfs/src/upcall-utils.h
@@ -15,9 +15,20 @@
#include "compat-uuid.h"
#include "compat.h"
+/* Used by GF_IPC_UPCALL_FEATURES in the ipc() FOP.
+ *
+ * Each feature is a bit in the uint32_t, this likely will match all the events
+ * from the gf_upcall_event_t enum.
+ *
+ * When the bit for GF_UPCALL_EVENT_NULL is not set, upcall is loaded, but
+ * disabled.
+ */
+#define GF_UPCALL_FEATURES "gluster.upcall.features"
+
typedef enum {
- GF_UPCALL_EVENT_NULL,
- GF_UPCALL_CACHE_INVALIDATION,
+ GF_UPCALL_EVENT_NULL = 0,
+ GF_UPCALL_CACHE_INVALIDATION = 1,
+ /* add new events to the feature mask in up_ipc() */
} gf_upcall_event_t;
struct gf_upcall {