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

CVS commit program cvs at parl.clemson.edu
Thu Jan 24 16:34:39 EST 2008


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

Modified Files:
      Tag: small-file-branch
	PINT-le-bytefield.c pvfs2-req-proto.h 
Log Message:
inode stuffing operation.  also added a keyval_remove_list.


Index: PINT-le-bytefield.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/PINT-le-bytefield.c,v
diff -p -u -r1.52.6.1 -r1.52.6.2
--- PINT-le-bytefield.c	24 Jan 2008 21:15:16 -0000	1.52.6.1
+++ PINT-le-bytefield.c	24 Jan 2008 21:34:39 -0000	1.52.6.2
@@ -379,6 +379,7 @@ static int lebf_encode_req(
 	CASE(PVFS_SERV_DELEATTR, deleattr);
 	CASE(PVFS_SERV_LISTEATTR, listeattr);
         CASE(PVFS_SERV_LISTATTR,  listattr);
+        CASE(PVFS_SERV_STUFFED_CREATE, stuffed_create);
 
 	case PVFS_SERV_GETCONFIG:
         case PVFS_SERV_MGMT_NOOP:
@@ -473,6 +474,7 @@ static int lebf_encode_resp(
         CASE(PVFS_SERV_GETEATTR, geteattr);
         CASE(PVFS_SERV_LISTEATTR, listeattr);
         CASE(PVFS_SERV_LISTATTR, listattr);
+        CASE(PVFS_SERV_STUFFED_CREATE, stuffed_create);
 
         case PVFS_SERV_REMOVE:
         case PVFS_SERV_MGMT_REMOVE_OBJECT:
@@ -577,6 +579,7 @@ static int lebf_decode_req(
 	CASE(PVFS_SERV_DELEATTR, deleattr);
         CASE(PVFS_SERV_LISTEATTR, listeattr);
         CASE(PVFS_SERV_LISTATTR, listattr);
+        CASE(PVFS_SERV_STUFFED_CREATE, stuffed_create);
 
 	case PVFS_SERV_GETCONFIG:
         case PVFS_SERV_MGMT_NOOP:
@@ -661,6 +664,7 @@ static int lebf_decode_resp(
 	CASE(PVFS_SERV_GETEATTR, geteattr);
         CASE(PVFS_SERV_LISTEATTR, listeattr);
         CASE(PVFS_SERV_LISTATTR, listattr);
+        CASE(PVFS_SERV_STUFFED_CREATE, stuffed_create);
 
         case PVFS_SERV_REMOVE:
         case PVFS_SERV_MGMT_REMOVE_OBJECT:
@@ -765,7 +769,12 @@ 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_STUFFED_CREATE:
+		decode_free(req->u.stuffed_create.metafile_handle_extent_array.extent_array);
+		decode_free(req->u.stuffed_create.datafile_handle_extent_array.extent_array);
+		break;
+
+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)
@@ -904,6 +913,7 @@ static void lebf_decode_rel(struct PINT_
                 case PVFS_SERV_STATFS:
                 case PVFS_SERV_WRITE_COMPLETION:
                 case PVFS_SERV_PROTO_ERROR:
+                case PVFS_SERV_STUFFED_CREATE:
                     /* nothing to free */
                     break;
 

Index: pvfs2-req-proto.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/pvfs2-req-proto.h,v
diff -p -u -r1.151.6.1 -r1.151.6.2
--- pvfs2-req-proto.h	24 Jan 2008 21:15:16 -0000	1.151.6.1
+++ pvfs2-req-proto.h	24 Jan 2008 21:34:39 -0000	1.151.6.2
@@ -75,6 +75,7 @@ enum PVFS_server_op
     PVFS_SERV_SMALL_IO = 33,
     PVFS_SERV_LISTATTR = 34,
     PVFS_SERV_BATCH_CREATE = 35,
+    PVFS_SERV_STUFFED_CREATE = 36,
     /* leave this entry last */
     PVFS_SERV_NUM_OPS
 };
@@ -138,6 +139,69 @@ enum PVFS_server_op
 /* max number of handles for which we return attributes */
 #define PVFS_REQ_LIMIT_LISTATTR 64
 
+/* stuffed create *********************************************************/
+/* - used to create a stuffed 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_stuffed_create
+{
+    PVFS_fs_id fs_id;
+    PVFS_object_attr attr;
+
+    /*
+      an array of handle extents that we use to suggest to
+      the server from which handle range to allocate for the
+      newly created handle(s).  To request a single handle,
+      a single extent with first = last should be used.
+    */
+    PVFS_handle_extent_array metafile_handle_extent_array;
+
+    PVFS_handle_extent_array datafile_handle_extent_array;
+};
+endecode_fields_5_struct(
+    PVFS_servreq_stuffed_create,
+    PVFS_fs_id, fs_id,
+    skip4,,
+    PVFS_object_attr, attr,
+    PVFS_handle_extent_array, metafile_handle_extent_array,
+    PVFS_handle_extent_array, datafile_handle_extent_array)
+#define extra_size_PVFS_servreq_stuffed_create \
+    (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_handle_extent) + \
+     PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_handle_extent))
+
+#define PINT_SERVREQ_STUFFED_CREATE_FILL(__req,                                \
+                                         __creds,                              \
+                                         __fsid,                               \
+                                         __md_ext_array,                       \
+                                         __df_ext_array,                       \
+                                         __objtype,                            \
+                                         __attr,                               \
+                                         __extra_mask)                         \
+do {                                                                           \
+    memset(&(__req), 0, sizeof(__req));                                        \
+    (__req).op = PVFS_SERV_STUFFED_CREATE;                                     \
+    (__req).credentials = (__creds);                                           \
+    (__req).u.stuffed_create.fs_id = (__fsid);                                 \
+    (__attr).objtype = (__objtype);                                            \
+    (__attr).mask |= PVFS_ATTR_SYS_TYPE;                                       \
+    PINT_CONVERT_ATTR(&(__req).u.stuffed_create.attr, &(__attr), __extra_mask);\
+    (__req).u.create.handle_extent_array.extent_count =                        \
+        (__ext_array).extent_count;                                            \
+    (__req).u.create.handle_extent_array.extent_array =                        \
+        (__ext_array).extent_array;                                            \
+} while (0)
+
+struct PVFS_servresp_stuffed_create
+{
+    PVFS_handle metafile_handle;
+    PVFS_handle datafile_handle;
+};
+endecode_fields_2_struct(
+    PVFS_servresp_stuffed_create,
+    PVFS_handle, metafile_handle,
+    PVFS_handle, datafile_handle)
+
 /* create *********************************************************/
 /* - used to create new metafile and datafile objects */
 
@@ -1586,6 +1650,7 @@ struct PVFS_server_req
         struct PVFS_servreq_listeattr listeattr;
         struct PVFS_servreq_small_io small_io;
         struct PVFS_servreq_listattr listattr;
+        struct PVFS_servreq_stuffed_create stuffed_create;
     } u;
 };
 #ifdef __PINT_REQPROTO_ENCODE_FUNCS_C
@@ -1637,6 +1702,7 @@ struct PVFS_server_resp
         struct PVFS_servresp_listeattr listeattr;
         struct PVFS_servresp_small_io small_io;
         struct PVFS_servresp_listattr listattr;
+        struct PVFS_servresp_stuffed_create stuffed_create;
     } u;
 };
 endecode_fields_2_struct(



More information about the Pvfs2-cvs mailing list