From d7ecaaa1ed0f88869812ea17cb64a102a74c8c1c Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 17 Jan 2012 05:57:24 +0530 Subject: core: add 'fremovexattr()' fop so operations can be done on fd for extended attribute removal Change-Id: Ie026f1b53793aeb4ae33e96ea5408c7a97f34bf6 Signed-off-by: Amar Tumballi BUG: 766571 Reviewed-on: http://review.gluster.com/778 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- rpc/rpc-lib/src/protocol-common.h | 3 ++- rpc/xdr/src/glusterfs3-xdr.c | 15 +++++++++++++++ rpc/xdr/src/glusterfs3-xdr.h | 9 +++++++++ rpc/xdr/src/glusterfs3-xdr.x | 6 ++++++ 4 files changed, 32 insertions(+), 1 deletion(-) (limited to 'rpc') diff --git a/rpc/rpc-lib/src/protocol-common.h b/rpc/rpc-lib/src/protocol-common.h index c2540fa8d00..b35cdf911a5 100644 --- a/rpc/rpc-lib/src/protocol-common.h +++ b/rpc/rpc-lib/src/protocol-common.h @@ -64,6 +64,7 @@ enum gf_fop_procnum { GFS3_OP_READDIRP, GFS3_OP_RELEASE, GFS3_OP_RELEASEDIR, + GFS3_OP_FREMOVEXATTR, GFS3_OP_MAXVALUE, } ; @@ -193,7 +194,7 @@ enum glusterd_brick_procnum { #define GLUSTER_CBK_VERSION 1 /* 0.0.1 */ #define GLUSTER3_1_FOP_PROGRAM 1298437 /* Completely random */ -#define GLUSTER3_1_FOP_VERSION 310 /* 3.1.0 */ +#define GLUSTER3_1_FOP_VERSION 330 /* 3.3.0 */ #define GLUSTER3_1_FOP_PROCCNT GFS3_OP_MAXVALUE /* Second version */ diff --git a/rpc/xdr/src/glusterfs3-xdr.c b/rpc/xdr/src/glusterfs3-xdr.c index fc3237872b5..a0c6f0b0edd 100644 --- a/rpc/xdr/src/glusterfs3-xdr.c +++ b/rpc/xdr/src/glusterfs3-xdr.c @@ -1063,6 +1063,21 @@ xdr_gfs3_removexattr_req (XDR *xdrs, gfs3_removexattr_req *objp) return TRUE; } +bool_t +xdr_gfs3_fremovexattr_req (XDR *xdrs, gfs3_fremovexattr_req *objp) +{ + register int32_t *buf; + buf = NULL; + + if (!xdr_opaque (xdrs, objp->gfid, 16)) + return FALSE; + if (!xdr_quad_t (xdrs, &objp->fd)) + return FALSE; + if (!xdr_string (xdrs, &objp->name, ~0)) + return FALSE; + return TRUE; +} + bool_t xdr_gfs3_opendir_req (XDR *xdrs, gfs3_opendir_req *objp) { diff --git a/rpc/xdr/src/glusterfs3-xdr.h b/rpc/xdr/src/glusterfs3-xdr.h index 4955b423e13..156608ff314 100644 --- a/rpc/xdr/src/glusterfs3-xdr.h +++ b/rpc/xdr/src/glusterfs3-xdr.h @@ -517,6 +517,13 @@ struct gfs3_removexattr_req { }; typedef struct gfs3_removexattr_req gfs3_removexattr_req; +struct gfs3_fremovexattr_req { + char gfid[16]; + quad_t fd; + char *name; +}; +typedef struct gfs3_fremovexattr_req gfs3_fremovexattr_req; + struct gfs3_opendir_req { char gfid[16]; char *path; @@ -850,6 +857,7 @@ extern bool_t xdr_gfs3_getxattr_rsp (XDR *, gfs3_getxattr_rsp*); extern bool_t xdr_gfs3_fgetxattr_req (XDR *, gfs3_fgetxattr_req*); extern bool_t xdr_gfs3_fgetxattr_rsp (XDR *, gfs3_fgetxattr_rsp*); extern bool_t xdr_gfs3_removexattr_req (XDR *, gfs3_removexattr_req*); +extern bool_t xdr_gfs3_fremovexattr_req (XDR *, gfs3_fremovexattr_req*); extern bool_t xdr_gfs3_opendir_req (XDR *, gfs3_opendir_req*); extern bool_t xdr_gfs3_opendir_rsp (XDR *, gfs3_opendir_rsp*); extern bool_t xdr_gfs3_fsyncdir_req (XDR *, gfs3_fsyncdir_req*); @@ -937,6 +945,7 @@ extern bool_t xdr_gfs3_getxattr_rsp (); extern bool_t xdr_gfs3_fgetxattr_req (); extern bool_t xdr_gfs3_fgetxattr_rsp (); extern bool_t xdr_gfs3_removexattr_req (); +extern bool_t xdr_gfs3_fremovexattr_req (); extern bool_t xdr_gfs3_opendir_req (); extern bool_t xdr_gfs3_opendir_rsp (); extern bool_t xdr_gfs3_fsyncdir_req (); diff --git a/rpc/xdr/src/glusterfs3-xdr.x b/rpc/xdr/src/glusterfs3-xdr.x index 69dc7068240..88a621034d5 100644 --- a/rpc/xdr/src/glusterfs3-xdr.x +++ b/rpc/xdr/src/glusterfs3-xdr.x @@ -388,6 +388,12 @@ struct gfs3_finodelk_req { string name<>; } ; + struct gfs3_fremovexattr_req { + opaque gfid[16]; + hyper fd; + string name<>; +} ; + struct gfs3_opendir_req { -- cgit