[Pvfs2-cvs] commit by kunkel in pvfs2/src/proto: PINT-le-bytefield.c pvfs2-req-proto.h

CVS commit program cvs at parl.clemson.edu
Sat Aug 19 09:09:38 EDT 2006


Update of /projects/cvsroot/pvfs2/src/proto
In directory parlweb1:/tmp/cvs-serv3901/src/proto

Modified Files:
      Tag: kunkel-branch
	PINT-le-bytefield.c pvfs2-req-proto.h 
Log Message:
Added PVFS-hint, changed tests for pwrite/odirect/transactions/aio dbpf
 support to allow users to explicitly enable or disable the functionality.
In the aio implementation is a bug since somebody else modified it.


Index: PINT-le-bytefield.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/PINT-le-bytefield.c,v
diff -p -u -r1.41.4.2 -r1.41.4.3
--- PINT-le-bytefield.c	24 Jul 2006 17:20:55 -0000	1.41.4.2
+++ PINT-le-bytefield.c	19 Aug 2006 13:09:38 -0000	1.41.4.3
@@ -312,9 +312,12 @@ static int lebf_encode_req(
     struct PINT_encoded_msg *target_msg)
 {
     int ret = 0;
+    int hint_size;
+    hint_size = PINT_hint_calc_size(req->hints);
     char **p;
 
-    ret = encode_common(target_msg, max_size_array[req->op].req);
+    ret = encode_common(target_msg, max_size_array[req->op].req + 
+        hint_size);
 
     if (ret)
 	goto out;
@@ -380,11 +383,11 @@ static int lebf_encode_req(
       - (char *) target_msg->buffer_list[0];
     target_msg->size_list[0] = target_msg->total_size;
 
-    if (target_msg->total_size > max_size_array[req->op].req)
+    if (target_msg->total_size > max_size_array[req->op].req + hint_size)
     {
 	ret = -PVFS_ENOMEM;
 	gossip_err("%s: op %d needed %lld bytes but alloced only %d\n",
-	  __func__, req->op, lld(target_msg->total_size),
+	  __func__, req->op, lld(target_msg->total_size+hint_size),
 	  max_size_array[req->op].req);
     }
 

Index: pvfs2-req-proto.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/pvfs2-req-proto.h,v
diff -p -u -r1.140.4.2 -r1.140.4.3
--- pvfs2-req-proto.h	18 Aug 2006 05:12:16 -0000	1.140.4.2
+++ pvfs2-req-proto.h	19 Aug 2006 13:09:38 -0000	1.140.4.3
@@ -10,6 +10,8 @@
 #ifndef __PVFS2_REQ_PROTO_H
 #define __PVFS2_REQ_PROTO_H
 
+#include <assert.h>
+
 #include "pvfs2-config.h"
 #include "pvfs2-types.h"
 #include "pvfs2-attr.h"
@@ -22,7 +24,7 @@
  * compatibility (such as changing the semantics or protocol fields for an
  * existing request type)
  */
-#define PVFS2_PROTO_MAJOR 2
+#define PVFS2_PROTO_MAJOR 3
 /* update PVFS2_PROTO_MINOR on wire protocol changes that preserve backwards
  * compatibility (such as adding a new request type)
  */
@@ -176,10 +178,12 @@ endecode_fields_3_struct(
                                  __creds,              \
                                  __fsid,               \
                                  __objtype,            \
-                                 __ext_array)          \
+                                 __ext_array,          \
+                                 __hints)              \
 do {                                                   \
     memset(&(__req), 0, sizeof(__req));                \
     (__req).op = PVFS_SERV_CREATE;                     \
+    (__req).hints = (__hints);                         \
     (__req).credentials = (__creds);                   \
     (__req).u.create.fs_id = (__fsid);                 \
     (__req).u.create.object_type = (__objtype);        \
@@ -213,10 +217,12 @@ endecode_fields_2_struct(
 #define PINT_SERVREQ_REMOVE_FILL(__req,   \
                                  __creds, \
                                  __fsid,  \
-                                 __handle)\
+                                 __handle,\
+                                 __hints) \
 do {                                      \
     memset(&(__req), 0, sizeof(__req));   \
     (__req).op = PVFS_SERV_REMOVE;        \
+    (__req).hints = (__hints);            \
     (__req).credentials = (__creds);      \
     (__req).u.remove.fs_id = (__fsid);    \
     (__req).u.remove.handle = (__handle); \
@@ -238,10 +244,12 @@ endecode_fields_2_struct(
 #define PINT_SERVREQ_MGMT_REMOVE_OBJECT_FILL(__req,   \
                                              __creds, \
                                              __fsid,  \
-                                             __handle)\
+                                             __handle,\
+                                             __hints) \
 do {                                                  \
     memset(&(__req), 0, sizeof(__req));               \
     (__req).op = PVFS_SERV_MGMT_REMOVE_OBJECT;        \
+    (__req).hints = (__hints);                        \
     (__req).credentials = (__creds);                  \
     (__req).u.mgmt_remove_object.fs_id = (__fsid);    \
     (__req).u.mgmt_remove_object.handle = (__handle); \
@@ -269,10 +277,12 @@ endecode_fields_4_struct(
                                              __creds, \
                                              __fsid,  \
                                              __handle,\
-                                             __entry) \
+                                             __entry, \
+                                             __hints) \
 do {                                                  \
     memset(&(__req), 0, sizeof(__req));               \
     (__req).op = PVFS_SERV_MGMT_REMOVE_DIRENT;        \
+    (__req).hints = (__hints);                        \
     (__req).credentials = (__creds);                  \
     (__req).u.mgmt_remove_dirent.fs_id = (__fsid);    \
     (__req).u.mgmt_remove_dirent.handle = (__handle); \
@@ -294,11 +304,13 @@ endecode_fields_2_struct(
 #define PINT_SERVREQ_MGMT_GET_DIRDATA_HANDLE_FILL(__req,   \
                                                   __creds, \
                                                   __fsid,  \
-                                                  __handle)\
+                                                  __handle,\
+                                                  __hints) \
 do {                                                       \
     memset(&(__req), 0, sizeof(__req));                    \
     (__req).op = PVFS_SERV_MGMT_GET_DIRDATA_HANDLE;        \
     (__req).credentials = (__creds);                       \
+    (__req).hints = (__hints);                             \
     (__req).u.mgmt_get_dirdata_handle.fs_id = (__fsid);    \
     (__req).u.mgmt_get_dirdata_handle.handle = (__handle); \
 } while (0)
@@ -328,11 +340,13 @@ endecode_fields_3_struct(
 #define PINT_SERVREQ_FLUSH_FILL(__req,   \
                                 __creds, \
                                 __fsid,  \
-                                __handle)\
+                                __handle,\
+                                __hints )\
 do {                                     \
     memset(&(__req), 0, sizeof(__req));  \
     (__req).op = PVFS_SERV_FLUSH;        \
     (__req).credentials = (__creds);     \
+    (__req).hints = (__hints);           \
     (__req).u.flush.fs_id = (__fsid);    \
     (__req).u.flush.handle = (__handle); \
 } while (0)
@@ -356,11 +370,13 @@ endecode_fields_3_struct(
                                   __creds, \
                                   __fsid,  \
                                   __handle,\
-                                  __amask) \
+                                  __amask, \
+                                  __hints) \
 do {                                       \
     memset(&(__req), 0, sizeof(__req));    \
     (__req).op = PVFS_SERV_GETATTR;        \
     (__req).credentials = (__creds);       \
+    (__req).hints = (__hints);             \
     (__req).u.getattr.fs_id = (__fsid);    \
     (__req).u.getattr.handle = (__handle); \
     (__req).u.getattr.attrmask = (__amask);\
@@ -400,11 +416,13 @@ endecode_fields_4_struct(
                                   __handle,      \
                                   __objtype,     \
                                   __attr,        \
-                                  __extra_amask) \
+                                  __extra_amask, \
+                                  __hints)       \
 do {                                             \
     memset(&(__req), 0, sizeof(__req));          \
     (__req).op = PVFS_SERV_SETATTR;              \
     (__req).credentials = (__creds);             \
+    (__req).hints = (__hints);                   \
     (__req).u.setattr.fs_id = (__fsid);          \
     (__req).u.setattr.handle = (__handle);       \
     (__attr).objtype = (__objtype);              \
@@ -438,11 +456,13 @@ endecode_fields_5_struct(
                                       __path,          \
                                       __fsid,          \
                                       __handle,        \
-                                      __amask)         \
+                                      __amask,         \
+                                      __hints)         \
 do {                                                   \
     memset(&(__req), 0, sizeof(__req));                \
     (__req).op = PVFS_SERV_LOOKUP_PATH;                \
     (__req).credentials = (__creds);                   \
+    (__req).hints = (__hints);                         \
     (__req).u.lookup_path.path = (__path);             \
     (__req).u.lookup_path.fs_id = (__fsid);            \
     (__req).u.lookup_path.starting_handle = (__handle);\
@@ -500,11 +520,13 @@ endecode_fields_4_struct(
                                 __creds,               \
                                 __fs_id,               \
                                 __ext_array,           \
-                                __attr)                \
+                                __attr,                \
+                                __hints)               \
 do {                                                   \
     memset(&(__req), 0, sizeof(__req));                \
     (__req).op = PVFS_SERV_MKDIR;                      \
     (__req).credentials = (__creds);                   \
+    (__req).hints = (__hints);                         \
     (__req).u.mkdir.fs_id = __fs_id;                   \
     (__req).u.mkdir.handle_extent_array.extent_count = \
         (__ext_array).extent_count;                    \
@@ -547,11 +569,13 @@ endecode_fields_4_struct(
                                    __name,          \
                                    __new_handle,    \
                                    __parent_handle, \
-                                   __fs_id)         \
+                                   __fs_id,         \
+                                   __hints)         \
 do {                                                \
     memset(&(__req), 0, sizeof(__req));             \
     (__req).op = PVFS_SERV_CRDIRENT;                \
     (__req).credentials = (__creds);                \
+    (__req).hints = (__hints);                      \
     (__req).u.crdirent.name = (__name);             \
     (__req).u.crdirent.new_handle = (__new_handle); \
     (__req).u.crdirent.parent_handle =              \
@@ -580,11 +604,13 @@ endecode_fields_3_struct(
                                    __creds,       \
                                    __fsid,        \
                                    __handle,      \
-                                   __entry)       \
+                                   __entry,       \
+                                   __hints)       \
 do {                                              \
     memset(&(__req), 0, sizeof(__req));           \
     (__req).op = PVFS_SERV_RMDIRENT;              \
     (__req).credentials = (__creds);              \
+    (__req).hints = (__hints);                    \
     (__req).u.rmdirent.fs_id = (__fsid);          \
     (__req).u.rmdirent.parent_handle = (__handle);\
     (__req).u.rmdirent.entry = (__entry);         \
@@ -622,11 +648,13 @@ endecode_fields_4_struct(
                                    __fsid,         \
                                    __parent_handle,\
                                    __new_dirent,   \
-                                   __entry)        \
+                                   __entry,        \
+                                   __hints)        \
 do {                                               \
     memset(&(__req), 0, sizeof(__req));            \
     (__req).op = PVFS_SERV_CHDIRENT;               \
     (__req).credentials = (__creds);               \
+    (__req).hints = (__hints);                     \
     (__req).u.chdirent.fs_id = (__fsid);           \
     (__req).u.chdirent.parent_handle =             \
         (__parent_handle);                         \
@@ -665,11 +693,13 @@ endecode_fields_4_struct(
                                   __fsid,             \
                                   __handle,           \
                                   __token,            \
-                                  __dirent_count)     \
+                                  __dirent_count,     \
+                                  __hints)            \
 do {                                                  \
     memset(&(__req), 0, sizeof(__req));               \
     (__req).op = PVFS_SERV_READDIR;                   \
     (__req).credentials = (__creds);                  \
+    (__req).hints = (__hints);                        \
     (__req).u.readdir.fs_id = (__fsid);               \
     (__req).u.readdir.handle = (__handle);            \
     (__req).u.readdir.token = (__token);              \
@@ -698,10 +728,11 @@ endecode_fields_4a_struct(
 /* getconfig ***************************************************/
 /* - retrieves initial configuration information from server */
 
-#define PINT_SERVREQ_GETCONFIG_FILL(__req, __creds)\
+#define PINT_SERVREQ_GETCONFIG_FILL(__req, __creds, __hints)\
 do {                                               \
     memset(&(__req), 0, sizeof(__req));            \
     (__req).op = PVFS_SERV_GETCONFIG;              \
+    (__req).hints = (__hints);                     \
     (__req).credentials = (__creds);               \
 } while (0);
 
@@ -743,11 +774,13 @@ endecode_fields_5_struct(
                                 __creds,   \
                                 __fsid,    \
                                 __size,    \
-                                __handle)  \
+                                __handle,  \
+                                __hints)   \
 do {                                       \
     memset(&(__req), 0, sizeof(__req));    \
     (__req).op = PVFS_SERV_TRUNCATE;       \
     (__req).credentials = (__creds);       \
+    (__req).hints = (__hints);             \
     (__req).u.truncate.fs_id = (__fsid);   \
     (__req).u.truncate.size = (__size);    \
     (__req).u.truncate.handle = (__handle);\
@@ -764,11 +797,12 @@ endecode_fields_1_struct(
     PVFS_servreq_statfs,
     PVFS_fs_id, fs_id)
 
-#define PINT_SERVREQ_STATFS_FILL(__req, __creds, __fsid)\
+#define PINT_SERVREQ_STATFS_FILL(__req, __creds, __fsid,__hints)\
 do {                                                    \
     memset(&(__req), 0, sizeof(__req));                 \
     (__req).op = PVFS_SERV_STATFS;                      \
     (__req).credentials = (__creds);                    \
+    (__req).hints = (__hints);                          \
     (__req).u.statfs.fs_id = (__fsid);                  \
 } while (0)
 
@@ -851,11 +885,13 @@ struct PVFS_servreq_io
                              __io_dist,               \
                              __file_req,              \
                              __file_req_off,          \
-                             __aggregate_size)        \
+                             __aggregate_size,        \
+                             __hints)                 \
 do {                                                  \
     memset(&(__req), 0, sizeof(__req));               \
     (__req).op                 = PVFS_SERV_IO;        \
     (__req).credentials        = (__creds);           \
+    (__req).hints              = (__hints);           \
     (__req).u.io.fs_id         = (__fsid);            \
     (__req).u.io.handle        = (__handle);          \
     (__req).u.io.io_type       = (__io_type);         \
@@ -977,11 +1013,13 @@ struct PVFS_servreq_small_io
                                    __filereq,                            \
                                    __filereq_offset,                     \
                                    __segments,                           \
-                                   __memreq_size)                        \
+                                   __memreq_size,                        \
+                                   __hints )                             \
 do {                                                                     \
     int _sio_i;                                                          \
     (__req).op                                = PVFS_SERV_SMALL_IO;      \
     (__req).credentials                       = (__creds);               \
+    (__req).hints = (__hints);                                           \
     (__req).u.small_io.fs_id                  = (__fsid);                \
     (__req).u.small_io.handle                 = (__handle);              \
     (__req).u.small_io.io_type                = (__io_type);             \
@@ -1063,11 +1101,13 @@ endecode_fields_3_struct(
                                         __creds,\
                                         __fsid, \
                                         __param,\
-                                        __value)\
+                                        __value,\
+                                        __hints)\
 do {                                            \
     memset(&(__req), 0, sizeof(__req));         \
     (__req).op = PVFS_SERV_MGMT_SETPARAM;       \
     (__req).credentials = (__creds);            \
+    (__req).hints = (__hints);                  \
     (__req).u.mgmt_setparam.fs_id = (__fsid);   \
     (__req).u.mgmt_setparam.param = (__param);  \
     (__req).u.mgmt_setparam.value = (__value);  \
@@ -1086,11 +1126,12 @@ endecode_fields_1_struct(
  * to requests
  */
 
-#define PINT_SERVREQ_MGMT_NOOP_FILL(__req, __creds)\
+#define PINT_SERVREQ_MGMT_NOOP_FILL(__req, __creds, __hints)\
 do {                                               \
     memset(&(__req), 0, sizeof(__req));            \
     (__req).op = PVFS_SERV_MGMT_NOOP;              \
     (__req).credentials = (__creds);               \
+    (__req).hints = (__hints);                     \
 } while (0)
 
 
@@ -1110,11 +1151,13 @@ endecode_fields_2_struct(
 #define PINT_SERVREQ_MGMT_PERF_MON_FILL(__req,    \
                                         __creds,  \
                                         __next_id,\
-                                        __count)  \
+                                        __count,  \
+                                        __hints)  \
 do {                                              \
     memset(&(__req), 0, sizeof(__req));           \
     (__req).op = PVFS_SERV_MGMT_PERF_MON;         \
     (__req).credentials = (__creds);              \
+    (__req).hints = (__hints);                    \
     (__req).u.mgmt_perf_mon.next_id = (__next_id);\
     (__req).u.mgmt_perf_mon.count = (__count);    \
 } while (0)
@@ -1159,11 +1202,13 @@ endecode_fields_3_struct(
                                         __creds,                   \
                                         __fs_id,                   \
                                         __handle_count,            \
-                                        __position)                \
+                                        __position,                \
+                                        __hints)                   \
 do {                                                               \
     memset(&(__req), 0, sizeof(__req));                            \
     (__req).op = PVFS_SERV_MGMT_ITERATE_HANDLES;                   \
     (__req).credentials = (__creds);                               \
+    (__req).hints = (__hints);                                     \
     (__req).u.mgmt_iterate_handles.fs_id = (__fs_id);              \
     (__req).u.mgmt_iterate_handles.handle_count = (__handle_count);\
     (__req).u.mgmt_iterate_handles.position = (__position);        \
@@ -1239,11 +1284,12 @@ endecode_fields_1_struct(
     PVFS_servreq_mgmt_event_mon,
     uint32_t, event_count)
 
-#define PINT_SERVREQ_MGMT_EVENT_MON_FILL(__req, __creds, __event_count)\
+#define PINT_SERVREQ_MGMT_EVENT_MON_FILL(__req, __creds, __event_count, __hints)\
 do {                                                                   \
     memset(&(__req), 0, sizeof(__req));                                \
     (__req).op = PVFS_SERV_MGMT_EVENT_MON;                             \
     (__req).credentials = (__creds);                                   \
+    (__req).hints = (__hints);                                         \
     (__req).u.mgmt_event_mon.event_count = (__event_count);            \
 } while (0)
 
@@ -1288,14 +1334,16 @@ endecode_fields_2aa_struct(
                                   __handle,\
                                   __nkey,\
                                   __key_array, \
-                                  __size_array) \
+                                  __size_array,\
+                                  __hints) \
 do {                                       \
     memset(&(__req), 0, sizeof(__req));    \
-    (__req).op = PVFS_SERV_GETEATTR;        \
+    (__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).hints = (__hints);             \
+    (__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)
@@ -1348,11 +1396,13 @@ endecode_fields_4aa_struct(
                                   __flags,       \
                                   __nkey,        \
                                   __key_array,   \
-                                  __val_array)   \
+                                  __val_array,   \
+                                  __hints)       \
 do {                                             \
     memset(&(__req), 0, sizeof(__req));          \
     (__req).op = PVFS_SERV_SETEATTR;        \
-    (__req).credentials = (__creds);             \
+    (__req).credentials = (__creds);        \
+    (__req).hints = (__hints);              \
     (__req).u.seteattr.fs_id = (__fsid);    \
     (__req).u.seteattr.handle = (__handle); \
     (__req).u.seteattr.flags = (__flags);   \
@@ -1382,11 +1432,13 @@ endecode_fields_3_struct(
                                   __creds, \
                                   __fsid,  \
                                   __handle,\
-                                  __key) \
+                                  __key,   \
+                                  __hints) \
 do {                                       \
     memset(&(__req), 0, sizeof(__req));    \
     (__req).op = PVFS_SERV_DELEATTR;        \
     (__req).credentials = (__creds);       \
+    (__req).hints = (__hints);             \
     (__req).u.deleattr.fs_id = (__fsid);    \
     (__req).u.deleattr.handle = (__handle); \
     (__req).u.deleattr.key.buffer_sz = (__key).buffer_sz;\
@@ -1421,11 +1473,13 @@ endecode_fields_4a_struct(
                                   __handle,           \
                                   __token,            \
                                   __nkey,             \
-                                  __size_array)       \
+                                  __size_array,       \
+                                  __hints)            \
 do {                                                  \
     memset(&(__req), 0, sizeof(__req));               \
     (__req).op = PVFS_SERV_LISTEATTR;                 \
     (__req).credentials = (__creds);                  \
+    (__req).hints = (__hints);                        \
     (__req).u.listeattr.fs_id = (__fsid);             \
     (__req).u.listeattr.handle = (__handle);          \
     (__req).u.listeattr.token = (__token);            \
@@ -1455,6 +1509,8 @@ struct PVFS_server_req
 {
     enum PVFS_server_op op;
     PVFS_credentials credentials;
+    PVFS_hint * hints;
+    
     union
     {
         struct PVFS_servreq_create create;
@@ -1490,15 +1546,25 @@ struct PVFS_server_req
 /* insert padding to ensure the union starts on an aligned boundary */
 static inline void
 encode_PVFS_server_req(char **pptr, const struct PVFS_server_req *x) {
+    int count;
+    int ret;
     encode_enum(pptr, &x->op);
     *pptr += 4;
     encode_PVFS_credentials(pptr, &x->credentials);
+    ret = PINT_hint_encode(x->hints, *pptr, & count, MAX_HINT_LENGTH);
+    assert(ret == 0);
+    *pptr +=count;
 }
 static inline void
 decode_PVFS_server_req(char **pptr, struct PVFS_server_req *x) {
+    int count;
+    int ret;    
     decode_enum(pptr, &x->op);
     *pptr += 4;
     decode_PVFS_credentials(pptr, &x->credentials);
+    ret = PINT_hint_decode(& x->hints, *pptr, & count);
+    assert(ret == 0);
+    *pptr +=count;
 }
 #endif
 



More information about the Pvfs2-cvs mailing list