[Pvfs2-cvs] commit by mtmoore in pvfs2/src/proto:
PINT-le-bytefield.c endecode-funcs.h pvfs2-req-proto.h
CVS commit program
cvs at parl.clemson.edu
Mon Aug 10 11:30:13 EDT 2009
Update of /projects/cvsroot/pvfs2/src/proto
In directory parlweb1:/tmp/cvs-serv10659/pvfs2/src/proto
Modified Files:
Tag: Orange-mtmoore
PINT-le-bytefield.c endecode-funcs.h pvfs2-req-proto.h
Log Message:
Merge range query changes and other fixes
Index: PINT-le-bytefield.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/PINT-le-bytefield.c,v
diff -p -u -r1.58.10.2.4.1 -r1.58.10.2.4.2
--- PINT-le-bytefield.c 14 Jul 2009 17:19:43 -0000 1.58.10.2.4.1
+++ PINT-le-bytefield.c 10 Aug 2009 15:30:11 -0000 1.58.10.2.4.2
@@ -265,7 +265,10 @@ static void lebf_initialize(void)
case PVFS_SERV_GETVALUE:
req.u.getvalue.key.buffer_sz = 0;
req.u.getvalue.val.buffer_sz = 0;
- resp.u.getvalue.token = 1;
+ req.u.getvalue.count = 0;
+ resp.u.getvalue.count = 0;
+ resp.u.getvalue.match_count = 0;
+ resp.u.getvalue.token = 0;
reqsize = extra_size_PVFS_servreq_getvalue;
respsize = extra_size_PVFS_servresp_getvalue;
break;
Index: endecode-funcs.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/endecode-funcs.h,v
diff -p -u -r1.24 -r1.24.24.1
--- endecode-funcs.h 20 Nov 2008 01:17:09 -0000 1.24
+++ endecode-funcs.h 10 Aug 2009 15:30:12 -0000 1.24.24.1
@@ -705,6 +705,36 @@ static inline void decode_##name(char **
decode_##ta2(pptr, &(x)->a2[i]); \
}
+/* special case, 3 fields then 3 arrays */
+#define endecode_fields_3aaa_struct(name, t1, x1, t2, x2, t3, x3, tn1, n1, ta1, a1, ta2, a2, ta3, a3) \
+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]); \
+ for (i=0; i<x->n1; i++) \
+ encode_##ta3(pptr, &(x)->a3[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)); \
+ x->a2 = decode_malloc(x->n1 * sizeof(*x->a2)); \
+ x->a3 = decode_malloc(x->n1 * sizeof(*x->a3)); \
+ for (i=0; i<x->n1; i++) \
+ decode_##ta1(pptr, &(x)->a1[i]); \
+ for (i=0; i<x->n1; i++) \
+ decode_##ta2(pptr, &(x)->a2[i]); \
+ for (i=0; i<x->n1; i++) \
+ decode_##ta3(pptr, &(x)->a3[i]); \
+}
+
/* 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; \
Index: pvfs2-req-proto.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/pvfs2-req-proto.h,v
diff -p -u -r1.159.8.1.10.1 -r1.159.8.1.10.2
--- pvfs2-req-proto.h 14 Jul 2009 17:19:43 -0000 1.159.8.1.10.1
+++ pvfs2-req-proto.h 10 Aug 2009 15:30:12 -0000 1.159.8.1.10.2
@@ -1819,16 +1819,20 @@ endecode_fields_2a_struct(
struct PVFS_servreq_getvalue
{
- PVFS_handle handle; /* handle */
- PVFS_fs_id fs_id; /* file system */
- PVFS_ds_position token; /* offset */
- PVFS_ds_keyval key; /* attribute to search on*/
- PVFS_ds_keyval val; /* (optional) value to search on*/
+ PVFS_handle handle; /* handle */
+ PVFS_fs_id fs_id; /* file system */
+ uint32_t query_type; /* type of query to perform */
+ uint32_t count; /* number of records to return */
+ PVFS_ds_position token; /* offset */
+ PVFS_ds_keyval key; /* attribute */
+ PVFS_ds_keyval val; /* (optional) value */
};
-endecode_fields_5_struct(
+endecode_fields_7_struct(
PVFS_servreq_getvalue,
- PVFS_fs_id, fs_id,
PVFS_handle, handle,
+ PVFS_fs_id, fs_id,
+ uint32_t, query_type,
+ uint32_t, count,
PVFS_ds_position, token,
PVFS_ds_keyval, key,
PVFS_ds_keyval, val)
@@ -1838,6 +1842,8 @@ endecode_fields_5_struct(
#define PINT_SERVREQ_GETVALUE_FILL(__req, \
__creds, \
__fsid, \
+ __query_type, \
+ __count, \
__handle, \
__token, \
__key, \
@@ -1849,6 +1855,8 @@ do {
(__req).credentials = (__creds); \
(__req).hints = (__hints); \
(__req).u.getvalue.fs_id = (__fsid); \
+ (__req).u.getvalue.query_type = (__query_type); \
+ (__req).u.getvalue.count = (__count); \
(__req).u.getvalue.handle = (__handle); \
(__req).u.getvalue.token = (__token); \
(__req).u.getvalue.key.buffer_sz = (__key).buffer_sz;\
@@ -1860,18 +1868,24 @@ do {
struct PVFS_servresp_getvalue
{
PVFS_ds_position token; /* new offset in query */
- PVFS_dirent dirent; /* array with handle info */
- PVFS_ds_keyval key; /* key returned */
- PVFS_ds_keyval val; /* key returned */
+ uint32_t count; /* number of items returned in response */
+ uint32_t match_count; /* number of items (estimate) matching query */
+ PVFS_dirent *dirent; /* array with handle info */
+ PVFS_ds_keyval *key; /* key returned */
+ PVFS_ds_keyval *val; /* key returned */
};
-endecode_fields_4_struct(
+endecode_fields_3aaa_struct(
PVFS_servresp_getvalue,
PVFS_ds_position, token,
+ uint32_t, match_count,
+ skip4,,
+ uint32_t, count,
PVFS_dirent, dirent,
PVFS_ds_keyval, key,
PVFS_ds_keyval, val)
#define extra_size_PVFS_servresp_getvalue \
- (PVFS_REQ_LIMIT_KEY_LEN + PVFS_REQ_LIMIT_VAL_LEN)
+ ((PVFS_REQ_LIMIT_KEY_LEN + PVFS_REQ_LIMIT_VAL_LEN + sizeof(PVFS_dirent)) * \
+ PVFS_REQ_LIMIT_KEYVAL_LIST)
/* server request *********************************************/
/* - generic request with union of all op specific structs */
More information about the Pvfs2-cvs
mailing list