summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2015-02-15 23:35:56 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-03-17 05:08:07 -0700
commit2b97b57cd8c71cb07b7002cf3483e9cfc9403c58 (patch)
tree9fc96451b469e213348f3065ca07e7a7c5a96ec0 /xlators/mgmt/glusterd
parent79009691c01f2b32b523d91a159aadd0e414f31b (diff)
Upcall: New xlator to store various states and send cbk events
Framework on the server-side, to handle certain state of the files accessed and send notifications to the clients connected. A generic and extensible framework, used to maintain states in the glusterfsd process for each of the files accessed (including the clients info doing the fops) and send notifications to the respective glusterfs clients incase of any change in that state. This patch handles "Inode Update/Invalidation" upcall event. Feature page: URL: http://www.gluster.org/community/documentation/index.php/Features/Upcall-infrastructure Below link has a writeup which explains the code changes done - URL: https://soumyakoduri.wordpress.com/2015/02/25/glusterfs-understanding-upcall-infrastructure-and-cache-invalidation-support/ Change-Id: Ie3d724be9a3419fcf18901a753e8ec2df2ac802f BUG: 1200262 Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/9535 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c25
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.h1
2 files changed, 25 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 779d6be34a4..f20490423f6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -569,7 +569,6 @@ optget_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme,
return 0;
}
-
/* This getter considers defaults also. */
static int
volgen_dict_get (dict_t *dict, char *key, char **value)
@@ -1848,6 +1847,29 @@ out:
}
static int
+brick_graph_add_upcall (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
+ dict_t *set_dict, glusterd_brickinfo_t *brickinfo)
+{
+
+ xlator_t *xl = NULL;
+ int ret = -1;
+
+ if (!graph || !volinfo || !set_dict)
+ goto out;
+
+ xl = volgen_graph_add (graph, "features/upcall", volinfo->volname);
+ if (!xl) {
+ gf_log ("glusterd", GF_LOG_WARNING,
+ "failed to add features/upcall to graph");
+ goto out;
+ }
+
+ ret = 0;
+out:
+ return ret;
+}
+
+static int
brick_graph_add_server (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
dict_t *set_dict, glusterd_brickinfo_t *brickinfo)
{
@@ -2044,6 +2066,7 @@ static volgen_brick_xlator_t server_graph_table[] = {
{brick_graph_add_index, "index"},
{brick_graph_add_barrier, NULL},
{brick_graph_add_iot, "io-threads"},
+ {brick_graph_add_upcall, "upcall"},
{brick_graph_add_pump, NULL},
{brick_graph_add_locks, "locks"},
{brick_graph_add_acl, "acl"},
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.h b/xlators/mgmt/glusterd/src/glusterd-volgen.h
index 947de76c926..0d742aae056 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.h
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.h
@@ -87,6 +87,7 @@ typedef enum {
GF_XLATOR_POSIX = 0,
GF_XLATOR_ACL,
GF_XLATOR_LOCKS,
+ GF_XLATOR_UPCALL,
GF_XLATOR_IOT,
GF_XLATOR_INDEX,
GF_XLATOR_MARKER,