[PVFS2-CVS] commit by pcarns in pvfs2/src/client/sysint: finalize.c initialize.c pint-servreq.h pint-sysint-utils.c sys-io.sm

CVS commit program cvs at parl.clemson.edu
Tue Jul 20 15:34:58 EDT 2004


Update of /projects/cvsroot/pvfs2/src/client/sysint
In directory parlweb:/tmp/cvs-serv26705/src/client/sysint

Modified Files:
	finalize.c initialize.c pint-servreq.h pint-sysint-utils.c 
	sys-io.sm 
Log Message:
created new pint-util.[ch] to be used for generic utility functions
available to both client and server; moved get_next_session_tag() there and
renamed to PINT_util_get_next_tag(), some minor cleanups


Index: finalize.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/finalize.c,v
diff -p -u -r1.30 -r1.31
--- finalize.c	8 Jul 2004 21:02:19 -0000	1.30
+++ finalize.c	20 Jul 2004 18:34:57 -0000	1.31
@@ -44,11 +44,6 @@ int PVFS_sys_finalize()
     /* flush all known server configurations */
     PINT_server_config_mgr_finalize();
 
-    /* get rid of the mutex for the BMI session tag identifier */
-    gen_mutex_lock(g_session_tag_mt_lock);
-    gen_mutex_unlock(g_session_tag_mt_lock);
-    gen_mutex_destroy(g_session_tag_mt_lock);
-
     /* finalize the I/O interfaces */
     job_time_mgr_finalize();
     job_close_context(PVFS_sys_job_context);

Index: initialize.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/initialize.c,v
diff -p -u -r1.88 -r1.89
--- initialize.c	16 Jul 2004 14:17:25 -0000	1.88
+++ initialize.c	20 Jul 2004 18:34:57 -0000	1.89
@@ -31,8 +31,6 @@ job_context_id PVFS_sys_job_context = -1
 
 PINT_client_sm *g_sm_p = NULL;
 
-extern gen_mutex_t *g_session_tag_mt_lock;
-
 typedef enum
 {
     CLIENT_NO_INIT         =      0,
@@ -117,7 +115,6 @@ int PVFS_sys_initialize(int default_debu
         gossip_lerr("BMI initialize failure\n");
         goto error_exit;
     }
-    g_session_tag_mt_lock = gen_mutex_build();
     client_status_flag |= CLIENT_BMI_INIT;
 
     /* initialize the flow interface */

Index: pint-servreq.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/pint-servreq.h,v
diff -p -u -r1.16 -r1.17
--- pint-servreq.h	16 Feb 2004 21:35:27 -0000	1.16
+++ pint-servreq.h	20 Jul 2004 18:34:58 -0000	1.17
@@ -62,7 +62,6 @@ void PINT_release_ack_array(PVFS_BMI_add
 
 /* dunno where these belong, but here is better than nowhere. -- rob */
 void debug_print_type(void* thing, int type);
-PVFS_msg_tag_t get_next_session_tag(void);
 
 /*
  * Local variables:

Index: pint-sysint-utils.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/pint-sysint-utils.c,v
diff -p -u -r1.30 -r1.31
--- pint-sysint-utils.c	8 Jul 2004 20:06:48 -0000	1.30
+++ pint-sysint-utils.c	20 Jul 2004 18:34:58 -0000	1.31
@@ -21,9 +21,6 @@
 #include "pvfs2-util.h"
 #include "client-state-machine.h"
 
-static int g_session_tag;
-gen_mutex_t *g_session_tag_mt_lock = NULL;
-
 /*
   analogous to 'get_server_config_struct' in pvfs2-server.c -- only an
   fs_id is required since any client may know about different server
@@ -38,36 +35,6 @@ struct server_configuration_s *PINT_get_
 void PINT_put_server_config_struct(struct server_configuration_s *config)
 {
     PINT_server_config_mgr_put_config(config);
-}
-
-int get_next_session_tag(void)
-{
-    int ret = -1;
-
-    if (g_session_tag_mt_lock == NULL)
-    {
-        g_session_tag_mt_lock = gen_mutex_build();
-        if (g_session_tag_mt_lock == NULL)
-        {
-            return ret;
-        }
-    }
-
-    gen_mutex_lock(g_session_tag_mt_lock);
-    ret = g_session_tag;
-
-    /* increment the tag, don't use zero */
-    if (g_session_tag + 1 == 0)
-    {
-	g_session_tag = 1;
-    }
-    else
-    {
-	g_session_tag++;
-    }
-    gen_mutex_unlock(g_session_tag_mt_lock);
-
-    return ret;
 }
 
 /* check permissions of a PVFS object against the access mode

Index: sys-io.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/sys-io.sm,v
diff -p -u -r1.90 -r1.91
--- sys-io.sm	15 Jul 2004 20:36:22 -0000	1.90
+++ sys-io.sm	20 Jul 2004 18:34:58 -0000	1.91
@@ -17,6 +17,7 @@
 #include "pint-servreq.h"
 #include "pint-cached-config.h"
 #include "PINT-reqproto-encode.h"
+#include "pint-util.h"
 
 extern job_context_id pint_client_sm_context;
 
@@ -625,7 +626,7 @@ static int io_datafile_post_msgpairs(PIN
                      "status_user_tag=%lu (max_size %d)\n",
                      status_user_tag, msg->max_resp_sz);
 
-        cur_ctx->session_tag = get_next_session_tag();
+        cur_ctx->session_tag = PINT_util_get_next_tag();
 
         ret = job_bmi_recv(
             msg->svr_addr, msg->encoded_resp_p, msg->max_resp_sz,



More information about the PVFS2-CVS mailing list