From e77d7c0db17b7380b6344c7ec5835f210ed38c84 Mon Sep 17 00:00:00 2001
From: Mohammed Rafi KC <rkavunga@redhat.com>
Date: Fri, 30 Jun 2017 20:17:20 +0530
Subject: [PATCH 554/557] svs:implement CHILD UP notify in snapview-server
protocol/server expects a child up event to successfully
configure the graph. In the actual brick graph, posix is
the one who decide to initiate the notification to the parent
that the child is up.
But in snapd graph there is no posix, hence the child up
notification was missing.
Ideally each xlator should initiate the child up event whenever
it see's that this is the last child xlator.
back port of>
>Change-Id: Icccdb9fe920c265cadaf9f91c040a0831b4b78fc
>BUG: 1467513
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
>Reviewed-on: https://review.gluster.org/17689
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
>Smoke: Gluster Build System <jenkins@build.gluster.org>
>Reviewed-by: Amar Tumballi <amarts@redhat.com>
>Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Change-Id: Icccdb9fe920c265cadaf9f91c040a0831b4b78fc
BUG: 1191480
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/111806
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
---
xlators/features/snapview-server/src/snapview-server.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/xlators/features/snapview-server/src/snapview-server.c b/xlators/features/snapview-server/src/snapview-server.c
index 72cfc90..e7c257a 100644
--- a/xlators/features/snapview-server/src/snapview-server.c
+++ b/xlators/features/snapview-server/src/snapview-server.c
@@ -2201,6 +2201,21 @@ out:
return 0;
}
+int32_t
+notify (xlator_t *this, int32_t event, void *data, ...) {
+ switch (event) {
+
+ case GF_EVENT_PARENT_UP:
+ {
+ /* Tell the parent that snapview-server xlator is up */
+ default_notify (this, GF_EVENT_CHILD_UP, data);
+ }
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
int32_t
mem_acct_init (xlator_t *this)
--
1.8.3.1