diff options
author | Anand Avati <avati@redhat.com> | 2014-03-26 11:52:53 -0700 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2014-05-05 17:28:55 -0700 |
commit | 8160399a36eff62a49a066f16dea9140d877c5e8 (patch) | |
tree | e51d49bd93ff98822986569fdfada5d2819546b0 /libglusterfs/src/graph.c | |
parent | 7fba3a88f1ced610eca0c23516a1e720d75160cd (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/graph.c')
-rw-r--r-- | libglusterfs/src/graph.c | 25 |
1 files changed, 25 insertions, 0 deletions
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)) { |