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

CVS commit program cvs at parl.clemson.edu
Thu Jul 24 17:24:56 EDT 2008


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

Modified Files:
      Tag: rongrong
	PINT-le-bytefield.c pvfs2-req-proto.h 
Log Message:
db-rep-send state machine added


Index: PINT-le-bytefield.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/PINT-le-bytefield.c,v
diff -p -u -r1.53 -r1.53.6.1
--- PINT-le-bytefield.c	3 Mar 2008 19:05:56 -0000	1.53
+++ PINT-le-bytefield.c	24 Jul 2008 21:24:56 -0000	1.53.6.1
@@ -226,6 +226,11 @@ static void lebf_initialize(void)
                 reqsize = extra_size_PVFS_servreq_listattr;
                 respsize = extra_size_PVFS_servresp_listattr;
                 break;
+	    case PVFS_SERV_DBREP:
+		req.u.dbrep.control.buffer_sz = 0;
+		req.u.dbrep.rec.buffer_sz = 0;
+		reqsize = extra_size_PVFS_servreq_dbrep;
+		break;
             case PVFS_SERV_NUM_OPS:  /* sentinel, should not hit */
                 assert(0);
                 break;
@@ -379,6 +384,7 @@ static int lebf_encode_req(
 	CASE(PVFS_SERV_DELEATTR, deleattr);
 	CASE(PVFS_SERV_LISTEATTR, listeattr);
         CASE(PVFS_SERV_LISTATTR,  listattr);
+	CASE(PVFS_SERV_DBREP, dbrep); /*Rongrong*/
 
 	case PVFS_SERV_GETCONFIG:
         case PVFS_SERV_MGMT_NOOP:
@@ -484,6 +490,7 @@ static int lebf_encode_resp(
         case PVFS_SERV_FLUSH:
         case PVFS_SERV_MGMT_NOOP:
         case PVFS_SERV_PROTO_ERROR:
+	case PVFS_SERV_DBREP: /*Rongrong*/
             /* nothing else */
             break;
 
@@ -575,6 +582,7 @@ static int lebf_decode_req(
 	CASE(PVFS_SERV_DELEATTR, deleattr);
         CASE(PVFS_SERV_LISTEATTR, listeattr);
         CASE(PVFS_SERV_LISTATTR, listattr);
+	CASE(PVFS_SERV_DBREP, dbrep); /*Rongrong*/
 
 	case PVFS_SERV_GETCONFIG:
         case PVFS_SERV_MGMT_NOOP:
@@ -670,6 +678,7 @@ static int lebf_decode_resp(
         case PVFS_SERV_FLUSH:
         case PVFS_SERV_MGMT_NOOP:
         case PVFS_SERV_PROTO_ERROR:
+	case PVFS_SERV_DBREP: /*Rongrong*/
 	    /* nothing else */
 	    break;
 
@@ -791,6 +800,7 @@ static void lebf_decode_rel(struct PINT_
 	    case PVFS_SERV_SETEATTR:
 	    case PVFS_SERV_DELEATTR:
             case PVFS_SERV_LISTEATTR:
+	    case PVFS_SERV_DBREP: /*Rongrong*/
 		/* nothing to free */
 		break;
 	    case PVFS_SERV_INVALID:
@@ -893,6 +903,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_DBREP: /*Rongrong*/
                     /* 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.154 -r1.154.2.1
--- pvfs2-req-proto.h	13 Jun 2008 21:33:08 -0000	1.154
+++ pvfs2-req-proto.h	24 Jul 2008 21:24:56 -0000	1.154.2.1
@@ -74,6 +74,7 @@ enum PVFS_server_op
     PVFS_SERV_LISTEATTR = 32,
     PVFS_SERV_SMALL_IO = 33,
     PVFS_SERV_LISTATTR = 34,
+    PVFS_SERV_DBREP = 35,
     /* leave this entry last */
     PVFS_SERV_NUM_OPS
 };
@@ -139,7 +140,8 @@ enum PVFS_server_op
 #define PVFS_REQ_LIMIT_KEYVAL_LIST 32
 /* max number of handles for which we return attributes */
 #define PVFS_REQ_LIMIT_LISTATTR 64
-
+/*Rongrong*/
+#define PVFS_REQ_LIMIT_DBREP 15 * 1024
 /* create *********************************************************/
 /* - used to create new metafile and datafile objects */
 
@@ -1490,6 +1492,31 @@ endecode_fields_2a_struct(
 #define extra_size_PVFS_servresp_listeattr \
     (PVFS_REQ_LIMIT_KEY_LEN * PVFS_REQ_LIMIT_KEYVAL_LIST)
 
+/* Rongrong dbrepsend **************************************************/
+/* db replication msg*/
+struct PVFS_servreq_dbrep
+{
+    PVFS_ds_keyval control;
+    PVFS_ds_keyval rec;
+};
+endecode_fields_2_struct(
+    PVFS_servreq_dbrep,
+    PVFS_ds_keyval, control,
+    PVFS_ds_keyval, rec)
+#define extra_size_PVFS_servreq_dbrep \
+    PVFS_REQ_LIMIT_DBREP
+
+#define PINT_SERVREQ_DBREP_FILL(__req,		\
+				__control,	\
+				__rec)		\
+do{						\
+    memset(&(__req), 0, sizeof(__req));		\
+    (__req).op = PVFS_SERV_DBREP;		\
+    (__req).u.dbrep.control.buffer = (__control).buffer;\
+    (__req).u.dbrep.control.buffer_sz = (__control).buffer_sz;\
+    (__req).u.dbrep.rec.buffer = (__rec).buffer;	\
+    (__req).u.dbrep.rec.buffer_sz = (__control).buffer_sz;\
+}while(0);
 
 /* server request *********************************************/
 /* - generic request with union of all op specific structs */
@@ -1528,6 +1555,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_dbrep dbrep;
     } u;
 };
 #ifdef __PINT_REQPROTO_ENCODE_FUNCS_C



More information about the Pvfs2-cvs mailing list