[Pvfs2-cvs] commit by kunkel in pvfs2/src/proto:
PINT-reqproto-encode.c endecode-funcs.h PINT-le-bytefield.c
pvfs2-req-proto.h
CVS commit program
cvs at parl.clemson.edu
Wed May 23 16:49:05 EDT 2007
Update of /projects/cvsroot/pvfs2/src/proto
In directory parlweb1:/tmp/cvs-serv20193/src/proto
Modified Files:
Tag: pvfs2-kunkel-tas-branch
PINT-reqproto-encode.c endecode-funcs.h PINT-le-bytefield.c
pvfs2-req-proto.h
Log Message:
Merge HEAD changes to TAS-branch.
Index: PINT-reqproto-encode.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/PINT-reqproto-encode.c,v
diff -p -u -r1.30 -r1.30.6.1
--- PINT-reqproto-encode.c 17 Sep 2006 21:31:28 -0000 1.30
+++ PINT-reqproto-encode.c 23 May 2007 20:49:05 -0000 1.30.6.1
@@ -167,6 +167,7 @@ int PINT_decode(void* input_buffer,
int proto_major_recved, proto_minor_recved;
gossip_debug(GOSSIP_ENDECODE_DEBUG,"PINT_decode\n");
+ target_msg->enc_type = -1; /* invalid */
/* sanity check size */
if(size < PINT_ENC_GENERIC_HEADER_SIZE)
@@ -200,8 +201,8 @@ int PINT_decode(void* input_buffer,
gossip_err(" Protocol version mismatch: received major version %d when "
"expecting %d.\n", (int)proto_major_recved,
PVFS2_PROTO_MAJOR);
- gossip_err(" Please verify your PVFS2 installation and make sure "
- "that the version is\n consistent.\n");
+ gossip_err(" Please verify your PVFS2 installation\n");
+ gossip_err(" and make sure that the version is consistent.\n");
return(-PVFS_EPROTONOSUPPORT);
}
@@ -213,8 +214,8 @@ int PINT_decode(void* input_buffer,
"expecting %d or lower.\n", (int)proto_minor_recved,
PVFS2_PROTO_MINOR);
gossip_err(" Client is too new for server.\n");
- gossip_err(" Please verify your PVFS2 installation and make sure "
- "that the version is\n consistent.\n");
+ gossip_err(" Please verify your PVFS2 installation\n");
+ gossip_err(" and make sure that the version is consistent.\n");
return(-PVFS_EPROTONOSUPPORT);
}
@@ -226,8 +227,8 @@ int PINT_decode(void* input_buffer,
"expecting %d or higher.\n", (int)proto_minor_recved,
PVFS2_PROTO_MINOR);
gossip_err(" Server is too old for client.\n");
- gossip_err(" Please verify your PVFS2 installation and make sure "
- "that the version is\n consistent.\n");
+ gossip_err(" Please verify your PVFS2 installation\n");
+ gossip_err(" and make sure that the version is consistent.\n");
return(-PVFS_EPROTONOSUPPORT);
}
@@ -315,6 +316,11 @@ void PINT_decode_release(struct PINT_dec
{
PINT_encoding_table[input_buffer->enc_type]->op->decode_release(
input_buffer, input_type);
+ }
+ else if (input_buffer->enc_type == -1)
+ {
+ /* invalid return from PINT_decode, quietly return */
+ ;
}
else
{
Index: endecode-funcs.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/endecode-funcs.h,v
diff -p -u -r1.20 -r1.20.4.1
--- endecode-funcs.h 26 Sep 2006 03:44:18 -0000 1.20
+++ endecode-funcs.h 23 May 2007 20:49:05 -0000 1.20.4.1
@@ -233,6 +233,29 @@ static inline void decode_##name(char **
#define endecode_fields_5_struct(name, t1, x1, t2, x2, t3, x3, t4, x4, t5, x5) \
endecode_fields_5_generic(name, struct name, t1, x1, t2, x2, t3, x3, t4, x4, t5, x5)
+#define endecode_fields_6_generic(name, sname, t1, x1, t2, x2, t3, x3, t4, x4, t5, x5, t6, x6) \
+static inline void encode_##name(char **pptr, const sname *x) { \
+ encode_##t1(pptr, &x->x1); \
+ encode_##t2(pptr, &x->x2); \
+ encode_##t3(pptr, &x->x3); \
+ encode_##t4(pptr, &x->x4); \
+ encode_##t5(pptr, &x->x5); \
+ encode_##t6(pptr, &x->x6); \
+} \
+static inline void decode_##name(char **pptr, sname *x) { \
+ decode_##t1(pptr, &x->x1); \
+ decode_##t2(pptr, &x->x2); \
+ decode_##t3(pptr, &x->x3); \
+ decode_##t4(pptr, &x->x4); \
+ decode_##t5(pptr, &x->x5); \
+ decode_##t6(pptr, &x->x6); \
+}
+
+#define endecode_fields_6(name, t1, x1, t2, x2, t3, x3, t4, x4, t5, x5, t6, x6) \
+ endecode_fields_6_generic(name, name, t1, x1, t2, x2, t3, x3, t4, x4, t5, x5, t6, x6)
+#define endecode_fields_6_struct(name, t1, x1, t2, x2, t3, x3, t4, x4, t5, x5, t6, x6) \
+ endecode_fields_6_generic(name, struct name, t1, x1, t2, x2, t3, x3, t4, x4, t5, x5, t6, x6)
+
#define endecode_fields_7(name,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7) \
static inline void encode_##name(char **pptr, const name *x) { \
encode_##t1(pptr, &x->x1); \
Index: PINT-le-bytefield.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/PINT-le-bytefield.c,v
diff -p -u -r1.47 -r1.47.6.1
--- PINT-le-bytefield.c 17 Sep 2006 21:31:28 -0000 1.47
+++ PINT-le-bytefield.c 23 May 2007 20:49:05 -0000 1.47.6.1
@@ -434,7 +434,7 @@ static int lebf_encode_resp(
/* we stand a good chance of segfaulting if we try to encode the response
* after something bad happened reading data from disk. */
- if (resp->status != -PVFS_EIO)
+ if (resp->status == 0)
{
/* extra encoding rules for particular responses */
@@ -618,7 +618,7 @@ static int lebf_decode_resp(
decode_PVFS_server_resp(p, resp);
gossip_debug(GOSSIP_ENDECODE_DEBUG,"lebf_decode_resp\n");
- if (resp->status == -PVFS_EIO)
+ if (resp->status != 0)
goto out;
#define CASE(tag,var) \
@@ -795,102 +795,106 @@ static void lebf_decode_rel(struct PINT_
}
} else if (input_type == PINT_DECODE_RESP) {
struct PVFS_server_resp *resp = &msg->stub_dec.resp;
- switch (resp->op) {
- case PVFS_SERV_LOOKUP_PATH:
+ if(resp->status == 0)
+ {
+ switch (resp->op)
{
- struct PVFS_servresp_lookup_path *lookup =
- &resp->u.lookup_path;
- decode_free(lookup->handle_array);
- decode_free(lookup->attr_array);
- break;
- }
-
- case PVFS_SERV_READDIR:
- decode_free(resp->u.readdir.dirent_array);
- break;
-
- case PVFS_SERV_MGMT_PERF_MON:
- decode_free(resp->u.mgmt_perf_mon.perf_array);
- break;
-
- case PVFS_SERV_MGMT_ITERATE_HANDLES:
- decode_free(resp->u.mgmt_iterate_handles.handle_array);
- break;
-
- case PVFS_SERV_MGMT_DSPACE_INFO_LIST:
- decode_free(resp->u.mgmt_dspace_info_list.dspace_info_array);
- break;
-
- case PVFS_SERV_GETATTR:
- if (resp->u.getattr.attr.mask & PVFS_ATTR_META_DIST)
- decode_free(resp->u.getattr.attr.u.meta.dist);
- if (resp->u.getattr.attr.mask & PVFS_ATTR_META_DFILES)
- decode_free(resp->u.getattr.attr.u.meta.dfile_array);
- break;
-
- case PVFS_SERV_MGMT_EVENT_MON:
- decode_free(resp->u.mgmt_event_mon.event_array);
- break;
+ case PVFS_SERV_LOOKUP_PATH:
+ {
+ struct PVFS_servresp_lookup_path *lookup =
+ &resp->u.lookup_path;
+ decode_free(lookup->handle_array);
+ decode_free(lookup->attr_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_LISTEATTR:
- if (resp->u.listeattr.key)
- decode_free(resp->u.listeattr.key);
- break;
- case PVFS_SERV_LISTATTR:
- {
- int i;
- if (resp->u.listattr.error)
- decode_free(resp->u.listattr.error);
- if (resp->u.listattr.attr) {
- for (i = 0; i < resp->u.listattr.nhandles; i++) {
- if (resp->u.listattr.attr[i].mask & PVFS_ATTR_META_DIST)
- decode_free(resp->u.listattr.attr[i].u.meta.dist);
- if (resp->u.listattr.attr[i].mask & PVFS_ATTR_META_DFILES)
- decode_free(resp->u.listattr.attr[i].u.meta.dfile_array);
+ case PVFS_SERV_READDIR:
+ decode_free(resp->u.readdir.dirent_array);
+ break;
+
+ case PVFS_SERV_MGMT_PERF_MON:
+ decode_free(resp->u.mgmt_perf_mon.perf_array);
+ break;
+
+ case PVFS_SERV_MGMT_ITERATE_HANDLES:
+ decode_free(resp->u.mgmt_iterate_handles.handle_array);
+ break;
+
+ case PVFS_SERV_MGMT_DSPACE_INFO_LIST:
+ decode_free(resp->u.mgmt_dspace_info_list.dspace_info_array);
+ break;
+
+ case PVFS_SERV_GETATTR:
+ if (resp->u.getattr.attr.mask & PVFS_ATTR_META_DIST)
+ decode_free(resp->u.getattr.attr.u.meta.dist);
+ if (resp->u.getattr.attr.mask & PVFS_ATTR_META_DFILES)
+ decode_free(resp->u.getattr.attr.u.meta.dfile_array);
+ break;
+
+ case PVFS_SERV_MGMT_EVENT_MON:
+ 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_LISTEATTR:
+ if (resp->u.listeattr.key)
+ decode_free(resp->u.listeattr.key);
+ break;
+ case PVFS_SERV_LISTATTR:
+ {
+ int i;
+ if (resp->u.listattr.error)
+ decode_free(resp->u.listattr.error);
+ if (resp->u.listattr.attr) {
+ for (i = 0; i < resp->u.listattr.nhandles; i++) {
+ if (resp->u.listattr.attr[i].mask & PVFS_ATTR_META_DIST)
+ decode_free(resp->u.listattr.attr[i].u.meta.dist);
+ if (resp->u.listattr.attr[i].mask & PVFS_ATTR_META_DFILES)
+ decode_free(resp->u.listattr.attr[i].u.meta.dfile_array);
+ }
+ decode_free(resp->u.listattr.attr);
+ }
+ break;
}
- decode_free(resp->u.listattr.attr);
- }
- break;
+ case PVFS_SERV_GETCONFIG:
+ case PVFS_SERV_CREATE:
+ case PVFS_SERV_REMOVE:
+ case PVFS_SERV_MGMT_REMOVE_OBJECT:
+ case PVFS_SERV_MGMT_REMOVE_DIRENT:
+ case PVFS_SERV_MGMT_GET_DIRDATA_HANDLE:
+ case PVFS_SERV_IO:
+ case PVFS_SERV_SMALL_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:
+ case PVFS_SERV_TRUNCATE:
+ case PVFS_SERV_MKDIR:
+ case PVFS_SERV_FLUSH:
+ case PVFS_SERV_MGMT_SETPARAM:
+ case PVFS_SERV_MGMT_NOOP:
+ case PVFS_SERV_STATFS:
+ case PVFS_SERV_WRITE_COMPLETION:
+ case PVFS_SERV_PROTO_ERROR:
+ /* nothing to free */
+ break;
+
+ case PVFS_SERV_INVALID:
+ case PVFS_SERV_PERF_UPDATE:
+ case PVFS_SERV_JOB_TIMER:
+ case PVFS_SERV_NUM_OPS: /* sentinel */
+ gossip_lerr("%s: invalid response operation %d.\n",
+ __func__, resp->op);
+ break;
}
- case PVFS_SERV_GETCONFIG:
- case PVFS_SERV_CREATE:
- case PVFS_SERV_REMOVE:
- case PVFS_SERV_MGMT_REMOVE_OBJECT:
- case PVFS_SERV_MGMT_REMOVE_DIRENT:
- case PVFS_SERV_MGMT_GET_DIRDATA_HANDLE:
- case PVFS_SERV_IO:
- case PVFS_SERV_SMALL_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:
- case PVFS_SERV_TRUNCATE:
- case PVFS_SERV_MKDIR:
- case PVFS_SERV_FLUSH:
- case PVFS_SERV_MGMT_SETPARAM:
- case PVFS_SERV_MGMT_NOOP:
- case PVFS_SERV_STATFS:
- case PVFS_SERV_WRITE_COMPLETION:
- case PVFS_SERV_PROTO_ERROR:
- /* nothing to free */
- break;
-
- case PVFS_SERV_INVALID:
- case PVFS_SERV_PERF_UPDATE:
- case PVFS_SERV_JOB_TIMER:
- case PVFS_SERV_NUM_OPS: /* sentinel */
- gossip_lerr("%s: invalid response operation %d.\n",
- __func__, resp->op);
- break;
- }
+ }
}
}
Index: pvfs2-req-proto.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/pvfs2-req-proto.h,v
diff -p -u -r1.147 -r1.147.4.1
--- pvfs2-req-proto.h 26 Sep 2006 03:44:18 -0000 1.147
+++ pvfs2-req-proto.h 23 May 2007 20:49:05 -0000 1.147.4.1
@@ -22,11 +22,11 @@
* compatibility (such as changing the semantics or protocol fields for an
* existing request type)
*/
-#define PVFS2_PROTO_MAJOR 3
+#define PVFS2_PROTO_MAJOR 4
/* update PVFS2_PROTO_MINOR on wire protocol changes that preserve backwards
* compatibility (such as adding a new request type)
*/
-#define PVFS2_PROTO_MINOR 4
+#define PVFS2_PROTO_MINOR 0
#define PVFS2_PROTO_VERSION ((PVFS2_PROTO_MAJOR*1000)+(PVFS2_PROTO_MINOR))
/* we set the maximum possible size of a small I/O packed message as 64K. This
@@ -646,8 +646,8 @@ endecode_fields_4_struct(
PVFS_servreq_readdir,
PVFS_handle, handle,
PVFS_fs_id, fs_id,
- PVFS_ds_position, token,
- uint32_t, dirent_count)
+ uint32_t, dirent_count,
+ PVFS_ds_position, token)
#define PINT_SERVREQ_READDIR_FILL(__req, \
__creds, \
@@ -673,10 +673,9 @@ struct PVFS_servresp_readdir
uint32_t dirent_count; /* # of entries retrieved */
uint64_t directory_version;
};
-endecode_fields_4a_struct(
+endecode_fields_3a_struct(
PVFS_servresp_readdir,
PVFS_ds_position, token,
- skip4,,
uint64_t, directory_version,
skip4,,
uint32_t, dirent_count,
@@ -1217,9 +1216,10 @@ struct PVFS_servresp_mgmt_iterate_handle
PVFS_handle *handle_array;
int handle_count;
};
-endecode_fields_1a_struct(
+endecode_fields_2a_struct(
PVFS_servresp_mgmt_iterate_handles,
PVFS_ds_position, position,
+ skip4,,
int32_t, handle_count,
PVFS_handle, handle_array)
#define extra_size_PVFS_servresp_mgmt_iterate_handles \
@@ -1450,8 +1450,8 @@ endecode_fields_4a_struct(
PVFS_servreq_listeattr,
PVFS_handle, handle,
PVFS_fs_id, fs_id,
- PVFS_ds_position, token,
skip4,,
+ PVFS_ds_position, token,
uint32_t, nkey,
PVFS_size, keysz);
#define extra_size_PVFS_servreq_listeattr \
@@ -1481,9 +1481,10 @@ struct PVFS_servresp_listeattr
uint32_t nkey; /* # of keys retrieved */
PVFS_ds_keyval *key; /* array of keys returned */
};
-endecode_fields_1a_struct(
+endecode_fields_2a_struct(
PVFS_servresp_listeattr,
PVFS_ds_position, token,
+ skip4,,
uint32_t, nkey,
PVFS_ds_keyval, key)
#define extra_size_PVFS_servresp_listeattr \
More information about the Pvfs2-cvs
mailing list