summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2017-12-22 11:34:22 +0530
committerJeff Darcy <jeff@pl.atyp.us>2017-12-22 17:44:26 +0000
commitf4734305783ce3aa10721bf2731923f6aa39252b (patch)
tree84d4b34c1c86747910606109105489e2450dc412 /libglusterfs
parent41120aa8bab4ca4496bb37b8986434be404ae255 (diff)
xlator.h: move options and other variables to the top of structure
This helps external applications which wants to consume xlator_api to read only fields (and not functions) using dlopen() to write smaller structures/objects and still achieve their requirements. One such example is GD2 project. Updates #168 Change-Id: I8737939c8c72f6572ee1514201e9f9f8e4f37b40 Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/xlator.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h
index 8a5ee819e5c..0e50bef1cb6 100644
--- a/libglusterfs/src/xlator.h
+++ b/libglusterfs/src/xlator.h
@@ -1053,6 +1053,28 @@ typedef struct {
the translators. For the backward compatibility, in 4.x series
even the old exported fields will be supported */
typedef struct {
+ /* op_version: will be used by volume generation logic to figure
+ out whether to insert it in graph or no, based on cluster's
+ operating version.
+ default value: 0, which means good to insert always */
+ uint32_t op_version[GF_MAX_RELEASES];
+
+ /* flags: will be used by volume generation logic to optimize the
+ placements etc.
+ default value: 0, which means don't treat it specially */
+ uint32_t flags;
+
+ /* xlator_id: unique per xlator. make sure to have no collission
+ in this ID */
+ uint32_t xlator_id;
+
+ /* identifier: a string constant */
+ char *identifier;
+
+ /* struct options: if the translator takes any 'options' from the
+ volume file, then that should be defined here. optional. */
+ volume_option_t *options;
+
/* init(): mandatory method, will be called during the
graph initialization */
int32_t (*init) (xlator_t *this);
@@ -1090,28 +1112,6 @@ typedef struct {
/* dumpops: a structure again, with methods to dump the details.
optional. */
struct xlator_dumpops *dumpops;
-
- /* struct options: if the translator takes any 'options' from the
- volume file, then that should be defined here. optional. */
- volume_option_t *options;
-
- /* op_version: will be used by volume generation logic to figure
- out whether to insert it in graph or no, based on cluster's
- operating version.
- default value: 0, which means good to insert always */
- uint32_t op_version[GF_MAX_RELEASES];
-
- /* flags: will be used by volume generation logic to optimize the
- placements etc.
- default value: 0, which means don't treat it specially */
- uint32_t flags;
-
- /* xlator_id: unique per xlator. make sure to have no collission
- in this ID */
- uint32_t xlator_id;
-
- /* identifier: a string constant */
- char *identifier;
} xlator_api_t;
#define xlator_has_parent(xl) (xl->parents != NULL)