summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2014-03-26 11:52:53 -0700
committerAnand Avati <avati@redhat.com>2014-05-05 17:28:55 -0700
commit8160399a36eff62a49a066f16dea9140d877c5e8 (patch)
treee51d49bd93ff98822986569fdfada5d2819546b0 /libglusterfs/src
parent7fba3a88f1ced610eca0c23516a1e720d75160cd (diff)
meta: (re-)Implement Meta translator
The meta translator exposes details about glusterfs itself in the form of a virtual namespace. Loading the translator on the client side creates the meta virtual view under $mntpoint/.meta by default. The directory is not listed (even with ls -a) and can be accessed by doing a "cd /mnt/.meta" Change-Id: I5ffdf39203841a9562a8280a1f79dc76d4dded5d BUG: 1089216 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/7509 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/glusterfs.h1
-rw-r--r--libglusterfs/src/graph.c25
2 files changed, 26 insertions, 0 deletions
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index 70df63eebbc..93d7260cbe9 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -453,6 +453,7 @@ struct _glusterfs_ctx {
void *listener; /* listener of the commands from glusterd */
unsigned char measure_latency; /* toggle switch for latency measurement */
pthread_t sigwaiter;
+ char *cmdlinestr;
struct mem_pool *stub_mem_pool;
unsigned char cleanup_started;
int graph_id; /* Incremented per graph, value should
diff --git a/libglusterfs/src/graph.c b/libglusterfs/src/graph.c
index b4eddd826f6..52e79ab68cd 100644
--- a/libglusterfs/src/graph.c
+++ b/libglusterfs/src/graph.c
@@ -196,6 +196,21 @@ glusterfs_graph_worm (glusterfs_graph_t *graph, glusterfs_ctx_t *ctx)
return ret;
}
+
+int
+glusterfs_graph_meta (glusterfs_graph_t *graph, glusterfs_ctx_t *ctx)
+{
+ int ret = 0;
+
+ if (!ctx->master)
+ return 0;
+
+ ret = glusterfs_graph_insert (graph, ctx, "meta",
+ "meta-autoload", 1);
+ return ret;
+}
+
+
int
glusterfs_graph_mac_compat (glusterfs_graph_t *graph, glusterfs_ctx_t *ctx)
{
@@ -464,6 +479,14 @@ glusterfs_graph_prepare (glusterfs_graph_t *graph, glusterfs_ctx_t *ctx)
return -1;
}
+ /* XXX: topmost xlator */
+ ret = glusterfs_graph_meta (graph, ctx);
+ if (ret) {
+ gf_log ("graph", GF_LOG_ERROR,
+ "glusterfs graph meta failed");
+ return -1;
+ }
+
/* XXX: this->ctx setting */
for (trav = graph->first; trav; trav = trav->next) {
trav->ctx = ctx;
@@ -671,6 +694,8 @@ glusterfs_volfile_reconfigure (int oldvollen, FILE *newvolfile_fp,
goto out;
}
+ glusterfs_graph_prepare (newvolfile_graph, ctx);
+
if (!is_graph_topology_equal (oldvolfile_graph,
newvolfile_graph)) {