diff options
author | Vijay Bellur <vbellur@redhat.com> | 2015-02-25 20:34:41 +0530 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2015-02-26 02:25:22 -0800 |
commit | d1397dbd7d6cdbd2d81d5d36d608b6175d449db4 (patch) | |
tree | 70878f0c692484e6c3d0919cbb321f87673848e3 /xlators/mgmt/glusterd/src/glusterd-volgen.h | |
parent | 2a60854e8360309347236852989d520a04975e9c (diff) |
mgmt/glusterd: Refactor brick graph generation in volgen.
This commit does the following:
1. Adds several new functions for generation of brick xlator units
in a volgen. Each such function takes care of generation of only
one xlator in volgen.
2. A new table, server_graph_table, links all individual graph generation
functions together. The order of xlator function generators in the
table determines the topology of the brick graph.
3. server_graph_builder() invokes individual graph generators by walking
through server_graph_table. Addition of debug xlators into the brick
graph is also handled by this walk. As a result, a lot of cruft that
is present in the exisiting implementation of this function gets
cleaned up.
4. get_server_xlator() now makes use of server_graph_table to determine
whether a xlator key corresponds to a server xlator or not.
Change-Id: I46bb6e331544150302eb5b33c4007917aff2586d
BUG: 1188196
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/9751
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.h')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.h b/xlators/mgmt/glusterd/src/glusterd-volgen.h index a3c093422a6..bc9c2265384 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.h +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.h @@ -91,6 +91,7 @@ typedef enum { GF_XLATOR_MARKER, GF_XLATOR_IO_STATS, GF_XLATOR_BD, + GF_XLATOR_SERVER, GF_XLATOR_NONE, } glusterd_server_xlator_t; @@ -125,6 +126,21 @@ struct volopt_map_entry { //gf_boolean_t client_option; }; +typedef +int (*brick_xlator_builder) (volgen_graph_t *graph, + glusterd_volinfo_t *volinfo, dict_t *set_dict, + glusterd_brickinfo_t *brickinfo); + +struct volgen_brick_xlator { + /* function that builds a xlator */ + brick_xlator_builder builder; + /* debug key for a xlator that + * gets used for adding debug translators like trace, error-gen + * before this xlator */ + char *dbg_key; +}; +typedef struct volgen_brick_xlator volgen_brick_xlator_t; + int glusterd_snapdsvc_create_volfile (glusterd_volinfo_t *volinfo); |