diff options
Diffstat (limited to 'rpc/xdr/src')
| -rw-r--r-- | rpc/xdr/src/glusterfs-fops.x | 10 | ||||
| -rw-r--r-- | rpc/xdr/src/glusterfs3.h | 4 | ||||
| -rw-r--r-- | rpc/xdr/src/rpc-common-xdr.x | 23 | 
3 files changed, 37 insertions, 0 deletions
diff --git a/rpc/xdr/src/glusterfs-fops.x b/rpc/xdr/src/glusterfs-fops.x index 5b5c5904678..44e5d9191a2 100644 --- a/rpc/xdr/src/glusterfs-fops.x +++ b/rpc/xdr/src/glusterfs-fops.x @@ -231,3 +231,13 @@ enum gf_upcall_flags_t {          GF_UPCALL_LEASE_RECALL,          GF_UPCALL_FLAGS_MAXVALUE  }; + +enum gf_dict_data_type_t { +        GF_DATA_TYPE_UNKNOWN, +        GF_DATA_TYPE_INT, +        GF_DATA_TYPE_UINT, +        GF_DATA_TYPE_DOUBLE, +        GF_DATA_TYPE_STR, +        GF_DATA_TYPE_PTR, +        GF_DATA_TYPE_MAX +}; diff --git a/rpc/xdr/src/glusterfs3.h b/rpc/xdr/src/glusterfs3.h index 0aa1ae80bf3..2da5594a347 100644 --- a/rpc/xdr/src/glusterfs3.h +++ b/rpc/xdr/src/glusterfs3.h @@ -418,4 +418,8 @@ gf_proto_cache_invalidation_to_upcall (xlator_t *this,    out:          return ret;  } + +extern int dict_to_xdr (dict_t *this, gfx_dict *xdict); +extern int xdr_to_dict (gfx_dict *xdict, dict_t **to); +  #endif /* !_GLUSTERFS3_H */ diff --git a/rpc/xdr/src/rpc-common-xdr.x b/rpc/xdr/src/rpc-common-xdr.x index 7ccfbb11a51..1af7c8041ed 100644 --- a/rpc/xdr/src/rpc-common-xdr.x +++ b/rpc/xdr/src/rpc-common-xdr.x @@ -17,6 +17,7 @@   * not captured in any section specific file */  %#include "xdr-common.h" +%#include "glusterfs-fops.h"  struct auth_glusterfs_parms_v2 {          int pid; @@ -64,3 +65,25 @@ 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<>; +};  | 
