[Pvfs2-cvs] commit by slang in pvfs2/src/client/sysint: mgmt-get-config.c mgmt-misc.c sys-create.sm sys-mkdir.sm sys-statfs.sm sys-symlink.sm

CVS commit program cvs at parl.clemson.edu
Wed Feb 13 19:04:39 EST 2008


Update of /projects/cvsroot/pvfs2/src/client/sysint
In directory parlweb1:/tmp/cvs-serv10911/src/client/sysint

Modified Files:
	mgmt-get-config.c mgmt-misc.c sys-create.sm sys-mkdir.sm 
	sys-statfs.sm sys-symlink.sm 
Log Message:
Cleanup to cached config.  All the functions took a server_config struct, but none of them actually used it (using the cached config instead).  There's a bunch of other cleanup that needs to be done between the server_config_mgr, the config_fetch/get state machines, and the rest of the config code, this is just a small start.


Index: mgmt-get-config.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/mgmt-get-config.c,v
diff -p -u -r1.5 -r1.6
--- mgmt-get-config.c	17 Aug 2007 04:04:24 -0000	1.5
+++ mgmt-get-config.c	14 Feb 2008 00:04:39 -0000	1.6
@@ -68,7 +68,7 @@ int PVFS_mgmt_get_config(
     config = PINT_get_server_config_struct(*fsid);
 
     mntent.the_pvfs_config_server =
-        (char*)PINT_cached_config_map_addr(config, *fsid, *addr, &server_type);
+        (char*)PINT_cached_config_map_addr(*fsid, *addr, &server_type);
 
     PINT_put_server_config_struct(config);
 

Index: mgmt-misc.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/mgmt-misc.c,v
diff -p -u -r1.28 -r1.29
--- mgmt-misc.c	19 Nov 2007 19:33:54 -0000	1.28
+++ mgmt-misc.c	14 Feb 2008 00:04:39 -0000	1.29
@@ -33,13 +33,7 @@ const char *PVFS_mgmt_map_addr(
     PVFS_BMI_addr_t addr,
     int *server_type)
 {
-    struct server_configuration_s *server_config =
-        PINT_get_server_config_struct(fs_id);
-    const char *ret = PINT_cached_config_map_addr(
-        server_config, fs_id, addr, server_type);
-
-    PINT_put_server_config_struct(server_config);
-    return ret;
+    return PINT_cached_config_map_addr(fs_id, addr, server_type);
 }
 
 PVFS_error PVFS_mgmt_map_handle(
@@ -47,8 +41,7 @@ PVFS_error PVFS_mgmt_map_handle(
     PVFS_handle handle,
     PVFS_BMI_addr_t *addr)
 {
-    return PINT_cached_config_map_to_server(
-        addr, handle, fs_id);
+    return PINT_cached_config_map_to_server(addr, handle, fs_id);
 }
 
 /** Obtains file system statistics from all servers in a given
@@ -66,15 +59,10 @@ PVFS_error PVFS_mgmt_statfs_all(
     PVFS_error ret = -PVFS_EINVAL;
     PVFS_BMI_addr_t *addr_array = NULL;
     int real_count = 0;
-    struct server_configuration_s *server_config = NULL;
-
-    server_config = PINT_get_server_config_struct(fs_id);
-    assert(server_config);
 
     ret = PINT_cached_config_count_servers(
-        server_config, fs_id,  PVFS_MGMT_IO_SERVER|PVFS_MGMT_META_SERVER,
+        fs_id,  PVFS_MGMT_IO_SERVER|PVFS_MGMT_META_SERVER,
         &real_count);
-    PINT_put_server_config_struct(server_config);
 
     if (ret < 0)
     {
@@ -95,14 +83,10 @@ PVFS_error PVFS_mgmt_statfs_all(
 	return -PVFS_ENOMEM;
     }
 
-    server_config = PINT_get_server_config_struct(fs_id);
-    assert(server_config);
-
     /* generate default list of servers */
     ret = PINT_cached_config_get_server_array(
-        server_config, fs_id, PVFS_MGMT_IO_SERVER|PVFS_MGMT_META_SERVER,
+        fs_id, PVFS_MGMT_IO_SERVER|PVFS_MGMT_META_SERVER,
         addr_array, &real_count);
-    PINT_put_server_config_struct(server_config);
 
     if (ret < 0)
     {
@@ -135,15 +119,8 @@ PVFS_error PVFS_mgmt_setparam_all(
     int count = 0;
     PVFS_error ret = -PVFS_EINVAL;
     PVFS_BMI_addr_t *addr_array = NULL;
-    struct server_configuration_s *server_config = NULL;
-
-    server_config = PINT_get_server_config_struct(fs_id);
-    assert(server_config);
-
     ret = PINT_cached_config_count_servers(
-        server_config, fs_id,
-        PVFS_MGMT_IO_SERVER|PVFS_MGMT_META_SERVER, &count);
-    PINT_put_server_config_struct(server_config);
+        fs_id, PVFS_MGMT_IO_SERVER|PVFS_MGMT_META_SERVER, &count);
 
     if (ret < 0)
     {
@@ -157,14 +134,10 @@ PVFS_error PVFS_mgmt_setparam_all(
 	return -PVFS_ENOMEM;
     }
 
-    server_config = PINT_get_server_config_struct(fs_id);
-    assert(server_config);
-
     /* generate default list of servers */
     ret = PINT_cached_config_get_server_array(
-        server_config, fs_id, PVFS_MGMT_IO_SERVER|PVFS_MGMT_META_SERVER,
+        fs_id, PVFS_MGMT_IO_SERVER|PVFS_MGMT_META_SERVER,
         addr_array, &count);
-    PINT_put_server_config_struct(server_config);
 
     if (ret < 0)
     {
@@ -217,14 +190,9 @@ PVFS_error PVFS_mgmt_get_server_array(
     int *inout_count_p)
 {
     PVFS_error ret = -PVFS_EINVAL;
-    struct server_configuration_s *server_config = NULL;
-
-    server_config = PINT_get_server_config_struct(fs_id);
-    assert(server_config);
 
     ret = PINT_cached_config_get_server_array(
-        server_config, fs_id, server_type, addr_array, inout_count_p);
-    PINT_put_server_config_struct(server_config);
+        fs_id, server_type, addr_array, inout_count_p);
     return ret;
 }
 
@@ -242,14 +210,8 @@ PVFS_error PVFS_mgmt_count_servers(
     int *count)
 {
     PVFS_error ret = -PVFS_EINVAL;
-    struct server_configuration_s *server_config = NULL;
 
-    server_config = PINT_get_server_config_struct(fs_id);
-    assert(server_config);
-
-    ret = PINT_cached_config_count_servers(
-        server_config, fs_id, server_type, count);
-    PINT_put_server_config_struct(server_config);
+    ret = PINT_cached_config_count_servers(fs_id, server_type, count);
     return ret;
 }
 

Index: sys-create.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/sys-create.sm,v
diff -p -u -r1.114 -r1.115
--- sys-create.sm	10 Dec 2007 16:13:53 -0000	1.114
+++ sys-create.sm	14 Feb 2008 00:04:39 -0000	1.115
@@ -538,7 +538,6 @@ static PINT_sm_action create_dspace_crea
     int ret = -PVFS_EINVAL;
     PVFS_handle_extent_array meta_handle_extent_array;
     PINT_sm_msgpair_state *msg_p = NULL;
-    struct server_configuration_s *server_config = NULL;
 
     gossip_debug(GOSSIP_CLIENT_DEBUG, "create state: "
                  "dspace_create_setup_msgpair\n");
@@ -559,15 +558,10 @@ static PINT_sm_action create_dspace_crea
 
     PINT_init_msgpair(sm_p, msg_p);
 
-    server_config = PINT_get_server_config_struct(
-        sm_p->object_ref.fs_id);
-
     ret = PINT_cached_config_get_next_meta(
-        server_config, sm_p->object_ref.fs_id,
+        sm_p->object_ref.fs_id,
         &msg_p->svr_addr, &meta_handle_extent_array);
 
-    PINT_put_server_config_struct(server_config);
-
     if (ret)
     {
         gossip_err("Failed to map meta server address\n");
@@ -595,7 +589,6 @@ static PINT_sm_action create_datafiles_s
 {
     struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
     int ret = -PVFS_EINVAL, i = 0;
-    struct server_configuration_s *server_config = NULL;
 
     gossip_debug(GOSSIP_CLIENT_DEBUG, "create state: "
                  "datafiles_setup_msgpair_array\n");
@@ -629,11 +622,7 @@ static PINT_sm_action create_datafiles_s
         return SM_ACTION_COMPLETE;
     }
 
-    server_config = PINT_get_server_config_struct(
-        sm_p->object_ref.fs_id);
-
     ret = PINT_cached_config_map_servers(
-        server_config,
         sm_p->object_ref.fs_id,
         &sm_p->u.create.num_data_files,
         &sm_p->u.create.layout,
@@ -645,8 +634,6 @@ static PINT_sm_action create_datafiles_s
         js_p->error_code = ret;
         return 1;
     }
-
-    PINT_put_server_config_struct(server_config);
 
     if (ret)
     {

Index: sys-mkdir.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/sys-mkdir.sm,v
diff -p -u -r1.62 -r1.63
--- sys-mkdir.sm	30 Aug 2007 00:13:42 -0000	1.62
+++ sys-mkdir.sm	14 Feb 2008 00:04:39 -0000	1.63
@@ -340,7 +340,6 @@ static PINT_sm_action mkdir_msg_setup_ms
     int ret = -PVFS_EINVAL;
     PVFS_handle_extent_array meta_handle_extent_array;
     PINT_sm_msgpair_state *msg_p = NULL;
-    struct server_configuration_s *server_config = NULL;
 
     gossip_debug(GOSSIP_CLIENT_DEBUG,
                  "mkdir state: mkdir_msg_setup_msgpair\n");
@@ -351,14 +350,9 @@ static PINT_sm_action mkdir_msg_setup_ms
 
     PINT_init_msgpair(sm_p, msg_p);
 
-    server_config = PINT_get_server_config_struct(
-        sm_p->object_ref.fs_id);
-
     ret = PINT_cached_config_get_next_meta(
-        server_config, sm_p->object_ref.fs_id,
+        sm_p->object_ref.fs_id,
         &msg_p->svr_addr, &meta_handle_extent_array);
-
-    PINT_put_server_config_struct(server_config);
 
     if (ret)
     {

Index: sys-statfs.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/sys-statfs.sm,v
diff -p -u -r1.7 -r1.8
--- sys-statfs.sm	30 Aug 2007 00:13:42 -0000	1.7
+++ sys-statfs.sm	14 Feb 2008 00:04:39 -0000	1.8
@@ -57,7 +57,6 @@ PVFS_error PVFS_isys_statfs(
 {
     PINT_smcb *smcb = NULL;
     PINT_client_sm *sm_p = NULL;
-    struct server_configuration_s *server_config = NULL;
     int ret = -1;
 
     gossip_debug(GOSSIP_CLIENT_DEBUG,
@@ -75,12 +74,9 @@ PVFS_error PVFS_isys_statfs(
     sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
 
     /* count the number of servers */
-    server_config = PINT_get_server_config_struct(fs_id);
-    assert(server_config);
     ret = PINT_cached_config_count_servers(
-        server_config, fs_id,  PVFS_MGMT_IO_SERVER|PVFS_MGMT_META_SERVER,
+        fs_id,  PVFS_MGMT_IO_SERVER|PVFS_MGMT_META_SERVER,
         &sm_p->u.statfs_list.count);
-    PINT_put_server_config_struct(server_config);
     if (ret < 0)
     {
         PINT_smcb_free(smcb);
@@ -106,12 +102,9 @@ PVFS_error PVFS_isys_statfs(
     }
 
     /* generate default list of servers */
-    server_config = PINT_get_server_config_struct(fs_id);
-    assert(server_config);
     ret = PINT_cached_config_get_server_array(
-        server_config, fs_id, PVFS_MGMT_IO_SERVER|PVFS_MGMT_META_SERVER,
+        fs_id, PVFS_MGMT_IO_SERVER|PVFS_MGMT_META_SERVER,
         sm_p->u.statfs_list.addr_array, &sm_p->u.statfs_list.count);
-    PINT_put_server_config_struct(server_config);
     if (ret < 0)
     {
         free(sm_p->u.statfs_list.addr_array);

Index: sys-symlink.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/sys-symlink.sm,v
diff -p -u -r1.70 -r1.71
--- sys-symlink.sm	30 Aug 2007 00:13:42 -0000	1.70
+++ sys-symlink.sm	14 Feb 2008 00:04:39 -0000	1.71
@@ -352,7 +352,6 @@ static PINT_sm_action symlink_dspace_cre
     int ret = -PVFS_EINVAL;
     PVFS_handle_extent_array meta_handle_extent_array;
     PINT_sm_msgpair_state *msg_p = NULL;
-    struct server_configuration_s *server_config = NULL;
 
     js_p->error_code = 0;
 
@@ -360,14 +359,9 @@ static PINT_sm_action symlink_dspace_cre
 
     PINT_init_msgpair(sm_p, msg_p);
 
-    server_config = PINT_get_server_config_struct(
-        sm_p->object_ref.fs_id);
-
     ret = PINT_cached_config_get_next_meta(
-        server_config, sm_p->object_ref.fs_id,
+        sm_p->object_ref.fs_id,
         &msg_p->svr_addr, &meta_handle_extent_array);
-
-    PINT_put_server_config_struct(server_config);
 
     if (ret)
     {



More information about the Pvfs2-cvs mailing list