[Pvfs2-cvs] commit by pcarns in pvfs2-1/src/proto: PINT-le-bytefield.c endecode-funcs.h pvfs2-attr.h pvfs2-req-proto.h

CVS commit program cvs at parl.clemson.edu
Mon Sep 8 11:42:48 EDT 2008


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

Modified Files:
	PINT-le-bytefield.c endecode-funcs.h pvfs2-attr.h 
	pvfs2-req-proto.h 
Log Message:
Merging small files branch to head.  Includes server side precreation of
data files and file stuffing.


Index: PINT-le-bytefield.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/proto/PINT-le-bytefield.c,v
diff -p -u -r1.53 -r1.54
--- PINT-le-bytefield.c	3 Mar 2008 19:05:56 -0000	1.53
+++ PINT-le-bytefield.c	8 Sep 2008 15:42:48 -0000	1.54
@@ -87,6 +87,7 @@ static void lebf_initialize(void)
 	switch (op_type) {
 	    case PVFS_SERV_INVALID:
 	    case PVFS_SERV_PERF_UPDATE:
+	    case PVFS_SERV_PRECREATE_POOL_REFILLER:
 	    case PVFS_SERV_JOB_TIMER:
 		/* never used, skip initialization */
 		continue;
@@ -101,14 +102,26 @@ static void lebf_initialize(void)
 		reqsize = extra_size_PVFS_servreq_lookup_path;
 		respsize = extra_size_PVFS_servresp_lookup_path;
 		break;
+	    case PVFS_SERV_BATCH_CREATE:
+		/* can request a range of handles */
+		req.u.batch_create.handle_extent_array.extent_count = 0;
+		req.u.batch_create.object_count = 0;
+		resp.u.batch_create.handle_count = 0;
+		reqsize = extra_size_PVFS_servreq_batch_create;
+		respsize = extra_size_PVFS_servresp_batch_create;
+		break;
 	    case PVFS_SERV_CREATE:
 		/* can request a range of handles */
-		req.u.create.handle_extent_array.extent_count = 0;
 		reqsize = extra_size_PVFS_servreq_create;
-		break;
+                respsize = extra_size_PVFS_servresp_create;
 	    case PVFS_SERV_REMOVE:
 		/* nothing special, let normal encoding work */
 		break;
+	    case PVFS_SERV_BATCH_REMOVE:
+		req.u.batch_remove.handles = NULL;
+		req.u.batch_remove.handle_count = 0;
+		reqsize = extra_size_PVFS_servreq_batch_remove;
+		break;
 	    case PVFS_SERV_MGMT_REMOVE_OBJECT:
 		/* nothing special, let normal encoding work */
 		break;
@@ -131,6 +144,10 @@ static void lebf_initialize(void)
 		resp.u.getattr.attr.mask = 0;
 		respsize = extra_size_PVFS_servresp_getattr;
 		break;
+	    case PVFS_SERV_UNSTUFF:
+		resp.u.unstuff.attr.mask = 0;
+		respsize = extra_size_PVFS_servresp_getattr;
+		break;
 	    case PVFS_SERV_SETATTR:
 		req.u.setattr.attr.mask = 0;
 		reqsize = extra_size_PVFS_servreq_setattr;
@@ -353,6 +370,9 @@ static int lebf_encode_req(
 	/* call standard function defined in headers */
 	CASE(PVFS_SERV_LOOKUP_PATH, lookup_path);
 	CASE(PVFS_SERV_CREATE, create);
+        CASE(PVFS_SERV_UNSTUFF, unstuff);
+	CASE(PVFS_SERV_BATCH_CREATE, batch_create);
+        CASE(PVFS_SERV_BATCH_REMOVE, batch_remove);
 	CASE(PVFS_SERV_REMOVE, remove);
 	CASE(PVFS_SERV_MGMT_REMOVE_OBJECT, mgmt_remove_object);
 	CASE(PVFS_SERV_MGMT_REMOVE_DIRENT, mgmt_remove_dirent);
@@ -389,6 +409,7 @@ static int lebf_encode_req(
 	case PVFS_SERV_INVALID:
         case PVFS_SERV_WRITE_COMPLETION:
         case PVFS_SERV_PERF_UPDATE:
+        case PVFS_SERV_PRECREATE_POOL_REFILLER:
         case PVFS_SERV_JOB_TIMER:
         case PVFS_SERV_NUM_OPS:  /* sentinel */
 	    gossip_err("%s: invalid operation %d\n", __func__, req->op);
@@ -454,6 +475,8 @@ static int lebf_encode_resp(
         CASE(PVFS_SERV_GETCONFIG, getconfig);
         CASE(PVFS_SERV_LOOKUP_PATH, lookup_path);
         CASE(PVFS_SERV_CREATE, create);
+        CASE(PVFS_SERV_UNSTUFF, unstuff);
+        CASE(PVFS_SERV_BATCH_CREATE, batch_create);
         CASE(PVFS_SERV_IO, io);
         CASE(PVFS_SERV_SMALL_IO, small_io);
         CASE(PVFS_SERV_GETATTR, getattr);
@@ -483,12 +506,14 @@ static int lebf_encode_resp(
         case PVFS_SERV_TRUNCATE:
         case PVFS_SERV_FLUSH:
         case PVFS_SERV_MGMT_NOOP:
+        case PVFS_SERV_BATCH_REMOVE:
         case PVFS_SERV_PROTO_ERROR:
             /* nothing else */
             break;
 
         case PVFS_SERV_INVALID:
         case PVFS_SERV_PERF_UPDATE:
+        case PVFS_SERV_PRECREATE_POOL_REFILLER:
         case PVFS_SERV_JOB_TIMER:
         case PVFS_SERV_NUM_OPS:  /* sentinel */
             gossip_err("%s: invalid operation %d\n", __func__, resp->op);
@@ -549,6 +574,9 @@ static int lebf_decode_req(
 	/* call standard function defined in headers */
 	CASE(PVFS_SERV_LOOKUP_PATH, lookup_path);
 	CASE(PVFS_SERV_CREATE, create);
+        CASE(PVFS_SERV_UNSTUFF, unstuff);
+	CASE(PVFS_SERV_BATCH_CREATE, batch_create);
+        CASE(PVFS_SERV_BATCH_REMOVE, batch_remove);
 	CASE(PVFS_SERV_REMOVE, remove);
 	CASE(PVFS_SERV_MGMT_REMOVE_OBJECT, mgmt_remove_object);
 	CASE(PVFS_SERV_MGMT_REMOVE_DIRENT, mgmt_remove_dirent);
@@ -584,6 +612,7 @@ static int lebf_decode_req(
 	case PVFS_SERV_INVALID:
         case PVFS_SERV_WRITE_COMPLETION:
         case PVFS_SERV_PERF_UPDATE:
+        case PVFS_SERV_PRECREATE_POOL_REFILLER:
         case PVFS_SERV_JOB_TIMER:
 	case PVFS_SERV_PROTO_ERROR:
         case PVFS_SERV_NUM_OPS:  /* sentinel */
@@ -640,6 +669,8 @@ static int lebf_decode_resp(
 	CASE(PVFS_SERV_GETCONFIG, getconfig);
 	CASE(PVFS_SERV_LOOKUP_PATH, lookup_path);
 	CASE(PVFS_SERV_CREATE, create);
+        CASE(PVFS_SERV_UNSTUFF, unstuff);
+	CASE(PVFS_SERV_BATCH_CREATE, batch_create);
 	CASE(PVFS_SERV_IO, io);
         CASE(PVFS_SERV_SMALL_IO, small_io);
 	CASE(PVFS_SERV_GETATTR, getattr);
@@ -660,6 +691,7 @@ static int lebf_decode_resp(
         CASE(PVFS_SERV_LISTATTR, listattr);
 
         case PVFS_SERV_REMOVE:
+        case PVFS_SERV_BATCH_REMOVE:
         case PVFS_SERV_MGMT_REMOVE_OBJECT:
         case PVFS_SERV_MGMT_REMOVE_DIRENT:
         case PVFS_SERV_SETATTR:
@@ -675,6 +707,7 @@ static int lebf_decode_resp(
 
 	case PVFS_SERV_INVALID:
         case PVFS_SERV_PERF_UPDATE:
+        case PVFS_SERV_PRECREATE_POOL_REFILLER:
         case PVFS_SERV_JOB_TIMER:
         case PVFS_SERV_NUM_OPS:  /* sentinel */
 	    gossip_lerr("%s: invalid operation %d.\n", __func__, resp->op);
@@ -731,9 +764,13 @@ static void lebf_decode_rel(struct PINT_
     if (input_type == PINT_DECODE_REQ) {
 	struct PVFS_server_req *req = &msg->stub_dec.req;
 	switch (req->op) {
-
 	    case PVFS_SERV_CREATE:
-		decode_free(req->u.create.handle_extent_array.extent_array);
+		if (req->u.create.attr.mask & PVFS_ATTR_META_DIST)
+		    decode_free(req->u.create.attr.u.meta.dist);
+                if (req->u.create.layout.server_list.servers)
+                    decode_free(req->u.create.layout.server_list.servers);
+	    case PVFS_SERV_BATCH_CREATE:
+		decode_free(req->u.batch_create.handle_extent_array.extent_array);
 		break;
 
 	    case PVFS_SERV_IO:
@@ -758,7 +795,7 @@ static void lebf_decode_rel(struct PINT_
 		decode_free(req->u.mgmt_dspace_info_list.handle_array);
 		break;
 
-	    case PVFS_SERV_SETATTR:
+            case PVFS_SERV_SETATTR:
 		if (req->u.setattr.attr.mask & PVFS_ATTR_META_DIST)
 		    decode_free(req->u.setattr.attr.u.meta.dist);
 		if (req->u.setattr.attr.mask & PVFS_ATTR_META_DFILES)
@@ -791,11 +828,14 @@ static void lebf_decode_rel(struct PINT_
 	    case PVFS_SERV_SETEATTR:
 	    case PVFS_SERV_DELEATTR:
             case PVFS_SERV_LISTEATTR:
+            case PVFS_SERV_BATCH_REMOVE:
+            case PVFS_SERV_UNSTUFF:
 		/* nothing to free */
 		break;
 	    case PVFS_SERV_INVALID:
 	    case PVFS_SERV_WRITE_COMPLETION:
 	    case PVFS_SERV_PERF_UPDATE:
+	    case PVFS_SERV_PRECREATE_POOL_REFILLER:
 	    case PVFS_SERV_JOB_TIMER:
 	    case PVFS_SERV_PROTO_ERROR:
             case PVFS_SERV_NUM_OPS:  /* sentinel */
@@ -830,6 +870,10 @@ static void lebf_decode_rel(struct PINT_
                 case PVFS_SERV_MGMT_ITERATE_HANDLES:
                     decode_free(resp->u.mgmt_iterate_handles.handle_array);
                     break;
+                
+                case PVFS_SERV_BATCH_CREATE:
+                    decode_free(resp->u.batch_create.handle_array);
+                    break;
 
                 case PVFS_SERV_MGMT_DSPACE_INFO_LIST:
                     decode_free(resp->u.mgmt_dspace_info_list.dspace_info_array);
@@ -842,6 +886,13 @@ static void lebf_decode_rel(struct PINT_
                         decode_free(resp->u.getattr.attr.u.meta.dfile_array);
                     break;
 
+                case PVFS_SERV_UNSTUFF:
+                    if (resp->u.unstuff.attr.mask & PVFS_ATTR_META_DIST)
+                        decode_free(resp->u.unstuff.attr.u.meta.dist);
+                    if (resp->u.unstuff.attr.mask & PVFS_ATTR_META_DFILES)
+                        decode_free(resp->u.unstuff.attr.u.meta.dfile_array);
+                    break;
+
                 case PVFS_SERV_MGMT_EVENT_MON:
                     decode_free(resp->u.mgmt_event_mon.event_array);
                     break;
@@ -893,11 +944,13 @@ static void lebf_decode_rel(struct PINT_
                 case PVFS_SERV_STATFS:
                 case PVFS_SERV_WRITE_COMPLETION:
                 case PVFS_SERV_PROTO_ERROR:
+                case PVFS_SERV_BATCH_REMOVE:
                     /* nothing to free */
                     break;
 
                 case PVFS_SERV_INVALID:
                 case PVFS_SERV_PERF_UPDATE:
+                case PVFS_SERV_PRECREATE_POOL_REFILLER:
                 case PVFS_SERV_JOB_TIMER:
                 case PVFS_SERV_NUM_OPS:  /* sentinel */
                     gossip_lerr("%s: invalid response operation %d.\n",

Index: endecode-funcs.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/proto/endecode-funcs.h,v
diff -p -u -r1.22 -r1.23
--- endecode-funcs.h	18 Jul 2007 20:41:46 -0000	1.22
+++ endecode-funcs.h	8 Sep 2008 15:42:48 -0000	1.23
@@ -113,6 +113,9 @@
 } while (0)
 #endif
 
+/* determines how much protocol space a string encoding will consume */
+#define encode_string_size_check(pbuf) (strlen(*pbuf) + 5)
+
 #define decode_string(pptr,pbuf) do { \
     u_int32_t len = bmitoh32(*(u_int32_t *) *(pptr)); \
     *pbuf = *(pptr) + 4; \

Index: pvfs2-attr.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/proto/pvfs2-attr.h,v
diff -p -u -r1.41 -r1.42
--- pvfs2-attr.h	6 Mar 2008 20:40:59 -0000	1.41
+++ pvfs2-attr.h	8 Sep 2008 15:42:48 -0000	1.42
@@ -36,6 +36,8 @@
 #define PVFS_ATTR_META_ALL \
 (PVFS_ATTR_META_DIST | PVFS_ATTR_META_DFILES)
 
+#define PVFS_ATTR_META_UNSTUFFED (1 << 12)
+
 /* internal attribute masks for datafile objects */
 #define PVFS_ATTR_DATA_SIZE            (1 << 15)
 #define PVFS_ATTR_DATA_ALL   PVFS_ATTR_DATA_SIZE
@@ -52,7 +54,7 @@
 
 /* attributes that do not change once set */
 #define PVFS_STATIC_ATTR_MASK \
-(PVFS_ATTR_COMMON_TYPE|PVFS_ATTR_META_DIST|PVFS_ATTR_META_DFILES)
+(PVFS_ATTR_COMMON_TYPE|PVFS_ATTR_META_DIST|PVFS_ATTR_META_DFILES|PVFS_ATTR_META_UNSTUFFED)
 
 /* extended hint attributes for a metafile object */
 struct PVFS_metafile_hint_s
@@ -75,6 +77,9 @@ struct PVFS_metafile_attr_s
     /* list of datafiles */
     PVFS_handle *dfile_array;
     uint32_t dfile_count;
+
+    int32_t stuffed_size;
+
     PVFS_metafile_hint hint;
 };
 typedef struct PVFS_metafile_attr_s PVFS_metafile_attr;
@@ -201,6 +206,12 @@ typedef struct PVFS_object_attr PVFS_obj
     encode_PVFS_time(pptr, &(x)->ctime); \
     encode_uint32_t(pptr, &(x)->mask); \
     encode_PVFS_ds_type(pptr, &(x)->objtype); \
+    if ((x)->objtype == PVFS_TYPE_METAFILE && \
+        (!((x)->mask & PVFS_ATTR_META_UNSTUFFED))) \
+    { \
+        encode_int32_t(pptr, &(x)->u.meta.stuffed_size); \
+        encode_skip4(pptr,); \
+    } \
     if ((x)->mask & PVFS_ATTR_META_DIST) \
 	encode_PVFS_metafile_attr_dist(pptr, &(x)->u.meta); \
     if ((x)->mask & PVFS_ATTR_META_DFILES) \
@@ -222,6 +233,12 @@ typedef struct PVFS_object_attr PVFS_obj
     decode_PVFS_time(pptr, &(x)->ctime); \
     decode_uint32_t(pptr, &(x)->mask); \
     decode_PVFS_ds_type(pptr, &(x)->objtype); \
+    if ((x)->objtype == PVFS_TYPE_METAFILE && \
+        (!((x)->mask & PVFS_ATTR_META_UNSTUFFED))) \
+    { \
+        decode_int32_t(pptr, &(x)->u.meta.stuffed_size); \
+        decode_skip4(pptr,); \
+    } \
     if ((x)->mask & PVFS_ATTR_META_DIST) \
 	decode_PVFS_metafile_attr_dist(pptr, &(x)->u.meta); \
     if ((x)->mask & PVFS_ATTR_META_DFILES) \
@@ -239,8 +256,10 @@ typedef struct PVFS_object_attr PVFS_obj
 #define extra_size_PVFS_object_attr_dir  (PVFS_REQ_LIMIT_DIST_BYTES + \
   PVFS_REQ_LIMIT_DIST_NAME + roundup8(sizeof(PVFS_directory_attr)))
 
+/* room for distribution, stuffed_size, and dfile array */
 #define extra_size_PVFS_object_attr_meta (PVFS_REQ_LIMIT_DIST_BYTES + \
-  PVFS_REQ_LIMIT_DFILE_COUNT * sizeof(PVFS_handle))
+  sizeof(int32_t) + \
+  PVFS_REQ_LIMIT_DFILE_COUNT * sizeof(PVFS_handle)) 
 
 #define extra_size_PVFS_object_attr_symlink (PVFS_REQ_LIMIT_PATH_NAME_BYTES)
 

Index: pvfs2-req-proto.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/proto/pvfs2-req-proto.h,v
diff -p -u -r1.154 -r1.155
--- pvfs2-req-proto.h	13 Jun 2008 21:33:08 -0000	1.154
+++ pvfs2-req-proto.h	8 Sep 2008 15:42:48 -0000	1.155
@@ -22,7 +22,7 @@
  * compatibility (such as changing the semantics or protocol fields for an
  * existing request type)
  */
-#define PVFS2_PROTO_MAJOR 5
+#define PVFS2_PROTO_MAJOR 6
 /* update PVFS2_PROTO_MINOR on wire protocol changes that preserve backwards
  * compatibility (such as adding a new request type)
  */
@@ -74,6 +74,10 @@ enum PVFS_server_op
     PVFS_SERV_LISTEATTR = 32,
     PVFS_SERV_SMALL_IO = 33,
     PVFS_SERV_LISTATTR = 34,
+    PVFS_SERV_BATCH_CREATE = 35,
+    PVFS_SERV_BATCH_REMOVE = 36,
+    PVFS_SERV_PRECREATE_POOL_REFILLER = 37, /* not a real protocol request */
+    PVFS_SERV_UNSTUFF = 38,
     /* leave this entry last */
     PVFS_SERV_NUM_OPS
 };
@@ -91,6 +95,8 @@ enum PVFS_server_op
  * parameters used within the request protocol
  */
 
+/* max size of layout information (may include explicit server list */
+#define PVFS_REQ_LIMIT_LAYOUT             4096
 /* max size of opaque distribution parameters */
 #define PVFS_REQ_LIMIT_DIST_BYTES         1024
 /* max size of each configuration file transmitted to clients.
@@ -121,6 +127,8 @@ enum PVFS_server_op
 #define PVFS_REQ_LIMIT_MGMT_EVENT_MON_COUNT 2048
 /* max number of handles returned by any operation using an array of handles */
 #define PVFS_REQ_LIMIT_HANDLES_COUNT 1024
+/* max number of handles that can be created at once using batch create */
+#define PVFS_REQ_LIMIT_BATCH_CREATE 8192
 /* max number of handles returned by mgmt iterate handles op */
 #define PVFS_REQ_LIMIT_MGMT_ITERATE_HANDLES_COUNT \
   PVFS_REQ_LIMIT_HANDLES_COUNT
@@ -141,12 +149,77 @@ enum PVFS_server_op
 #define PVFS_REQ_LIMIT_LISTATTR 64
 
 /* create *********************************************************/
-/* - used to create new metafile and datafile objects */
+/* - used to create an object.  This creates a metadata handle,
+ * a datafile handle, and links the datafile handle to the metadata handle.
+ * It also sets the attributes on the metadata. */
 
 struct PVFS_servreq_create
 {
     PVFS_fs_id fs_id;
+    PVFS_object_attr attr;
+
+    int32_t num_dfiles_req;
+    /* NOTE: leave layout as final field so that we can deal with encoding
+     * errors */
+    PVFS_sys_layout layout;
+};
+endecode_fields_5_struct(
+    PVFS_servreq_create,
+    PVFS_fs_id, fs_id,
+    skip4,,
+    PVFS_object_attr, attr,
+    int32_t, num_dfiles_req,
+    PVFS_sys_layout, layout)
+
+#define extra_size_PVFS_servreq_create \
+    (extra_size_PVFS_object_attr + extra_size_PVFS_sys_layout)
+
+#define PINT_SERVREQ_CREATE_FILL(__req,                                    \
+                                 __creds,                                  \
+                                 __fsid,                                   \
+                                 __attr,                                   \
+                                 __num_dfiles_req,                         \
+                                 __layout)                                 \
+do {                                                                       \
+    int mask;                                                              \
+    memset(&(__req), 0, sizeof(__req));                                    \
+    (__req).op = PVFS_SERV_CREATE;                                         \
+    (__req).credentials = (__creds);                                       \
+    (__req).u.create.fs_id = (__fsid);                                     \
+    (__req).u.create.num_dfiles_req = (__num_dfiles_req);                  \
+    (__attr).objtype = PVFS_TYPE_METAFILE;                                 \
+    mask = (__attr).mask;                                                  \
+    (__attr).mask = PVFS_ATTR_COMMON_ALL;                                  \
+    (__attr).mask |= PVFS_ATTR_SYS_TYPE;                                   \
+    PINT_copy_object_attr(&(__req).u.create.attr, &(__attr));              \
+    (__req).u.create.attr.mask |= mask;                                    \
+    (__req).u.create.layout = __layout;                                    \
+} while (0)
+
+struct PVFS_servresp_create
+{
+    PVFS_handle metafile_handle;
+    int32_t stuffed;
+    int32_t datafile_count;
+    PVFS_handle *datafile_handles;
+};
+endecode_fields_2a_struct(
+    PVFS_servresp_create,
+    PVFS_handle, metafile_handle,
+    int32_t, stuffed,
+    int32_t, datafile_count,
+    PVFS_handle, datafile_handles)
+#define extra_size_PVFS_servresp_create \
+    (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_handle))
+
+/* batch_create *********************************************************/
+/* - used to create new multiple metafile and datafile objects */
+
+struct PVFS_servreq_batch_create
+{
+    PVFS_fs_id fs_id;
     PVFS_ds_type object_type;
+    uint32_t object_count;
 
     /*
       an array of handle extents that we use to suggest to
@@ -156,38 +229,47 @@ struct PVFS_servreq_create
     */
     PVFS_handle_extent_array handle_extent_array;
 };
-endecode_fields_3_struct(
-    PVFS_servreq_create,
+endecode_fields_5_struct(
+    PVFS_servreq_batch_create,
     PVFS_fs_id, fs_id,
     PVFS_ds_type, object_type,
+    uint32_t, object_count,
+    skip4,,
     PVFS_handle_extent_array, handle_extent_array)
-#define extra_size_PVFS_servreq_create \
+#define extra_size_PVFS_servreq_batch_create \
     (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_handle_extent))
 
-#define PINT_SERVREQ_CREATE_FILL(__req,                \
+#define PINT_SERVREQ_BATCH_CREATE_FILL(__req,          \
                                  __creds,              \
                                  __fsid,               \
                                  __objtype,            \
+                                 __objcount,           \
                                  __ext_array)          \
 do {                                                   \
     memset(&(__req), 0, sizeof(__req));                \
-    (__req).op = PVFS_SERV_CREATE;                     \
+    (__req).op = PVFS_SERV_BATCH_CREATE;               \
     (__req).credentials = (__creds);                   \
-    (__req).u.create.fs_id = (__fsid);                 \
-    (__req).u.create.object_type = (__objtype);        \
-    (__req).u.create.handle_extent_array.extent_count =\
+    (__req).u.batch_create.fs_id = (__fsid);           \
+    (__req).u.batch_create.object_type = (__objtype);        \
+    (__req).u.batch_create.object_count = (__objcount);      \
+    (__req).u.batch_create.handle_extent_array.extent_count =\
         (__ext_array).extent_count;                    \
-    (__req).u.create.handle_extent_array.extent_array =\
+    (__req).u.batch_create.handle_extent_array.extent_array =\
         (__ext_array).extent_array;                    \
 } while (0)
 
-struct PVFS_servresp_create
+struct PVFS_servresp_batch_create
 {
-    PVFS_handle handle;
+    PVFS_handle *handle_array;
+    uint32_t handle_count; 
 };
-endecode_fields_1_struct(
-    PVFS_servresp_create,
-    PVFS_handle, handle)
+endecode_fields_1a_struct(
+    PVFS_servresp_batch_create,
+    skip4,,
+    uint32_t, handle_count,
+    PVFS_handle, handle_array)
+#define extra_size_PVFS_servresp_batch_create \
+  (PVFS_REQ_LIMIT_BATCH_CREATE * sizeof(PVFS_handle))
 
 /* remove *****************************************************/
 /* - used to remove an existing metafile or datafile object */
@@ -214,6 +296,34 @@ do {                                    
     (__req).u.remove.handle = (__handle); \
 } while (0)
 
+struct PVFS_servreq_batch_remove
+{
+    PVFS_fs_id  fs_id;
+    int32_t handle_count;
+    PVFS_handle *handles;
+};
+endecode_fields_1a_struct(
+    PVFS_servreq_batch_remove,
+    PVFS_fs_id, fs_id,
+    int32_t, handle_count,
+    PVFS_handle, handles)
+#define extra_size_PVFS_servreq_batch_remove \
+  (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_handle))
+
+#define PINT_SERVREQ_BATCH_REMOVE_FILL(__req,        \
+                                       __creds,      \
+                                       __fsid,       \
+                                       __count,      \
+                                       __handles)    \
+do {                                                 \
+    memset(&(__req), 0, sizeof(__req));              \
+    (__req).op = PVFS_SERV_BATCH_REMOVE;             \
+    (__req).credentials = (__creds);                 \
+    (__req).u.batch_remove.fs_id = (__fsid);         \
+    (__req).u.batch_remove.handle_count = (__count); \
+    (__req).u.batch_remove.handles = (__handles);    \
+} while (0)
+
 /* mgmt_remove_object */
 /* - used to remove an existing object reference */
 
@@ -368,6 +478,49 @@ endecode_fields_1_struct(
 #define extra_size_PVFS_servresp_getattr \
     extra_size_PVFS_object_attr
 
+/* unstuff ****************************************************/
+/* - creates the datafile handles for the file.  This allows a stuffed
+ * file to migrate to a large one. */
+
+struct PVFS_servreq_unstuff
+{
+    PVFS_handle handle; /* handle of target object */
+    PVFS_fs_id fs_id;   /* file system */
+    uint32_t attrmask;  /* mask of desired attributes */
+};
+endecode_fields_3_struct(
+    PVFS_servreq_unstuff,
+    PVFS_handle, handle,
+    PVFS_fs_id, fs_id,
+    uint32_t, attrmask)
+
+#define PINT_SERVREQ_UNSTUFF_FILL(__req,           \
+                                  __creds,         \
+                                  __fsid,          \
+                                  __handle,        \
+                                  __amask)         \
+do {                                               \
+    memset(&(__req), 0, sizeof(__req));            \
+    (__req).op = PVFS_SERV_UNSTUFF;                \
+    (__req).credentials = (__creds);               \
+    (__req).u.unstuff.fs_id = (__fsid);            \
+    (__req).u.unstuff.handle = (__handle);         \
+    (__req).u.unstuff.attrmask = (__amask);        \
+} while (0)
+
+struct PVFS_servresp_unstuff
+{
+    /* return the entire object's attributes, which includes the
+     * new datafile handles for the migrated file.
+     */
+    PVFS_object_attr attr;
+};
+endecode_fields_1_struct(
+    PVFS_servresp_unstuff,
+    PVFS_object_attr, attr)
+#define extra_size_PVFS_servresp_unstuff \
+    extra_size_PVFS_object_attr
+
 /* setattr ****************************************************/
 /* - sets attributes specified by mask of PVFS_ATTR_XXX values */
 
@@ -1188,26 +1341,30 @@ struct PVFS_servreq_mgmt_iterate_handles
 {
     PVFS_fs_id fs_id;
     int32_t handle_count;
+    int32_t flags;
     PVFS_ds_position position;
 };
-endecode_fields_3_struct(
+endecode_fields_4_struct(
     PVFS_servreq_mgmt_iterate_handles,
     PVFS_fs_id, fs_id,
     int32_t, handle_count,
+    int32_t, flags,
     PVFS_ds_position, position)
 
 #define PINT_SERVREQ_MGMT_ITERATE_HANDLES_FILL(__req,              \
                                         __creds,                   \
                                         __fs_id,                   \
                                         __handle_count,            \
-                                        __position)                \
+                                        __position,                \
+                                        __flags)                   \
 do {                                                               \
     memset(&(__req), 0, sizeof(__req));                            \
     (__req).op = PVFS_SERV_MGMT_ITERATE_HANDLES;                   \
     (__req).credentials = (__creds);                               \
     (__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);        \
+    (__req).u.mgmt_iterate_handles.position = (__position),        \
+    (__req).u.mgmt_iterate_handles.flags = (__flags);              \
 } while (0)
 
 struct PVFS_servresp_mgmt_iterate_handles
@@ -1501,7 +1658,10 @@ struct PVFS_server_req
     union
     {
         struct PVFS_servreq_create create;
+        struct PVFS_servreq_unstuff unstuff;
+        struct PVFS_servreq_batch_create batch_create;
         struct PVFS_servreq_remove remove;
+        struct PVFS_servreq_batch_remove batch_remove;
         struct PVFS_servreq_io io;
         struct PVFS_servreq_getattr getattr;
         struct PVFS_servreq_setattr setattr;
@@ -1558,6 +1718,8 @@ struct PVFS_server_resp
     union
     {
         struct PVFS_servresp_create create;
+        struct PVFS_servresp_unstuff unstuff;
+        struct PVFS_servresp_batch_create batch_create;
         struct PVFS_servresp_getattr getattr;
         struct PVFS_servresp_mkdir mkdir;
         struct PVFS_servresp_readdir readdir;



More information about the Pvfs2-cvs mailing list