diff options
author | Amar Tumballi <amarts@redhat.com> | 2017-12-27 16:14:30 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2018-01-05 09:35:07 +0000 |
commit | 92430596d697381d5f49ff69eb24d9ff3e291da8 (patch) | |
tree | 2a393ce9a5032f207ca38464a2db9bfc9f3c7045 /rpc | |
parent | 01caa839ebda29c2fe209c4767626f2f49ea3e71 (diff) |
dict: add more types for values
Added 2 more types which are present in gluster codebase, mainly
IATT and UUID.
Updates #203
Change-Id: Ib6d6d6aefb88c3494fbf93dcbe08d9979484968f
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/xdr/src/glusterfs-fops.x | 2 | ||||
-rw-r--r-- | rpc/xdr/src/glusterfs4-xdr.x | 30 | ||||
-rw-r--r-- | rpc/xdr/src/rpc-common-xdr.x | 22 |
3 files changed, 31 insertions, 23 deletions
diff --git a/rpc/xdr/src/glusterfs-fops.x b/rpc/xdr/src/glusterfs-fops.x index 44e5d9191a2..1cb2d83c161 100644 --- a/rpc/xdr/src/glusterfs-fops.x +++ b/rpc/xdr/src/glusterfs-fops.x @@ -239,5 +239,7 @@ enum gf_dict_data_type_t { GF_DATA_TYPE_DOUBLE, GF_DATA_TYPE_STR, GF_DATA_TYPE_PTR, + GF_DATA_TYPE_GFUUID, + GF_DATA_TYPE_IATT, GF_DATA_TYPE_MAX }; diff --git a/rpc/xdr/src/glusterfs4-xdr.x b/rpc/xdr/src/glusterfs4-xdr.x index a4fc9b22850..7396b566fa7 100644 --- a/rpc/xdr/src/glusterfs4-xdr.x +++ b/rpc/xdr/src/glusterfs4-xdr.x @@ -12,10 +12,38 @@ %#include "rpc-pragmas.h" #endif %#include "compat.h" -%#include "rpc-common-xdr.h" %#include "glusterfs-fops.h" %#include "glusterfs3-xdr.h" + +union gfx_value switch (gf_dict_data_type_t type) { + case GF_DATA_TYPE_INT: + hyper value_int; + case GF_DATA_TYPE_UINT: + unsigned hyper value_uint; + case GF_DATA_TYPE_DOUBLE: + double value_dbl; + case GF_DATA_TYPE_STR: + opaque val_string<>; + case GF_DATA_TYPE_IATT: + gf_iatt iatt; + case GF_DATA_TYPE_GFUUID: + opaque uuid[20]; + case GF_DATA_TYPE_PTR: + opaque other<>; +}; + +struct gfx_dict_pair { + opaque key<>; + gfx_value value; +}; + +struct gfx_dict { + unsigned int count; + gfx_dict_pair pairs<>; +}; + +/* fops */ struct gfs3_fsetattr_req_v2 { opaque gfid[16]; hyper fd; diff --git a/rpc/xdr/src/rpc-common-xdr.x b/rpc/xdr/src/rpc-common-xdr.x index 1af7c8041ed..b01d282f368 100644 --- a/rpc/xdr/src/rpc-common-xdr.x +++ b/rpc/xdr/src/rpc-common-xdr.x @@ -65,25 +65,3 @@ struct gf_common_rsp { int op_errno; opaque xdata<>; /* Extra data */ } ; - - -union gfx_value switch (gf_dict_data_type_t type) { - case GF_DATA_TYPE_INT: - hyper value_int; - case GF_DATA_TYPE_UINT: - unsigned hyper value_uint; - case GF_DATA_TYPE_DOUBLE: - double value_dbl; - case GF_DATA_TYPE_STR: - opaque val_string<>; -}; - -struct gfx_dict_pair { - opaque key<>; - gfx_value value; -}; - -struct gfx_dict { - unsigned int count; - gfx_dict_pair pairs<>; -}; |