[PVFS2-CVS] commit by pcarns in pvfs2/src/common/misc: msgpairarray.h msgpairarray.sm

CVS commit program cvs at parl.clemson.edu
Tue Jul 13 10:21:01 EDT 2004


Update of /projects/cvsroot/pvfs2/src/common/misc
In directory parlweb:/tmp/cvs-serv22605/src/common/misc

Modified Files:
	msgpairarray.h msgpairarray.sm 
Log Message:
move variable that tracks completion count into msgpair_params struct


Index: msgpairarray.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/msgpairarray.h,v
diff -p -u -r1.3 -r1.4
--- msgpairarray.h	13 Jul 2004 02:06:28 -0000	1.3
+++ msgpairarray.h	13 Jul 2004 13:21:01 -0000	1.4
@@ -37,9 +37,6 @@ typedef struct PINT_sm_msgpair_state_s
      */
     int (* comp_fn)(void *sm_p, struct PVFS_server_resp *resp_p, int i);
 
-    /* comp_ct used to keep up with number of operations remaining */
-    int comp_ct;
-
     /* server address */
     PVFS_BMI_addr_t svr_addr;
 
@@ -76,6 +73,8 @@ typedef struct PINT_sm_msgpair_params_s
     int retry_delay;
     int retry_limit;
     job_context_id job_context;
+    /* comp_ct used to keep up with number of operations remaining */
+    int comp_ct;
 } PINT_sm_msgpair_params;
 
 

Index: msgpairarray.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/msgpairarray.sm,v
diff -p -u -r1.8 -r1.9
--- msgpairarray.sm	13 Jul 2004 02:54:16 -0000	1.8
+++ msgpairarray.sm	13 Jul 2004 13:21:01 -0000	1.9
@@ -119,12 +119,8 @@ static int msgpairarray_init(PARENT_SM *
 
     js_p->error_code = 0;
 
-    /*
-      set number of operations that must complete.  we're using the
-      comp_ct in the first msgarray entry to keep up with the count
-      for the entire array.
-    */
-    sm_p->msgarray[0].comp_ct = (2 * sm_p->msgarray_count);
+    /* set number of operations that must complete.  */
+    sm_p->msgarray_params.comp_ct = (2 * sm_p->msgarray_count);
 
     for(i = 0; i < sm_p->msgarray_count; i++)
     {
@@ -167,7 +163,7 @@ static int msgpairarray_post(PARENT_SM *
     PVFS_msg_tag_t session_tag;
     PINT_sm_msgpair_state *msg_p = NULL;
     struct filesystem_configuration_s *cur_fs = NULL;
-    int num_incomplete_msgpairs = (sm_p->msgarray[0].comp_ct / 2);
+    int num_incomplete_msgpairs = (sm_p->msgarray_params.comp_ct / 2);
 
     gossip_debug(
         GOSSIP_CLIENT_DEBUG, "(%p) msgpairarray state: post "
@@ -177,7 +173,7 @@ static int msgpairarray_post(PARENT_SM *
     js_p->error_code = 0;
 
     assert(sm_p->msgarray_count > 0);
-    assert(num_incomplete_msgpairs && sm_p->msgarray[0].comp_ct);
+    assert(num_incomplete_msgpairs && sm_p->msgarray_params.comp_ct);
 
     for (i = 0; i < num_incomplete_msgpairs; i++)
     {
@@ -288,7 +284,7 @@ static int msgpairarray_post(PARENT_SM *
 	    /* mark send as bad too and don't post it */
 	    msg_p->send_status.error_code = msg_p->recv_status.error_code;
 	    msg_p->op_status = msg_p->recv_status.error_code;
-	    sm_p->msgarray[0].comp_ct -= 2;
+	    sm_p->msgarray_params.comp_ct -= 2;
 	    /* continue to send other array entries if possible */
 	    continue;
 	}
@@ -340,23 +336,19 @@ static int msgpairarray_post(PARENT_SM *
 	     */
 	    msg_p->op_status = msg_p->send_status.error_code;
 	    msg_p->send_id = 0;
-	    sm_p->msgarray[0].comp_ct--;
+	    sm_p->msgarray_params.comp_ct--;
 	}
 	else if (ret == 1)
 	{
 	    /* immediate completion */
 	    msg_p->send_id = 0;
-	    /* decrement our count, since send is already done.
-	     *
-	     * we're using the comp_ct in the first array element to
-	     * keep up with our count for the entire array.
-	     */
-	    sm_p->msgarray[0].comp_ct--;
+	    /* decrement our count, since send is already done. */
+	    sm_p->msgarray_params.comp_ct--;
 	}
         /* else: successful post, no immediate completion */
     }
 
-    if (sm_p->msgarray[0].comp_ct == 0)
+    if (sm_p->msgarray_params.comp_ct == 0)
     {
 	/* everything is completed already (could happen in some failure
 	 * cases); jump straight to final completion function.
@@ -437,12 +429,12 @@ static int msgpairarray_complete(PARENT_
     }
 
     /* decrement comp_ct until all operations have completed */
-    if (--sm_p->msgarray[0].comp_ct > 0)
+    if (--sm_p->msgarray_params.comp_ct > 0)
     {
 	return 0;
     }
 
-    assert(sm_p->msgarray[0].comp_ct == 0);
+    assert(sm_p->msgarray_params.comp_ct == 0);
     gossip_debug(GOSSIP_CLIENT_DEBUG,
                  "  msgpairarray: all operations complete\n");
 
@@ -484,14 +476,14 @@ static int msgpairarray_completion_fn(PA
                   NOTE: we only retry msgpairs that haven't yet been
                   completed
                 */
-                sm_p->msgarray[0].comp_ct = 2 * count_incomplete_msgs(
+                sm_p->msgarray_params.comp_ct = 2 * count_incomplete_msgs(
                     sm_p->msgarray, sm_p->msgarray_count);
 
-                assert(sm_p->msgarray[0].comp_ct > 0);
+                assert(sm_p->msgarray_params.comp_ct > 0);
 
                 gossip_debug(GOSSIP_CLIENT_DEBUG, "*** msgpairarray is "
                              "retrying %d of %d total messages\n",
-                             sm_p->msgarray[0].comp_ct,
+                             sm_p->msgarray_params.comp_ct,
                              (2 * sm_p->msgarray_count));
 
                 js_p->error_code = MSGPAIRS_RETRY;



More information about the PVFS2-CVS mailing list