From f4734305783ce3aa10721bf2731923f6aa39252b Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 22 Dec 2017 11:34:22 +0530 Subject: 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 --- libglusterfs/src/xlator.h | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'libglusterfs') 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) -- cgit