[PVFS2-CVS] commit by walt in pvfs2-1/src/proto: PINT-le-bytefield.c PINT-reqproto-encode.c endecode-funcs.h pvfs2-req-proto.h

CVS commit program cvs at parl.clemson.edu
Thu Jul 21 13:17:56 EDT 2005


Update of /projects/cvsroot/pvfs2-1/src/proto
In directory parlweb:/tmp/cvs-serv14537/src/proto

Modified Files:
	PINT-le-bytefield.c PINT-reqproto-encode.c endecode-funcs.h 
	pvfs2-req-proto.h 
Log Message:
added extended attribute support


Index: PINT-le-bytefield.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/proto/PINT-le-bytefield.c,v
diff -p -u -r1.33 -r1.34
--- PINT-le-bytefield.c	31 Mar 2005 19:14:35 -0000	1.33
+++ PINT-le-bytefield.c	21 Jul 2005 16:17:56 -0000	1.34
@@ -57,6 +57,7 @@ static void lebf_initialize(void)
     char *tmp_name = strdup("foo");
     const int init_big_size = 1024 * 1024;
 
+    gossip_debug(GOSSIP_ENDECODE_DEBUG,"lebf_initialize\n");
     /*
      * Some messages have extra structures, and even indeterminate sizes
      * which are hand-calculated here.  Also some fields must be initialized
@@ -185,6 +186,20 @@ static void lebf_initialize(void)
 	    case PVFS_SERV_PROTO_ERROR:
 		/* nothing special */
 		break;
+	    case PVFS_SERV_GETEATTR:
+                req.u.geteattr.nkey = 0;
+                resp.u.geteattr.nkey = 0;
+		reqsize = extra_size_PVFS_servreq_geteattr;
+		respsize = extra_size_PVFS_servresp_geteattr;
+		break;
+	    case PVFS_SERV_SETEATTR:
+                req.u.seteattr.nkey = 0;
+		reqsize = extra_size_PVFS_servreq_seteattr;
+		break;
+	    case PVFS_SERV_DELEATTR:
+                req.u.deleattr.key.buffer_sz = 0;
+		reqsize = extra_size_PVFS_servreq_deleattr;
+		break;
 	}
 	/* since these take the max size when mallocing in the encode,
 	 * give them a huge number, then later fix it. */
@@ -241,6 +256,7 @@ encode_common(struct PINT_encoded_msg *t
     int ret = 0;
     void *buf = NULL;
 
+    gossip_debug(GOSSIP_ENDECODE_DEBUG,"encode_common\n");
     /* this encoder always uses just one buffer */
     target_msg->buffer_list = &target_msg->buffer_stub;
     target_msg->size_list = &target_msg->size_stub;
@@ -286,6 +302,7 @@ static int lebf_encode_req(
     ret = encode_common(target_msg, max_size_array[req->op].req);
     if (ret)
 	goto out;
+    gossip_debug(GOSSIP_ENDECODE_DEBUG,"lebf_encode_req\n");
 
     /* every request has these fields */
     p = &target_msg->ptr_current;
@@ -319,6 +336,9 @@ static int lebf_encode_req(
 	CASE(PVFS_SERV_MGMT_ITERATE_HANDLES, mgmt_iterate_handles);
 	CASE(PVFS_SERV_MGMT_DSPACE_INFO_LIST, mgmt_dspace_info_list);
 	CASE(PVFS_SERV_MGMT_EVENT_MON, mgmt_event_mon);
+	CASE(PVFS_SERV_GETEATTR, geteattr);
+	CASE(PVFS_SERV_SETEATTR, seteattr);
+	CASE(PVFS_SERV_DELEATTR, deleattr);
 
 	case PVFS_SERV_GETCONFIG:
         case PVFS_SERV_MGMT_NOOP:
@@ -371,6 +391,7 @@ static int lebf_encode_resp(
     ret = encode_common(target_msg, max_size_array[resp->op].resp);
     if (ret)
 	goto out;
+    gossip_debug(GOSSIP_ENDECODE_DEBUG,"lebf_encode_resp\n");
 
     /* every response has these fields */
     p = &target_msg->ptr_current;
@@ -404,13 +425,16 @@ static int lebf_encode_resp(
         CASE(PVFS_SERV_MGMT_ITERATE_HANDLES, mgmt_iterate_handles);
         CASE(PVFS_SERV_MGMT_DSPACE_INFO_LIST, mgmt_dspace_info_list);
         CASE(PVFS_SERV_MGMT_EVENT_MON, mgmt_event_mon);
-            CASE(PVFS_SERV_WRITE_COMPLETION, write_completion);
+        CASE(PVFS_SERV_WRITE_COMPLETION, write_completion);
         CASE(PVFS_SERV_MGMT_GET_DIRDATA_HANDLE, mgmt_get_dirdata_handle);
+        CASE(PVFS_SERV_GETEATTR, geteattr);
 
             case PVFS_SERV_REMOVE:
             case PVFS_SERV_MGMT_REMOVE_OBJECT:
             case PVFS_SERV_MGMT_REMOVE_DIRENT:
             case PVFS_SERV_SETATTR:
+            case PVFS_SERV_SETEATTR:
+            case PVFS_SERV_DELEATTR:
             case PVFS_SERV_CRDIRENT:
             case PVFS_SERV_TRUNCATE:
             case PVFS_SERV_FLUSH:
@@ -470,6 +494,7 @@ static int lebf_decode_req(
 
     /* decode generic part of request (enough to get op number) */
     decode_PVFS_server_req(p, req);
+    gossip_debug(GOSSIP_ENDECODE_DEBUG,"lebf_decode_req\n");
 
 #define CASE(tag,var) \
     case tag: decode_PVFS_servreq_##var(p, &req->u.var); break
@@ -499,6 +524,9 @@ static int lebf_decode_req(
 	CASE(PVFS_SERV_MGMT_ITERATE_HANDLES, mgmt_iterate_handles);
 	CASE(PVFS_SERV_MGMT_DSPACE_INFO_LIST, mgmt_dspace_info_list);
 	CASE(PVFS_SERV_MGMT_EVENT_MON, mgmt_event_mon);
+	CASE(PVFS_SERV_GETEATTR, geteattr);
+	CASE(PVFS_SERV_SETEATTR, seteattr);
+	CASE(PVFS_SERV_DELEATTR, deleattr);
 
 	case PVFS_SERV_GETCONFIG:
         case PVFS_SERV_MGMT_NOOP:
@@ -548,6 +576,7 @@ static int lebf_decode_resp(
 
     /* decode generic part of response (including op number) */
     decode_PVFS_server_resp(p, resp);
+    gossip_debug(GOSSIP_ENDECODE_DEBUG,"lebf_decode_resp\n");
 
     if (resp->status == -PVFS_EIO) 
         goto out;
@@ -575,11 +604,14 @@ static int lebf_decode_resp(
 	CASE(PVFS_SERV_MGMT_EVENT_MON, mgmt_event_mon);
 	CASE(PVFS_SERV_MGMT_GET_DIRDATA_HANDLE, mgmt_get_dirdata_handle);
         CASE(PVFS_SERV_WRITE_COMPLETION, write_completion);
+	CASE(PVFS_SERV_GETEATTR, geteattr);
 
         case PVFS_SERV_REMOVE:
         case PVFS_SERV_MGMT_REMOVE_OBJECT:
         case PVFS_SERV_MGMT_REMOVE_DIRENT:
         case PVFS_SERV_SETATTR:
+        case PVFS_SERV_SETEATTR:
+        case PVFS_SERV_DELEATTR:
         case PVFS_SERV_CRDIRENT:
         case PVFS_SERV_TRUNCATE:
         case PVFS_SERV_FLUSH:
@@ -617,6 +649,7 @@ static void lebf_encode_rel(
     struct PINT_encoded_msg *msg,
     enum PINT_encode_msg_type input_type)
 {
+    gossip_debug(GOSSIP_ENDECODE_DEBUG,"lebf_encode_rel\n");
     /* just a single buffer to free */
     if (initializing_sizes)
     {
@@ -638,6 +671,7 @@ static void lebf_encode_rel(
 static void lebf_decode_rel(struct PINT_decoded_msg *msg,
                             enum PINT_encode_msg_type input_type)
 {
+    gossip_debug(GOSSIP_ENDECODE_DEBUG,"lebf_decode_rel\n");
     if (input_type == PINT_DECODE_REQ) {
 	struct PVFS_server_req *req = &msg->stub_dec.req;
 	switch (req->op) {
@@ -689,9 +723,11 @@ static void lebf_decode_rel(struct PINT_
 	    case PVFS_SERV_MGMT_ITERATE_HANDLES:
 	    case PVFS_SERV_MGMT_PERF_MON:
 	    case PVFS_SERV_MGMT_EVENT_MON:
+	    case PVFS_SERV_GETEATTR:
+	    case PVFS_SERV_SETEATTR:
+	    case PVFS_SERV_DELEATTR:
 		/* nothing to free */
 		break;
-
 	    case PVFS_SERV_INVALID:
 	    case PVFS_SERV_WRITE_COMPLETION:
 	    case PVFS_SERV_PERF_UPDATE:
@@ -741,6 +777,12 @@ static void lebf_decode_rel(struct PINT_
 		decode_free(resp->u.mgmt_event_mon.event_array);
 		break;
 
+	    case PVFS_SERV_GETEATTR:
+                /* need a loop here?  WBL */
+		if (resp->u.geteattr.val)
+		    decode_free(resp->u.geteattr.val);
+		break;
+
 	    case PVFS_SERV_GETCONFIG:
 	    case PVFS_SERV_CREATE:
 	    case PVFS_SERV_REMOVE:
@@ -749,6 +791,8 @@ static void lebf_decode_rel(struct PINT_
 	    case PVFS_SERV_MGMT_GET_DIRDATA_HANDLE:
 	    case PVFS_SERV_IO:
 	    case PVFS_SERV_SETATTR:
+	    case PVFS_SERV_SETEATTR:
+	    case PVFS_SERV_DELEATTR:
 	    case PVFS_SERV_CRDIRENT:
 	    case PVFS_SERV_RMDIRENT:
 	    case PVFS_SERV_CHDIRENT:
@@ -778,6 +822,7 @@ static int check_req_size(struct PVFS_se
     struct PINT_encoded_msg msg;
     int size;
 
+    gossip_debug(GOSSIP_ENDECODE_DEBUG,"check_req_size\n");
     lebf_encode_req(req, &msg);
     size = msg.total_size;
     lebf_encode_rel(&msg, 0);
@@ -789,6 +834,7 @@ static int check_resp_size(struct PVFS_s
     struct PINT_encoded_msg msg;
     int size;
 
+    gossip_debug(GOSSIP_ENDECODE_DEBUG,"check_resp_size\n");
     lebf_encode_resp(resp, &msg);
     size = msg.total_size;
     lebf_encode_rel(&msg, 0);

Index: PINT-reqproto-encode.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/proto/PINT-reqproto-encode.c,v
diff -p -u -r1.23 -r1.24
--- PINT-reqproto-encode.c	11 Oct 2004 17:32:48 -0000	1.23
+++ PINT-reqproto-encode.c	21 Jul 2005 16:17:56 -0000	1.24
@@ -53,6 +53,7 @@ int PINT_encode_initialize(void)
 {
     int ret = -PVFS_EINVAL;
 
+    gossip_debug(GOSSIP_ENDECODE_DEBUG,"PINT_encode_initialize\n");
     if (ENCODING_IS_SUPPORTED(ENCODING_LE_BFIELD))
     {
         /* setup little endian bytefield encoding */
@@ -78,6 +79,7 @@ int PINT_encode_initialize(void)
  */
 void PINT_encode_finalize(void)
 {
+    gossip_debug(GOSSIP_ENDECODE_DEBUG,"PINT_encode_finalize\n");
     return;
 }
 
@@ -99,6 +101,7 @@ int PINT_encode(void* input_buffer,
     target_msg->dest = target_addr;
     target_msg->enc_type = enc_type;
 
+    gossip_debug(GOSSIP_ENDECODE_DEBUG,"PINT_encode\n");
     switch(enc_type)
     {
 	case ENCODING_LE_BFIELD:
@@ -163,6 +166,7 @@ int PINT_decode(void* input_buffer,
     int ret;
     int32_t enc_type_recved, proto_ver_recved;
 
+    gossip_debug(GOSSIP_ENDECODE_DEBUG,"PINT_decode\n");
     /* compare the header of the incoming buffer against the precalculated
      * header associated with each module
      */
@@ -249,6 +253,7 @@ int PINT_decode(void* input_buffer,
 void PINT_encode_release(struct PINT_encoded_msg* input_buffer,
 			 enum PINT_encode_msg_type input_type)
 { 
+    gossip_debug(GOSSIP_ENDECODE_DEBUG,"PINT_encode_release\n");
     if (ENCODING_IS_SUPPORTED(input_buffer->enc_type))
     {
         PINT_encoding_table[input_buffer->enc_type]->op->encode_release(
@@ -271,6 +276,7 @@ void PINT_encode_release(struct PINT_enc
 void PINT_decode_release(struct PINT_decoded_msg* input_buffer,
 			 enum PINT_encode_msg_type input_type)
 {
+    gossip_debug(GOSSIP_ENDECODE_DEBUG,"PINT_decode_release\n");
     if (ENCODING_IS_SUPPORTED(input_buffer->enc_type))
     {
         PINT_encoding_table[input_buffer->enc_type]->op->decode_release(
@@ -297,6 +303,7 @@ int PINT_encode_calc_max_size(
 {    
     int ret = -PVFS_EINVAL;
 
+    gossip_debug(GOSSIP_ENDECODE_DEBUG,"PINT_encode_calc_max_size\n");
     switch(enc_type)
     {
 	case ENCODING_LE_BFIELD:

Index: endecode-funcs.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/proto/endecode-funcs.h,v
diff -p -u -r1.10 -r1.11
--- endecode-funcs.h	31 Mar 2005 19:16:03 -0000	1.10
+++ endecode-funcs.h	21 Jul 2005 16:17:56 -0000	1.11
@@ -12,6 +12,11 @@
 #include "src/io/bmi/bmi-byteswap.h"
 
 /*
+ * NOTE - Every macro defined here needs to have a stub defined in
+ * include/pvfs2-encode-stubs.h
+ */
+
+/*
  * Generic macros to define encoding near target structure declarations.
  */
 
@@ -72,6 +77,7 @@
     *pbuf = *(pptr) + 4; \
     *(pptr) += roundup8(4 + len + 1); \
 } while (0)
+
 /* odd variation, space exists in some structure, must copy-in string */
 #define encode_here_string(pptr,pbuf) encode_string(pptr,pbuf)
 #define decode_here_string(pptr,pbuf) do { \
@@ -80,6 +86,21 @@
     *(pptr) += roundup8(4 + len + 1); \
 } while (0)
 
+/* keyvals; a lot like strings; decoding points existing character data */
+/* BTW we are skipping the read_sz field - keep that in mind */
+#define encode_PVFS_ds_keyval(pptr,pbuf) do { \
+    u_int32_t len = ((PVFS_ds_keyval *)pbuf)->buffer_sz; \
+    *(u_int32_t *) *(pptr) = htobmi32(len); \
+    memcpy(*(pptr)+4, ((PVFS_ds_keyval *)pbuf)->buffer, len); \
+    *(pptr) += roundup8(4 + len); \
+} while (0)
+#define decode_PVFS_ds_keyval(pptr,pbuf) do { \
+    u_int32_t len = bmitoh32(*(u_int32_t *) *(pptr)); \
+    ((PVFS_ds_keyval *)pbuf)->buffer_sz = len; \
+    ((PVFS_ds_keyval *)pbuf)->buffer = *(pptr) + 4; \
+    *(pptr) += roundup8(4 + len); \
+} while (0)
+
 /*
  * Type maps are put near the type definitions, except for this special one.
  *
@@ -90,8 +111,26 @@
 #define decode_enum decode_int32_t
 
 /* memory alloc and free, just for decoding */
+#if 0
+/* this is for debugging, if you want to see what is malloc'd */
+static inline void *decode_malloc (int n) {
+	void *p;
+	if (n>0)
+		p = malloc(n);
+	else
+		p = (void *)0;
+	printf("decode malloc %d bytes: %p\n",n,p);
+	return p;
+}
+/* this is for debugging, if you want to see what is free'd */
+static inline void decode_free (void *p) {
+	printf("decode free: %p\n",p);
+	free(p);
+}
+#else
 #define decode_malloc(n) ((n) ? malloc(n) : 0)
 #define decode_free(n) free(n)
+#endif
 
 /*
  * These wrappers define functions to do the encoding of the types or
@@ -250,6 +289,8 @@ static inline void decode_##name(char **
 }
 
 /* ones with arrays that are allocated in the decode */
+
+/* one field then one array */
 #define endecode_fields_1a_generic(name, sname, t1, x1, tn1, n1, ta1, a1) \
 static inline void encode_##name(char **pptr, const sname *x) { int i; \
     encode_##t1(pptr, &x->x1); \
@@ -270,6 +311,7 @@ static inline void decode_##name(char **
 #define endecode_fields_1a_struct(name, t1, x1, tn1, n1, ta1, a1) \
     endecode_fields_1a_generic(name, struct name, t1, x1, tn1, n1, ta1, a1)
 
+/* one field, and array, another field, another array - a special case */
 #define endecode_fields_1a_1a_struct(name, t1,x1, tn1, n1, ta1, a1, t2,x2, tn2, n2, ta2, a2) \
 static inline void encode_##name(char **pptr, const struct name *x) { int i; \
     encode_##t1(pptr, &x->x1); \
@@ -294,6 +336,75 @@ static inline void decode_##name(char **
 	decode_##ta2(pptr, &(x)->a2[i]); \
 }
 
+/* 2 fields, then an array */
+#define endecode_fields_2a_generic(name, sname, t1, x1, t2, x2, tn1, n1, ta1, a1) \
+static inline void encode_##name(char **pptr, const sname *x) { int i; \
+    encode_##t1(pptr, &x->x1); \
+    encode_##t2(pptr, &x->x2); \
+    encode_##tn1(pptr, &x->n1); \
+    for (i=0; i<x->n1; i++) \
+	encode_##ta1(pptr, &(x)->a1[i]); \
+} \
+static inline void decode_##name(char **pptr, sname *x) { int i; \
+    decode_##t1(pptr, &x->x1); \
+    decode_##t2(pptr, &x->x2); \
+    decode_##tn1(pptr, &x->n1); \
+    x->a1 = decode_malloc(x->n1 * sizeof(*x->a1)); \
+    for (i=0; i<x->n1; i++) \
+	decode_##ta1(pptr, &(x)->a1[i]); \
+}
+
+#define endecode_fields_2a(name, t1, x1, t2, x2, tn1, n1, ta1, a1) \
+    endecode_fields_2a_generic(name, name, t1, x1, t2, x2, tn1, n1, ta1, a1)
+#define endecode_fields_2a_struct(name, t1, x1, t2, x2, tn1, n1, ta1, a1) \
+    endecode_fields_2a_generic(name, struct name, t1, x1, t2, x2, tn1, n1, ta1, a1)
+
+/* 3 fields, then an array */
+#define endecode_fields_3a_struct(name, t1, x1, t2, x2, t3, x3, tn1, n1, ta1, a1) \
+static inline void encode_##name(char **pptr, const struct name *x) { int i; \
+    encode_##t1(pptr, &x->x1); \
+    encode_##t2(pptr, &x->x2); \
+    encode_##t3(pptr, &x->x3); \
+    encode_##tn1(pptr, &x->n1); \
+    for (i=0; i<x->n1; i++) \
+	encode_##ta1(pptr, &(x)->a1[i]); \
+} \
+static inline void decode_##name(char **pptr, struct name *x) { int i; \
+    decode_##t1(pptr, &x->x1); \
+    decode_##t2(pptr, &x->x2); \
+    decode_##t3(pptr, &x->x3); \
+    decode_##tn1(pptr, &x->n1); \
+    x->a1 = decode_malloc(x->n1 * sizeof(*x->a1)); \
+    for (i=0; i<x->n1; i++) \
+	decode_##ta1(pptr, &(x)->a1[i]); \
+}
+
+/* special case where we have two arrays of the same size after 2 fields */
+#define endecode_fields_3aa_struct(name, t1, x1, t2, x2, t3, x3, tn1, n1, ta1, a1, ta2, a2) \
+static inline void encode_##name(char **pptr, const struct name *x) { int i; \
+    encode_##t1(pptr, &x->x1); \
+    encode_##t2(pptr, &x->x2); \
+    encode_##t3(pptr, &x->x3); \
+    encode_##tn1(pptr, &x->n1); \
+    for (i=0; i<x->n1; i++) \
+	encode_##ta1(pptr, &(x)->a1[i]); \
+    for (i=0; i<x->n1; i++) \
+	encode_##ta2(pptr, &(x)->a2[i]); \
+} \
+static inline void decode_##name(char **pptr, struct name *x) { int i; \
+    decode_##t1(pptr, &x->x1); \
+    decode_##t2(pptr, &x->x2); \
+    decode_##t3(pptr, &x->x3); \
+    decode_##tn1(pptr, &x->n1); \
+    x->a1 = decode_malloc(x->n1 * sizeof(*x->a1)); \
+    for (i=0; i<x->n1; i++) \
+	decode_##ta1(pptr, &(x)->a1[i]); \
+    x->a2 = decode_malloc(x->n1 * sizeof(*x->a2)); \
+    for (i=0; i<x->n1; i++) \
+	decode_##ta2(pptr, &(x)->a2[i]); \
+}
+
+/* 4 fields, then an array */
 #define endecode_fields_4a_struct(name, t1, x1, t2, x2, t3, x3, t4, x4, tn1,n1,ta1,a1) \
 static inline void encode_##name(char **pptr, const struct name *x) { int i; \
     encode_##t1(pptr, &x->x1); \
@@ -315,6 +426,7 @@ static inline void decode_##name(char **
 	decode_##ta1(pptr, &(x)->a1[i]); \
 }
 
+/* 5 fields, then an array */
 #define endecode_fields_5a_struct(name, t1, x1, t2, x2, t3, x3, t4, x4, t5, x5, tn1,n1,ta1,a1) \
 static inline void encode_##name(char **pptr, const struct name *x) { int i; \
     encode_##t1(pptr, &x->x1); \

Index: pvfs2-req-proto.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/proto/pvfs2-req-proto.h,v
diff -p -u -r1.126 -r1.127
--- pvfs2-req-proto.h	7 Jul 2005 15:35:45 -0000	1.126
+++ pvfs2-req-proto.h	21 Jul 2005 16:17:56 -0000	1.127
@@ -51,12 +51,15 @@ enum PVFS_server_op
     PVFS_SERV_MGMT_REMOVE_DIRENT = 25,
     PVFS_SERV_MGMT_GET_DIRDATA_HANDLE = 26,
     PVFS_SERV_JOB_TIMER = 27,    /* not a real protocol request */
-    PVFS_SERV_PROTO_ERROR = 28
+    PVFS_SERV_PROTO_ERROR = 28,
+    PVFS_SERV_GETEATTR = 29,
+    PVFS_SERV_SETEATTR = 30,
+    PVFS_SERV_DELEATTR = 31
     /* IMPORTANT: please remember to modify PVFS_MAX_SERVER_OP define
      * (below) if you add a new operation to this list
      */
 };
-#define PVFS_MAX_SERVER_OP 28
+#define PVFS_MAX_SERVER_OP 31
 
 /*
  * These ops must always work, even if the server is in admin mode.
@@ -115,6 +118,12 @@ typedef struct
 #define PVFS_REQ_LIMIT_MAX_SYMLINK_RESOLUTION_COUNT 8
 /* max depth of a PINT_Request used in anything, just servreq IO now */
 #define PVFS_REQ_LIMIT_PINT_REQUEST_NUM  100
+/* max number of bytes in the key of a key/value pair including null term */
+#define PVFS_REQ_LIMIT_KEY_LEN 128
+/* max number of bytes in a value of a key/value/pair */
+#define PVFS_REQ_LIMIT_VAL_LEN 4096
+/* man number of key/value pairs to set or get in a list operation */
+#define PVFS_REQ_LIMIT_KEYVAL_LIST 32
 
 /* create *********************************************************/
 /* - used to create new metafile and datafile objects */
@@ -152,9 +161,9 @@ do {                                    
     (__req).u.create.fs_id = (__fsid);                 \
     (__req).u.create.object_type = (__objtype);        \
     (__req).u.create.handle_extent_array.extent_count =\
-        (__ext_array.extent_count);                    \
+        (__ext_array).extent_count;                    \
     (__req).u.create.handle_extent_array.extent_array =\
-        (__ext_array.extent_array);                    \
+        (__ext_array).extent_array;                    \
 } while (0)
 
 struct PVFS_servresp_create
@@ -477,9 +486,9 @@ do {                                    
     (__req).credentials = (__creds);                   \
     (__req).u.mkdir.fs_id = __fs_id;                   \
     (__req).u.mkdir.handle_extent_array.extent_count = \
-        (__ext_array.extent_count);                    \
+        (__ext_array).extent_count;                    \
     (__req).u.mkdir.handle_extent_array.extent_array = \
-        (__ext_array.extent_array);                    \
+        (__ext_array).extent_array;                    \
     PINT_CONVERT_ATTR(&(__req).u.mkdir.attr,           \
        &(__attr), PVFS_ATTR_COMMON_ALL);               \
     (__req).u.mkdir.attr.mask &= (__amask);            \
@@ -1142,6 +1151,132 @@ endecode_fields_1a_struct(
   (PVFS_REQ_LIMIT_MGMT_EVENT_MON_COUNT * \
    roundup8(sizeof(struct PVFS_mgmt_event)))
 
+/* geteattr ****************************************************/
+/* - retreives list of extended attributes */
+
+struct PVFS_servreq_geteattr
+{
+    PVFS_handle handle;  /* handle of target object */
+    PVFS_fs_id fs_id;    /* file system */
+    int32_t nkey;        /* number of keys to read */
+    PVFS_ds_keyval *key; /* array of keys to read */
+    PVFS_size *valsz;    /* array of value buffer sizes */
+};
+endecode_fields_3aa_struct(
+    PVFS_servreq_geteattr,
+    PVFS_handle, handle,
+    PVFS_fs_id, fs_id,
+    skip4,,
+    int32_t, nkey,
+    PVFS_ds_keyval, key,
+    PVFS_size, valsz);
+#define extra_size_PVFS_servreq_geteattr \
+    (PVFS_REQ_LIMIT_KEY_LEN * PVFS_REQ_LIMIT_KEYVAL_LIST)
+
+#define PINT_SERVREQ_GETEATTR_FILL(__req,   \
+                                  __creds, \
+                                  __fsid,  \
+                                  __handle,\
+                                  __nkey,\
+                                  __key_array, \
+                                  __size_array) \
+do {                                       \
+    memset(&(__req), 0, sizeof(__req));    \
+    (__req).op = PVFS_SERV_GETEATTR;        \
+    (__req).credentials = (__creds);       \
+    (__req).u.geteattr.fs_id = (__fsid);    \
+    (__req).u.geteattr.handle = (__handle); \
+    (__req).u.geteattr.nkey = (__nkey); \
+    (__req).u.geteattr.key = (__key_array);\
+    (__req).u.geteattr.valsz = (__size_array);\
+} while (0)
+
+struct PVFS_servresp_geteattr
+{
+    int32_t nkey;           /* number of values returned */
+    PVFS_ds_keyval *val;    /* array of values returned */
+};
+endecode_fields_1a_struct(
+    PVFS_servresp_geteattr,
+    skip4,,
+    int32_t, nkey,
+    PVFS_ds_keyval, val)
+#define extra_size_PVFS_servresp_geteattr \
+    (PVFS_REQ_LIMIT_VAL_LEN * PVFS_REQ_LIMIT_KEYVAL_LIST)
+
+/* seteattr ****************************************************/
+/* - sets list of extended attributes */
+
+struct PVFS_servreq_seteattr
+{
+    PVFS_handle handle;    /* handle of target object */
+    PVFS_fs_id fs_id;      /* file system */
+    PVFS_fs_id nkey;       /* number of keys and vals */
+    PVFS_ds_keyval *key;    /* attribute key */
+    PVFS_ds_keyval *val;    /* attribute value */
+};
+endecode_fields_3aa_struct(
+    PVFS_servreq_seteattr,
+    PVFS_handle, handle,
+    PVFS_fs_id, fs_id,
+    skip4,,
+    int32_t, nkey,
+    PVFS_ds_keyval, key,
+    PVFS_ds_keyval, val)
+#define extra_size_PVFS_servreq_seteattr \
+    ((PVFS_REQ_LIMIT_KEY_LEN + PVFS_REQ_LIMIT_VAL_LEN) \
+        * PVFS_REQ_LIMIT_KEYVAL_LIST)
+
+#define PINT_SERVREQ_SETEATTR_FILL(__req,   \
+                                  __creds,       \
+                                  __fsid,        \
+                                  __handle,      \
+                                  __nkey,        \
+                                  __key_array,   \
+                                  __val_array)   \
+do {                                             \
+    memset(&(__req), 0, sizeof(__req));          \
+    (__req).op = PVFS_SERV_SETEATTR;        \
+    (__req).credentials = (__creds);             \
+    (__req).u.seteattr.fs_id = (__fsid);    \
+    (__req).u.seteattr.handle = (__handle); \
+    (__req).u.seteattr.nkey = (__nkey);     \
+    (__req).u.seteattr.key = (__key_array); \
+    (__req).u.seteattr.val = (__val_array); \
+} while (0)
+
+/* deleattr ****************************************************/
+/* - deletes extended attributes */
+
+struct PVFS_servreq_deleattr
+{
+    PVFS_handle handle; /* handle of target object */
+    PVFS_fs_id fs_id;   /* file system */
+    PVFS_ds_keyval key; /* key to read */
+};
+endecode_fields_3_struct(
+    PVFS_servreq_deleattr,
+    PVFS_handle, handle,
+    PVFS_fs_id, fs_id,
+    PVFS_ds_keyval, key);
+#define extra_size_PVFS_servreq_deleattr \
+    PVFS_REQ_LIMIT_KEY_LEN
+
+#define PINT_SERVREQ_DELEATTR_FILL(__req,   \
+                                  __creds, \
+                                  __fsid,  \
+                                  __handle,\
+                                  __key) \
+do {                                       \
+    memset(&(__req), 0, sizeof(__req));    \
+    (__req).op = PVFS_SERV_DELEATTR;        \
+    (__req).credentials = (__creds);       \
+    (__req).u.deleattr.fs_id = (__fsid);    \
+    (__req).u.deleattr.handle = (__handle); \
+    (__req).u.deleattr.key.buffer_sz = (__key).buffer_sz;\
+    (__req).u.deleattr.key.buffer = (__key).buffer;\
+} while (0)
+
 /* server request *********************************************/
 /* - generic request with union of all op specific structs */
 
@@ -1173,6 +1308,9 @@ struct PVFS_server_req
         struct PVFS_servreq_mgmt_remove_object mgmt_remove_object;
         struct PVFS_servreq_mgmt_remove_dirent mgmt_remove_dirent;
         struct PVFS_servreq_mgmt_get_dirdata_handle mgmt_get_dirdata_handle;
+        struct PVFS_servreq_geteattr geteattr;
+        struct PVFS_servreq_seteattr seteattr;
+        struct PVFS_servreq_deleattr deleattr;
     } u;
 };
 #ifdef __PINT_REQPROTO_ENCODE_FUNCS_C
@@ -1216,6 +1354,7 @@ struct PVFS_server_resp
         struct PVFS_servresp_mgmt_dspace_info_list mgmt_dspace_info_list;
         struct PVFS_servresp_mgmt_event_mon mgmt_event_mon;
         struct PVFS_servresp_mgmt_get_dirdata_handle mgmt_get_dirdata_handle;
+        struct PVFS_servresp_geteattr geteattr;
     } u;
 };
 endecode_fields_2_struct(



More information about the PVFS2-CVS mailing list