diff options
author | Pranith Kumar K <pranithk@gluster.com> | 2010-08-28 06:02:54 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-08-28 04:56:11 -0700 |
commit | 157560b6dce9cf790e8405ce895d80f4efab1539 (patch) | |
tree | 61059f04be060b47cdbd148d6b1dc8aaa6b2e582 /rpc/xdr | |
parent | 48055db6c1b8e669e6c83cc3e579569f05629026 (diff) |
cli, mgmt/glusterd: added volume stop <VOLNAME> force functionality
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1361 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1361
Diffstat (limited to 'rpc/xdr')
-rw-r--r-- | rpc/xdr/src/cli1-xdr.c | 20 | ||||
-rw-r--r-- | rpc/xdr/src/cli1-xdr.h | 19 | ||||
-rw-r--r-- | rpc/xdr/src/cli1.x | 11 |
3 files changed, 38 insertions, 12 deletions
diff --git a/rpc/xdr/src/cli1-xdr.c b/rpc/xdr/src/cli1-xdr.c index ce16b666..64112c17 100644 --- a/rpc/xdr/src/cli1-xdr.c +++ b/rpc/xdr/src/cli1-xdr.c @@ -62,6 +62,15 @@ xdr_gf1_cli_get_volume (XDR *xdrs, gf1_cli_get_volume *objp) } bool_t +xdr_gf1_cli_op_flags (XDR *xdrs, gf1_cli_op_flags *objp) +{ + + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; +} + +bool_t xdr_gf1_cli_probe_req (XDR *xdrs, gf1_cli_probe_req *objp) { @@ -76,7 +85,7 @@ bool_t xdr_gf1_cli_probe_rsp (XDR *xdrs, gf1_cli_probe_rsp *objp) { - register int32_t *buf; + register int32_t *buf; if (xdrs->x_op == XDR_ENCODE) { buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT); @@ -224,9 +233,8 @@ xdr_gf1_cli_create_vol_rsp (XDR *xdrs, gf1_cli_create_vol_rsp *objp) return FALSE; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; - if (!xdr_string (xdrs, &objp->op_errstr, ~0)) - return FALSE; - + if (!xdr_string (xdrs, &objp->op_errstr, ~0)) + return FALSE; return TRUE; } @@ -280,6 +288,8 @@ xdr_gf1_cli_stop_vol_req (XDR *xdrs, gf1_cli_stop_vol_req *objp) if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; + if (!xdr_int (xdrs, &objp->flags)) + return FALSE; return TRUE; } @@ -375,7 +385,7 @@ xdr_gf1_cli_add_brick_rsp (XDR *xdrs, gf1_cli_add_brick_rsp *objp) return FALSE; if (!xdr_string (xdrs, &objp->volname, ~0)) return FALSE; - if (!xdr_string (xdrs, &objp->op_errstr, ~0)) + if (!xdr_string (xdrs, &objp->op_errstr, ~0)) return FALSE; return TRUE; } diff --git a/rpc/xdr/src/cli1-xdr.h b/rpc/xdr/src/cli1-xdr.h index c6fd14f3..55060bf6 100644 --- a/rpc/xdr/src/cli1-xdr.h +++ b/rpc/xdr/src/cli1-xdr.h @@ -26,8 +26,7 @@ #ifndef _CLI1_H_RPCGEN #define _CLI1_H_RPCGEN -//#include <rpc/rpc.h> -#include <rpc/xdr.h> +#include <rpc/rpc.h> #ifdef __cplusplus @@ -62,6 +61,11 @@ enum gf1_cli_get_volume { }; typedef enum gf1_cli_get_volume gf1_cli_get_volume; +enum gf1_cli_op_flags { + GF_CLI_FLAG_OP_FORCE = 1, +}; +typedef enum gf1_cli_op_flags gf1_cli_op_flags; + struct gf1_cli_probe_req { char *hostname; int port; @@ -172,6 +176,7 @@ typedef struct gf1_cli_start_vol_rsp gf1_cli_start_vol_rsp; struct gf1_cli_stop_vol_req { char *volname; + int flags; }; typedef struct gf1_cli_stop_vol_req gf1_cli_stop_vol_req; @@ -196,7 +201,7 @@ struct gf1_cli_rename_vol_rsp { typedef struct gf1_cli_rename_vol_rsp gf1_cli_rename_vol_rsp; struct gf1_cli_defrag_vol_req { - int cmd; + int cmd; char *volname; }; typedef struct gf1_cli_defrag_vol_req gf1_cli_defrag_vol_req; @@ -205,9 +210,9 @@ struct gf1_cli_defrag_vol_rsp { int op_ret; int op_errno; char *volname; - u_quad_t files; - u_quad_t size; - u_quad_t lookedup_files; + u_quad_t files; + u_quad_t size; + u_quad_t lookedup_files; }; typedef struct gf1_cli_defrag_vol_rsp gf1_cli_defrag_vol_rsp; @@ -288,6 +293,7 @@ extern bool_t xdr_gf1_cluster_type (XDR *, gf1_cluster_type*); extern bool_t xdr_gf1_cli_replace_op (XDR *, gf1_cli_replace_op*); extern bool_t xdr_gf1_cli_friends_list (XDR *, gf1_cli_friends_list*); extern bool_t xdr_gf1_cli_get_volume (XDR *, gf1_cli_get_volume*); +extern bool_t xdr_gf1_cli_op_flags (XDR *, gf1_cli_op_flags*); extern bool_t xdr_gf1_cli_probe_req (XDR *, gf1_cli_probe_req*); extern bool_t xdr_gf1_cli_probe_rsp (XDR *, gf1_cli_probe_rsp*); extern bool_t xdr_gf1_cli_deprobe_req (XDR *, gf1_cli_deprobe_req*); @@ -322,6 +328,7 @@ extern bool_t xdr_gf1_cluster_type (); extern bool_t xdr_gf1_cli_replace_op (); extern bool_t xdr_gf1_cli_friends_list (); extern bool_t xdr_gf1_cli_get_volume (); +extern bool_t xdr_gf1_cli_op_flags (); extern bool_t xdr_gf1_cli_probe_req (); extern bool_t xdr_gf1_cli_probe_rsp (); extern bool_t xdr_gf1_cli_deprobe_req (); diff --git a/rpc/xdr/src/cli1.x b/rpc/xdr/src/cli1.x index ffb8ab2c..d3383147 100644 --- a/rpc/xdr/src/cli1.x +++ b/rpc/xdr/src/cli1.x @@ -7,7 +7,7 @@ enum gf1_cli_replace_op { GF_REPLACE_OP_NONE = 0, GF_REPLACE_OP_START, - GF_REPLACE_OP_STOP, + GF_REPLACE_OP_COMMIT, GF_REPLACE_OP_PAUSE, GF_REPLACE_OP_ABORT, GF_REPLACE_OP_STATUS @@ -21,6 +21,10 @@ enum gf1_cli_get_volume { GF_CLI_GET_VOLUME_ALL = 1 } ; +enum gf1_cli_op_flags { + GF_CLI_FLAG_OP_FORCE = 1 +}; + struct gf1_cli_probe_req { string hostname<>; int port; @@ -103,6 +107,7 @@ struct gf1_cli_get_vol_rsp { struct gf1_cli_stop_vol_req { string volname<>; + int flags; } ; @@ -125,6 +130,7 @@ struct gf1_cli_get_vol_rsp { } ; struct gf1_cli_defrag_vol_req { + int cmd; string volname<>; } ; @@ -132,6 +138,9 @@ struct gf1_cli_get_vol_rsp { int op_ret; int op_errno; string volname<>; + unsigned hyper files; + unsigned hyper size; + unsigned hyper lookedup_files; } ; struct gf1_cli_add_brick_req { |