[PVFS2-CVS] commit by pw in pvfs2/src/proto: endecode-funcs.h pvfs2-req-proto.h

CVS commit program cvs at parl.clemson.edu
Thu Jan 5 11:09:14 EST 2006


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

Modified Files:
	endecode-funcs.h pvfs2-req-proto.h 
Log Message:
align geteattr req, small_io resp; small_io req alignment to be fixed by Murali with his patch


Index: endecode-funcs.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/endecode-funcs.h,v
diff -u -p -u -r1.13 -r1.14
--- endecode-funcs.h	6 Oct 2005 13:43:04 -0000	1.13
+++ endecode-funcs.h	5 Jan 2006 16:09:14 -0000	1.14
@@ -362,28 +362,31 @@ static inline void decode_##name(char **
 #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) \
+/* special case where we have two arrays of the same size after 2 fields */
+#define endecode_fields_2aa_struct(name, t1, x1, t2, x2, 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]); \
 }
 
-/* special case where we have two arrays of the same size after 3 fields */
-#define endecode_fields_3aa_struct(name, t1, x1, t2, x2, t3, x3, tn1, n1, ta1, a1, ta2, a2) \
+/* 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); \
@@ -391,8 +394,6 @@ static inline void encode_##name(char **
     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); \
@@ -402,9 +403,6 @@ static inline void decode_##name(char **
     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]); \
 }
 
 /* special case where we have two arrays of the same size after 4 fields */

Index: pvfs2-req-proto.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/pvfs2-req-proto.h,v
diff -u -p -u -r1.132 -r1.133
--- pvfs2-req-proto.h	14 Dec 2005 21:50:30 -0000	1.132
+++ pvfs2-req-proto.h	5 Jan 2006 16:09:14 -0000	1.133
@@ -1054,6 +1054,7 @@ struct PVFS_servresp_small_io
 #define encode_PVFS_servresp_small_io(pptr,x) \
     do { \
         encode_enum(pptr, &(x)->io_type); \
+        encode_skip4(pptr,); \
         encode_PVFS_size(pptr, &(x)->bstream_size); \
         encode_PVFS_size(pptr, &(x)->result_size); \
         if((x)->io_type == PVFS_IO_READ && (x)->buffer) \
@@ -1066,6 +1067,7 @@ struct PVFS_servresp_small_io
 #define decode_PVFS_servresp_small_io(pptr,x) \
     do { \
         decode_enum(pptr, &(x)->io_type); \
+        decode_skip4(pptr,); \
         decode_PVFS_size(pptr, &(x)->bstream_size); \
         decode_PVFS_size(pptr, &(x)->result_size); \
         if((x)->io_type == PVFS_IO_READ) \
@@ -1295,7 +1297,7 @@ endecode_fields_1a_struct(
    roundup8(sizeof(struct PVFS_mgmt_event)))
 
 /* geteattr ****************************************************/
-/* - retreives list of extended attributes */
+/* - retrieves list of extended attributes */
 
 struct PVFS_servreq_geteattr
 {
@@ -1305,11 +1307,10 @@ struct PVFS_servreq_geteattr
     PVFS_ds_keyval *key; /* array of keys to read */
     PVFS_size *valsz;    /* array of value buffer sizes */
 };
-endecode_fields_3aa_struct(
+endecode_fields_2aa_struct(
     PVFS_servreq_geteattr,
     PVFS_handle, handle,
     PVFS_fs_id, fs_id,
-    skip4,,
     int32_t, nkey,
     PVFS_ds_keyval, key,
     PVFS_size, valsz);



More information about the PVFS2-CVS mailing list