diff options
author | Amar Tumballi <amar@gluster.com> | 2011-03-01 03:36:45 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2011-03-01 15:10:35 -0800 |
commit | ae578f0c6518afd22cf13c21eebca203352774d3 (patch) | |
tree | 4b0b887f335c0fb0cb83620e0eccd830322fb7cc /rpc/xdr/src | |
parent | d95f28de8482c816c2b718d3cf62b667e7a6953c (diff) |
gluster rebalance: get the proper/exact error msg to cli
introduce a new field in XDR structure, and hence change the version
of program.
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1922 (Volume not present wrong message displayed on command line)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1922
Diffstat (limited to 'rpc/xdr/src')
-rw-r--r-- | rpc/xdr/src/cli1-xdr.c | 21 | ||||
-rw-r--r-- | rpc/xdr/src/cli1-xdr.h | 13 | ||||
-rw-r--r-- | rpc/xdr/src/cli1-xdr.x | 11 | ||||
-rw-r--r-- | rpc/xdr/src/cli1.c | 15 | ||||
-rw-r--r-- | rpc/xdr/src/cli1.h | 6 |
5 files changed, 66 insertions, 0 deletions
diff --git a/rpc/xdr/src/cli1-xdr.c b/rpc/xdr/src/cli1-xdr.c index 453513aa335..d9640f5b070 100644 --- a/rpc/xdr/src/cli1-xdr.c +++ b/rpc/xdr/src/cli1-xdr.c @@ -387,6 +387,27 @@ xdr_gf1_cli_defrag_vol_rsp (XDR *xdrs, gf1_cli_defrag_vol_rsp *objp) } bool_t +xdr_gf2_cli_defrag_vol_rsp (XDR *xdrs, gf2_cli_defrag_vol_rsp *objp) +{ + + if (!xdr_int (xdrs, &objp->op_ret)) + return FALSE; + if (!xdr_int (xdrs, &objp->op_errno)) + return FALSE; + if (!xdr_string (xdrs, &objp->op_errstr, ~0)) + return FALSE; + if (!xdr_string (xdrs, &objp->volname, ~0)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->files)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->size)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->lookedup_files)) + return FALSE; + return TRUE; +} + +bool_t xdr_gf1_cli_add_brick_req (XDR *xdrs, gf1_cli_add_brick_req *objp) { diff --git a/rpc/xdr/src/cli1-xdr.h b/rpc/xdr/src/cli1-xdr.h index 302b1f8ab8f..2e37e1bc2bc 100644 --- a/rpc/xdr/src/cli1-xdr.h +++ b/rpc/xdr/src/cli1-xdr.h @@ -240,6 +240,17 @@ struct gf1_cli_defrag_vol_rsp { }; typedef struct gf1_cli_defrag_vol_rsp gf1_cli_defrag_vol_rsp; +struct gf2_cli_defrag_vol_rsp { + int op_ret; + int op_errno; + char *op_errstr; + char *volname; + u_quad_t files; + u_quad_t size; + u_quad_t lookedup_files; +}; +typedef struct gf2_cli_defrag_vol_rsp gf2_cli_defrag_vol_rsp; + struct gf1_cli_add_brick_req { char *volname; int count; @@ -454,6 +465,7 @@ extern bool_t xdr_gf1_cli_rename_vol_req (XDR *, gf1_cli_rename_vol_req*); extern bool_t xdr_gf1_cli_rename_vol_rsp (XDR *, gf1_cli_rename_vol_rsp*); extern bool_t xdr_gf1_cli_defrag_vol_req (XDR *, gf1_cli_defrag_vol_req*); extern bool_t xdr_gf1_cli_defrag_vol_rsp (XDR *, gf1_cli_defrag_vol_rsp*); +extern bool_t xdr_gf2_cli_defrag_vol_rsp (XDR *, gf2_cli_defrag_vol_rsp*); extern bool_t xdr_gf1_cli_add_brick_req (XDR *, gf1_cli_add_brick_req*); extern bool_t xdr_gf1_cli_add_brick_rsp (XDR *, gf1_cli_add_brick_rsp*); extern bool_t xdr_gf1_cli_remove_brick_req (XDR *, gf1_cli_remove_brick_req*); @@ -505,6 +517,7 @@ extern bool_t xdr_gf1_cli_rename_vol_req (); extern bool_t xdr_gf1_cli_rename_vol_rsp (); extern bool_t xdr_gf1_cli_defrag_vol_req (); extern bool_t xdr_gf1_cli_defrag_vol_rsp (); +extern bool_t xdr_gf2_cli_defrag_vol_rsp (); extern bool_t xdr_gf1_cli_add_brick_req (); extern bool_t xdr_gf1_cli_add_brick_rsp (); extern bool_t xdr_gf1_cli_remove_brick_req (); diff --git a/rpc/xdr/src/cli1-xdr.x b/rpc/xdr/src/cli1-xdr.x index 0e18c6ab922..c5bd82965b7 100644 --- a/rpc/xdr/src/cli1-xdr.x +++ b/rpc/xdr/src/cli1-xdr.x @@ -165,6 +165,17 @@ struct gf1_cli_get_vol_rsp { unsigned hyper lookedup_files; } ; + + struct gf2_cli_defrag_vol_rsp { + int op_ret; + int op_errno; + string op_errstr<>; + string volname<>; + unsigned hyper files; + unsigned hyper size; + unsigned hyper lookedup_files; +} ; + struct gf1_cli_add_brick_req { string volname<>; int count; diff --git a/rpc/xdr/src/cli1.c b/rpc/xdr/src/cli1.c index 7bdfd033261..db678267803 100644 --- a/rpc/xdr/src/cli1.c +++ b/rpc/xdr/src/cli1.c @@ -302,6 +302,21 @@ gf_xdr_to_cli_defrag_vol_rsp (struct iovec inmsg, void *args) } ssize_t +gf_xdr_serialize_cli_defrag_vol_rsp_v2 (struct iovec outmsg, void *rsp) +{ + return xdr_serialize_generic (outmsg, (void *)rsp, + (xdrproc_t)xdr_gf2_cli_defrag_vol_rsp); + +} + +ssize_t +gf_xdr_to_cli_defrag_vol_rsp_v2 (struct iovec inmsg, void *args) +{ + return xdr_to_generic (inmsg, (void *)args, + (xdrproc_t)xdr_gf2_cli_defrag_vol_rsp); +} + +ssize_t gf_xdr_to_cli_defrag_vol_req (struct iovec inmsg, void *args) { return xdr_to_generic (inmsg, (void *)args, diff --git a/rpc/xdr/src/cli1.h b/rpc/xdr/src/cli1.h index 7e80a18cb78..2b7c2c65c0f 100644 --- a/rpc/xdr/src/cli1.h +++ b/rpc/xdr/src/cli1.h @@ -138,6 +138,12 @@ ssize_t gf_xdr_to_cli_defrag_vol_rsp (struct iovec inmsg, void *args); ssize_t +gf_xdr_serialize_cli_defrag_vol_rsp_v2 (struct iovec outmsg, void *rsp); + +ssize_t +gf_xdr_to_cli_defrag_vol_rsp_v2 (struct iovec inmsg, void *args); + +ssize_t gf_xdr_serialize_cli_add_brick_rsp (struct iovec outmsg, void *rsp); ssize_t |