[Pvfs2-cvs] commit by slang in pvfs2/src/common/misc: fsck-utils.c msgpairarray.sm pint-cached-config.c pint-cached-config.h pint-util.c pvfs2-internal.h server-config-mgr.c server-config.c server-config.h

CVS commit program cvs at parl.clemson.edu
Wed Feb 20 21:10:10 EST 2008


Update of /projects/cvsroot/pvfs2/src/common/misc
In directory parlweb1:/tmp/cvs-serv19046/src/common/misc

Modified Files:
      Tag: small-file-branch
	fsck-utils.c msgpairarray.sm pint-cached-config.c 
	pint-cached-config.h pint-util.c pvfs2-internal.h 
	server-config-mgr.c server-config.c server-config.h 
Log Message:
Big pile-o' changes to make Pete go mad.

The main changes are the implementation of the stuffed create path (now just the create state machine and operation), and the beginnings of the "unstuff" operation.

This also includes the request scheduler and state machine cleanups (required for using prelude with batch_remove) and whatever else I may have happened to change along the way.

This code is able to create files, but writing to them is almost guaranteed to break.


Index: fsck-utils.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/fsck-utils.c,v
diff -p -u -r1.7.2.1 -r1.7.2.2
--- fsck-utils.c	30 Jan 2008 20:26:33 -0000	1.7.2.1
+++ fsck-utils.c	21 Feb 2008 02:10:09 -0000	1.7.2.2
@@ -135,7 +135,6 @@ int PVFS_fsck_check_server_configs(
     char *fs_config_diff = NULL;
     char *reference_config_server = NULL;
     const char *server_name = NULL;
-    struct server_configuration_s *server_config_struct = NULL;
     FILE *pin = NULL;
     char line[130] = { 0 };
     char *cmd = NULL;
@@ -181,15 +180,10 @@ int PVFS_fsck_check_server_configs(
         server_name = NULL;
 
         /* get the pretty server name */
-        server_config_struct = PINT_get_server_config_struct(*cur_fs);
         server_name = PINT_cached_config_map_addr(
-                        server_config_struct,
-                        *cur_fs,
-                        addresses[i], &server_type);
+                        *cur_fs, addresses[i], &server_type);
         assert(server_name);
 
-        PINT_put_server_config_struct(server_config_struct);
-
         fs_config = calloc(FS_CONFIG_BUFFER_SIZE, sizeof(char));
         if (fs_config == NULL)
         {
@@ -1478,21 +1472,15 @@ static int PINT_handle_wrangler_display_
     int server_type = 0;
     PVFS_sysresp_getattr attributes;
     PVFS_object_ref pref;
-    struct server_configuration_s *config;
     const char *server_name = NULL;
     int header = 0;
 
     for (i = 0; i < PINT_handle_wrangler_handlelist.num_servers; i++)
     {
         /* get the pretty server name */
-        config = PINT_get_server_config_struct(*cur_fs);
-        server_name = PINT_cached_config_map_addr(config,
-                                                  *cur_fs,
-                                                  PINT_handle_wrangler_handlelist.
-                                                  addr_array[i], &server_type);
-
-        /* release mutex on server config */
-        PINT_put_server_config_struct(config);
+        server_name = PINT_cached_config_map_addr(
+            *cur_fs, PINT_handle_wrangler_handlelist.
+            addr_array[i], &server_type);
 
         for (j = 0; j < PINT_handle_wrangler_handlelist.size_array[i]; j++)
         {

Index: msgpairarray.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/msgpairarray.sm,v
diff -p -u -r1.44.6.1 -r1.44.6.2
--- msgpairarray.sm	6 Feb 2008 15:58:17 -0000	1.44.6.1
+++ msgpairarray.sm	21 Feb 2008 02:10:10 -0000	1.44.6.2
@@ -482,7 +482,6 @@ static PINT_sm_action msgpairarray_compl
     int need_retry = 0;
     struct PINT_decoded_msg decoded_resp;
     const char* server_string = NULL;
-    struct server_configuration_s *server_config = NULL;
     int server_type;
 
     /* response structure (decoded) */
@@ -646,14 +645,9 @@ static PINT_sm_action msgpairarray_compl
 
             } else {
                 char s[1024];
-                server_config = PINT_server_config_mgr_get_config(msg_p->fs_id);
-                if(server_config)
-                {
-                    server_string = PINT_cached_config_map_addr(
-                        server_config, msg_p->fs_id, msg_p->svr_addr, &server_type);
-                    PINT_server_config_mgr_put_config(server_config);
-                }
-                else
+                server_string = PINT_cached_config_map_addr(
+                    msg_p->fs_id, msg_p->svr_addr, &server_type);
+                if(!server_string)
                 {
                     server_string = "[UNKNOWN]";
                 }
@@ -716,7 +710,6 @@ int PINT_serv_decode_resp(PVFS_fs_id fs_
                           struct PVFS_server_resp **resp_out_pp)
 {
     int ret = -1, server_type = 0;
-    struct server_configuration_s *server_config;
     const char *server_string;
 
     ret = PINT_decode(encoded_resp_p, PINT_DECODE_RESP,
@@ -735,10 +728,8 @@ int PINT_serv_decode_resp(PVFS_fs_id fs_
 
             if (fs_id != PVFS_FS_ID_NULL)
             {
-                server_config = PINT_server_config_mgr_get_config(fs_id);
                 server_string = PINT_cached_config_map_addr(
-                    server_config, fs_id, *svr_addr_p, &server_type);
-                PINT_server_config_mgr_put_config(server_config);
+                    fs_id, *svr_addr_p, &server_type);
                 gossip_err("   Server: %s.\n", server_string);
             }
             else

Index: pint-cached-config.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/pint-cached-config.c,v
diff -p -u -r1.22.2.2 -r1.22.2.3
--- pint-cached-config.c	31 Jan 2008 17:39:49 -0000	1.22.2.2
+++ pint-cached-config.c	21 Feb 2008 02:10:10 -0000	1.22.2.3
@@ -71,8 +71,7 @@ do { cur = hrange_list;                 
          break;                                                  \
      }                                                           \
      cur_host_extent_table->bmi_address =                        \
-         PINT_config_get_host_addr_ptr(                          \
-             config,cur_mapping->alias_mapping->host_alias);     \
+         cur_mapping->alias_mapping->bmi_address;                \
      assert(cur_host_extent_table->bmi_address);                 \
      cur_host_extent_table->extent_list =                        \
          PINT_create_extent_list(cur_mapping->handle_range);     \
@@ -102,8 +101,7 @@ static int hash_fsid_compare(
     void *key, struct qlist_head *link);
 
 static void free_host_extent_table(void *ptr);
-static int cache_server_array(
-    struct server_configuration_s *config, PVFS_fs_id fsid);
+static int cache_server_array(PVFS_fs_id fsid);
 
 static int meta_randomized = 0;
 static int io_randomized = 0;
@@ -221,7 +219,7 @@ int PINT_cached_config_reinitialize(
                 break;
             }
 
-            ret = PINT_handle_load_mapping(config, cur_fs);
+            ret = PINT_cached_config_handle_load_mapping(cur_fs);
             if (ret)
             {
                 break;
@@ -232,7 +230,7 @@ int PINT_cached_config_reinitialize(
     return 0;
 }
 
-/* PINT_handle_load_mapping()
+/* PINT_cached_config_handle_load_mapping()
  *
  * loads a new mapping of servers to handle into this interface.  This
  * function may be called multiple times in order to add new file
@@ -240,8 +238,7 @@ int PINT_cached_config_reinitialize(
  *
  * returns 0 on success, -errno on failure
  */
-int PINT_handle_load_mapping(
-    struct server_configuration_s *config,
+int PINT_cached_config_handle_load_mapping(
     struct filesystem_configuration_s *fs)
 {
     int ret = -PVFS_EINVAL;
@@ -250,7 +247,7 @@ int PINT_handle_load_mapping(
     struct config_fs_cache_s *cur_config_fs_cache = NULL;
     struct bmi_host_extent_table_s *cur_host_extent_table = NULL;
 
-    if (config && fs)
+    if (fs)
     {
         cur_config_fs_cache = (struct config_fs_cache_s *)
             malloc(sizeof(struct config_fs_cache_s));
@@ -308,7 +305,6 @@ int PINT_handle_load_mapping(
  * returns 0 on success, -errno on failure
  */
 int PINT_cached_config_get_server(
-    struct server_configuration_s *config,
     PVFS_fs_id fsid,
     const char* host,
     PVFS_ds_type type,
@@ -319,7 +315,7 @@ int PINT_cached_config_get_server(
     struct config_fs_cache_s *cur_config_cache = NULL;
     PINT_llist* server_cursor;
 
-    if (!config || !ext_array)
+    if (!ext_array)
     {
         return(-PVFS_EINVAL);
     }
@@ -390,7 +386,6 @@ int PINT_cached_config_get_server(
  * returns 0 on success, -errno on failure
  */
 int PINT_cached_config_get_next_meta(
-    struct server_configuration_s *config,
     PVFS_fs_id fsid,
     PVFS_BMI_addr_t *meta_addr,
     PVFS_handle_extent_array *ext_array)
@@ -401,7 +396,7 @@ int PINT_cached_config_get_next_meta(
     struct qlist_head *hash_link = NULL;
     struct config_fs_cache_s *cur_config_cache = NULL;
 
-    if (config && ext_array)
+    if (ext_array)
     {
         hash_link = qhash_search(PINT_fsid_config_cache_table,&(fsid));
         if (hash_link)
@@ -442,8 +437,7 @@ int PINT_cached_config_get_next_meta(
                 cur_config_cache->meta_server_cursor = PINT_llist_next(
                     cur_config_cache->meta_server_cursor);
             }
-            meta_server_bmi_str = PINT_config_get_host_addr_ptr(
-                config,cur_mapping->alias_mapping->host_alias);
+            meta_server_bmi_str = cur_mapping->alias_mapping->bmi_address;
 
             ext_array->extent_count =
                 cur_mapping->handle_extent_array.extent_count;
@@ -464,7 +458,6 @@ int PINT_cached_config_get_next_meta(
 }
 
 static int PINT_cached_config_get_extents(
-    struct server_configuration_s *config,
     PVFS_fs_id fsid,
     PVFS_BMI_addr_t *addr,
     PVFS_handle_extent_array *handle_extents)
@@ -499,8 +492,7 @@ static int PINT_cached_config_get_extent
         server_list = PINT_llist_next(server_list);
 
         ret = BMI_addr_lookup(
-            &tmp_addr, PINT_config_get_host_addr_ptr(
-                config, cur_mapping->alias_mapping->host_alias));
+            &tmp_addr, cur_mapping->alias_mapping->bmi_address);
         if(ret < 0)
         {
             return ret;
@@ -520,7 +512,6 @@ static int PINT_cached_config_get_extent
 }
 
 int PINT_cached_config_map_servers(
-    struct server_configuration_s *config,
     PVFS_fs_id fsid,
     int *inout_num_datafiles,
     PVFS_sys_layout *layout,
@@ -535,9 +526,7 @@ int PINT_cached_config_map_servers(
     int start_index = -1;
     int index;
 
-    assert(config);
     assert(inout_num_datafiles);
-    assert(handle_extent_array);
 
     hash_link = qhash_search(PINT_fsid_config_cache_table,&(fsid));
     if(!hash_link)
@@ -569,15 +558,18 @@ int PINT_cached_config_map_servers(
             *inout_num_datafiles = layout->server_list.count;
             for(i = 0; i < layout->server_list.count; ++i)
             {
-                ret = PINT_cached_config_get_extents(
-                    config, fsid,
-                    &layout->server_list.servers[i],
-                    &handle_extent_array[i]);
-                if(ret < 0)
+                if(handle_extent_array)
                 {
-                    gossip_err("The address specified in the datafile "
-                                "layout is invalid\n");
-                    return ret;
+                    ret = PINT_cached_config_get_extents(
+                        fsid,
+                        &layout->server_list.servers[i],
+                        &handle_extent_array[i]);
+                    if(ret < 0)
+                    {
+                        gossip_err("The address specified in the datafile "
+                                   "layout is invalid\n");
+                        return ret;
+                    }
                 }
 
                 addr_array[i] = layout->server_list.servers[i];
@@ -608,17 +600,20 @@ int PINT_cached_config_map_servers(
 
                 index = (i + start_index) % *inout_num_datafiles;
                 ret = BMI_addr_lookup(
-                    &addr_array[index], PINT_config_get_host_addr_ptr(
-                        config, cur_mapping->alias_mapping->host_alias));
+                    &addr_array[index],
+                    cur_mapping->alias_mapping->bmi_address);
                 if (ret)
                 {
                     return ret;
                 }
 
-                handle_extent_array[index].extent_count =
-                    cur_mapping->handle_extent_array.extent_count;
-                handle_extent_array[index].extent_array =
-                    cur_mapping->handle_extent_array.extent_array;
+                if(handle_extent_array)
+                {
+                    handle_extent_array[index].extent_count =
+                        cur_mapping->handle_extent_array.extent_count;
+                    handle_extent_array[index].extent_array =
+                        cur_mapping->handle_extent_array.extent_array;
+                }
             }
             break;
 
@@ -647,18 +642,19 @@ int PINT_cached_config_map_servers(
                         /* found an unused index */
                         ret = BMI_addr_lookup(
                             &addr_array[index],
-                            PINT_config_get_host_addr_ptr(
-                                config,
-                                cur_mapping->alias_mapping->host_alias));
+                            cur_mapping->alias_mapping->bmi_address);
                         if (ret)
                         {
                             return ret;
                         }
 
-                        handle_extent_array[index].extent_count =
-                            cur_mapping->handle_extent_array.extent_count;
-                        handle_extent_array[index].extent_array =
-                            cur_mapping->handle_extent_array.extent_array;
+                        if(handle_extent_array)
+                        {
+                            handle_extent_array[index].extent_count =
+                                cur_mapping->handle_extent_array.extent_count;
+                            handle_extent_array[index].extent_array =
+                                cur_mapping->handle_extent_array.extent_array;
+                        }
                     }
                 }
             }
@@ -670,7 +666,6 @@ int PINT_cached_config_map_servers(
     return 0;
 }
 
-
 /* PINT_cached_config_get_next_io()
  *
  * returns the address of a set of servers that should be used to
@@ -682,7 +677,6 @@ int PINT_cached_config_map_servers(
  * returns 0 on success, -errno on failure
  */
 int PINT_cached_config_get_next_io(
-    struct server_configuration_s *config,
     PVFS_fs_id fsid,
     int num_servers,
     PVFS_BMI_addr_t *io_addr_array,
@@ -696,7 +690,7 @@ int PINT_cached_config_get_next_io(
     int jitter = 0, num_io_servers = 0;
     PINT_llist* old_data_server_cursor = NULL;
 
-    if (config && num_servers && io_handle_extent_array)
+    if (num_servers && io_handle_extent_array)
     {
         hash_link = qhash_search(PINT_fsid_config_cache_table,&(fsid));
         if (hash_link)
@@ -753,8 +747,7 @@ int PINT_cached_config_get_next_io(
                 cur_config_cache->data_server_cursor = PINT_llist_next(
                     cur_config_cache->data_server_cursor);
 
-                data_server_bmi_str = PINT_config_get_host_addr_ptr(
-                    config,cur_mapping->alias_mapping->host_alias);
+                data_server_bmi_str = cur_mapping->alias_mapping->bmi_address;
 
 		if (io_addr_array != NULL)
 		{
@@ -794,8 +787,7 @@ int PINT_cached_config_get_next_io(
  * returns pointer to string on success, NULL on failure
  */
 const char *PINT_cached_config_map_addr(
-    struct server_configuration_s *config,
-    PVFS_fs_id fsid, 
+    PVFS_fs_id fsid,
     PVFS_BMI_addr_t addr,
     int *server_type)
 {
@@ -803,11 +795,6 @@ const char *PINT_cached_config_map_addr(
     struct qlist_head *hash_link = NULL;
     struct config_fs_cache_s *cur_config_cache = NULL;
 
-    if (!config)
-    {
-        return NULL;
-    }
-
     hash_link = qhash_search(PINT_fsid_config_cache_table,&(fsid));
     if (!hash_link)
     {
@@ -818,7 +805,7 @@ const char *PINT_cached_config_map_addr(
     assert(cur_config_cache);
     assert(cur_config_cache->fs);
 
-    ret = cache_server_array(config, fsid);
+    ret = cache_server_array(fsid);
     if (ret < 0)
     {
         return NULL;
@@ -846,7 +833,6 @@ const char *PINT_cached_config_map_addr(
  * returns 0 on success, -errno on failure
  */
 int PINT_cached_config_count_servers(
-    struct server_configuration_s *config,
     PVFS_fs_id fsid, 
     int server_type,
     int *count)
@@ -855,7 +841,7 @@ int PINT_cached_config_count_servers(
     struct qlist_head *hash_link = NULL;
     struct config_fs_cache_s *cur_config_cache = NULL;
 
-    if (!config || !server_type)
+    if (!server_type)
     {
         return ret;
     }
@@ -871,7 +857,7 @@ int PINT_cached_config_count_servers(
     assert(cur_config_cache);
     assert(cur_config_cache->fs);
 
-    ret = cache_server_array(config, fsid);
+    ret = cache_server_array(fsid);
     if (ret == 0)
     {
         if (server_type == PINT_SERVER_TYPE_META)
@@ -903,7 +889,6 @@ int PINT_cached_config_count_servers(
  * returns 0 on success, -errno on failure
  */
 int PINT_cached_config_get_server_array(
-    struct server_configuration_s *config,
     PVFS_fs_id fsid,
     int server_type,
     PVFS_BMI_addr_t *addr_array,
@@ -913,7 +898,7 @@ int PINT_cached_config_get_server_array(
     struct qlist_head *hash_link = NULL;
     struct config_fs_cache_s *cur_config_cache = NULL;
 
-    if (!config || !inout_count_p || !*inout_count_p ||
+    if (!inout_count_p || !*inout_count_p ||
         !addr_array || !server_type)
     {
         return ret;
@@ -930,7 +915,7 @@ int PINT_cached_config_get_server_array(
     assert(cur_config_cache);
     assert(cur_config_cache->fs);
 
-    ret = cache_server_array(config, fsid);
+    ret = cache_server_array(fsid);
     if (ret < 0)
     {
         return ret;
@@ -1310,6 +1295,76 @@ int PINT_cached_config_get_handle_timeou
     return ret;
 }
 
+int PINT_cached_config_get_server_list(
+    PVFS_fs_id fs_id,
+    PINT_dist *dist,
+    int num_dfiles_req,
+    PVFS_sys_layout *layout,
+    const char ***server_names,
+    int *server_count)
+{
+    int num_io_servers, ret, i;
+    PVFS_BMI_addr_t *server_addrs;
+    const char **servers;
+
+    /* find the server list from the layout */
+    ret = PINT_cached_config_get_num_dfiles(
+        fs_id,
+        dist,
+        num_dfiles_req,
+        &num_io_servers);
+    if (ret < 0)
+    {
+        gossip_err("Failed to get number of data servers\n");
+        return ret;
+    }
+
+    if(num_io_servers > PVFS_REQ_LIMIT_DFILE_COUNT)
+    {
+        num_io_servers = PVFS_REQ_LIMIT_DFILE_COUNT;
+        gossip_err("Warning: reducing number of data "
+                     "files to PVFS_REQ_LIMIT_DFILE_COUNT\n");
+    }
+
+    server_addrs = malloc(sizeof(*server_addrs) * num_io_servers);
+    if(!server_addrs)
+    {
+        gossip_err("Failed to allocate server address list\n");
+        return -PVFS_ENOMEM;
+    }
+
+    ret = PINT_cached_config_map_servers(
+        fs_id,
+        &num_io_servers,
+        layout,
+        server_addrs,
+        NULL);
+    if(ret != 0)
+    {
+        gossip_err("Failed to get IO server addrs from layout\n");
+        return ret;
+    }
+
+    servers = malloc(sizeof(*servers) * num_io_servers);
+    if(!servers)
+    {
+        gossip_err("Failed to allocate server address list\n");
+        free(server_addrs);
+        return -PVFS_ENOMEM;
+    }
+
+    for(i = 0; i < num_io_servers; ++i)
+    {
+        servers[i] = BMI_addr_rev_lookup(server_addrs[i]);
+    }
+    free(server_addrs);
+
+    *server_count = num_io_servers;
+    *server_names = servers;
+
+    return 0;
+}
+
 /* cache_server_array()
  *
  * verifies that the arrays of physical server addresses have been
@@ -1318,7 +1373,6 @@ int PINT_cached_config_get_handle_timeou
  * returns 0 on success, -errno on failure
  */
 static int cache_server_array(
-    struct server_configuration_s *config,
     PVFS_fs_id fsid)
 {
     int ret = -PVFS_EINVAL, i = 0, j = 0;
@@ -1332,11 +1386,6 @@ static int cache_server_array(
     int current = 0;
     int array_index = 0, array_index2 = 0;
 
-    if (!config)
-    {
-        return ret;
-    }
-
     hash_link = qhash_search(PINT_fsid_config_cache_table,&(fsid));
     if (!hash_link)
     {
@@ -1417,8 +1466,7 @@ static int cache_server_array(
             while ((cur_mapping = PINT_llist_head(tmp_server)))
             {
                 tmp_server = PINT_llist_next(tmp_server);
-                server_bmi_str = PINT_config_get_host_addr_ptr(
-                    config,cur_mapping->alias_mapping->host_alias);
+                server_bmi_str = cur_mapping->alias_mapping->bmi_address;
 
                 ret = BMI_addr_lookup(&tmp_bmi_addr,server_bmi_str);
                 if (ret < 0)

Index: pint-cached-config.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/pint-cached-config.h,v
diff -p -u -r1.11.2.2 -r1.11.2.3
--- pint-cached-config.h	31 Jan 2008 17:39:49 -0000	1.11.2.2
+++ pint-cached-config.h	21 Feb 2008 02:10:10 -0000	1.11.2.3
@@ -28,57 +28,48 @@ int PINT_cached_config_initialize(void);
 
 int PINT_cached_config_finalize(void);
 
-int PINT_handle_load_mapping(
-    struct server_configuration_s *config,
+int PINT_cached_config_handle_load_mapping(
     struct filesystem_configuration_s *fs);
 
 int PINT_cached_config_map_alias(
-    struct server_configuration_s *config,
     const char *alias,
     PVFS_BMI_addr_t *addr);
 
 int PINT_cached_config_get_server(
-    struct server_configuration_s *config,
     PVFS_fs_id fsid,
     const char* host,
     PVFS_ds_type type,
     PVFS_handle_extent_array *ext_array);
 
 int PINT_cached_config_get_next_meta(
-    struct server_configuration_s *config,
     PVFS_fs_id fsid,
     PVFS_BMI_addr_t *meta_addr,
     PVFS_handle_extent_array *meta_extent_array);
 
 int PINT_cached_config_get_io(
-    struct server_configuration_s *config,
     PVFS_fs_id fsid,
     const char* host,
     PVFS_BMI_addr_t *io_addr,
     PVFS_handle_extent_array *ext_array);
 
 int PINT_cached_config_get_next_io(
-    struct server_configuration_s *config,
     PVFS_fs_id fsid,
     int num_servers,
     PVFS_BMI_addr_t *io_addr_array,
     PVFS_handle_extent_array *io_handle_extent_array);
 
 const char *PINT_cached_config_map_addr(
-    struct server_configuration_s *config,
     PVFS_fs_id fsid,
     PVFS_BMI_addr_t addr,
     int *server_type);
  
 int PINT_cached_config_get_server_array(
-    struct server_configuration_s *config,
     PVFS_fs_id fsid,
     int server_type,
     PVFS_BMI_addr_t *addr_array,
     int *inout_count_p);
 
 int PINT_cached_config_count_servers(
-    struct server_configuration_s *config,
     PVFS_fs_id fsid,
     int server_type,
     int *count);
@@ -89,7 +80,6 @@ int PINT_cached_config_map_to_server(
     PVFS_fs_id fs_id);
 
 int PINT_cached_config_map_servers(
-    struct server_configuration_s *config,
     PVFS_fs_id fsid,
     int *inout_num_datafiles,
     PVFS_sys_layout *layout,
@@ -120,7 +110,7 @@ int PINT_cached_config_get_server_handle
     const char *server_addr_str,
     PVFS_fs_id fs_id,
     uint64_t *handle_count);
-    
+
 int PINT_cached_config_get_root_handle(
     PVFS_fs_id fsid,
     PVFS_handle *fh_root);
@@ -128,6 +118,14 @@ int PINT_cached_config_get_root_handle(
 int PINT_cached_config_get_handle_timeout(
     PVFS_fs_id fsid,
     struct timeval *timeout);
+
+int PINT_cached_config_get_server_list(
+    PVFS_fs_id fs_id,
+    PINT_dist *dist,
+    int num_dfiles_req,
+    PVFS_sys_layout *layout,
+    const char ***server_names,
+    int *server_count);
 
 int PINT_cached_config_reinitialize(
     struct server_configuration_s *config);

Index: pint-util.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/pint-util.c,v
diff -p -u -r1.25.2.1 -r1.25.2.2
--- pint-util.c	31 Jan 2008 17:39:49 -0000	1.25.2.1
+++ pint-util.c	21 Feb 2008 02:10:10 -0000	1.25.2.2
@@ -16,8 +16,10 @@
 #include <sys/resource.h>
 #include <unistd.h>
 
+#define __PINT_REQPROTO_ENCODE_FUNCS_C
 #include "gen-locks.h"
 #include "pint-util.h"
+#include "bmi.h"
 
 void PINT_time_mark(PINT_time_marker *out_marker)
 {
@@ -343,6 +345,21 @@ void PINT_util_gen_credentials(
     memset(credentials, 0, sizeof(PVFS_credentials));
     credentials->uid = geteuid();
     credentials->gid = getegid();
+}
+
+inline void encode_PVFS_BMI_addr_t(char **pptr, const PVFS_BMI_addr_t *x)
+{
+    const char *addr_str;
+
+    addr_str = BMI_addr_rev_lookup(*x);
+    encode_string(pptr, &addr_str);
+}
+
+inline void decode_PVFS_BMI_addr_t(char **pptr, PVFS_BMI_addr_t *x)
+{
+    char *addr_string;
+    decode_string(pptr, &addr_string);
+    BMI_addr_lookup(x, addr_string);
 }
 
 /*

Index: pvfs2-internal.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/pvfs2-internal.h,v
diff -p -u -r1.7 -r1.7.8.1
--- pvfs2-internal.h	1 Dec 2006 09:53:34 -0000	1.7
+++ pvfs2-internal.h	21 Feb 2008 02:10:10 -0000	1.7.8.1
@@ -8,6 +8,7 @@
 #define PVFS2_INTERNAL_H
 
 #include "pvfs2-config.h"
+#include "bmi.h"
 
 /* Printf wrappers for 32- and 64-bit compatibility.  Imagine trying
  * to print out a PVFS_handle, which is typedefed to a uint64_t.  On
@@ -77,6 +78,12 @@
 
 #define SYMLINK_TARGET_KEYSTR   "st\0"
 #define SYMLINK_TARGET_KEYLEN   3
+
+#define METAFILE_LAYOUT_KEYSTR  "ml\0"
+#define METAFILE_LAYOUT_KEYLEN  3
+
+#define NUM_DFILES_REQ_KEYSTR   "nd\0"
+#define NUM_DFILES_REQ_KEYLEN   3
 
 /* Optional xattrs have "user.pvfs2." as a prefix */
 #define SPECIAL_DIST_NAME_KEYSTR        "dist_name\0"

Index: server-config-mgr.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/server-config-mgr.c,v
diff -p -u -r1.18 -r1.18.2.1
--- server-config-mgr.c	10 Jan 2008 15:52:00 -0000	1.18
+++ server-config-mgr.c	21 Feb 2008 02:10:10 -0000	1.18.2.1
@@ -191,11 +191,11 @@ int PINT_server_config_mgr_reload_cached
                              "Reloading handle mappings for fs_id %d\n",
                              cur_fs->coll_id);
 
-                ret = PINT_handle_load_mapping(
-                    config->server_config, cur_fs);
+                ret = PINT_cached_config_handle_load_mapping(cur_fs);
                 if (ret)
                 {
-                    PVFS_perror("PINT_handle_load_mapping failed", ret);
+                    PVFS_perror(
+                        "PINT_cached_config_handle_load_mapping failed", ret);
                     gen_mutex_unlock(&s_server_config_mgr_mutex);
                     return ret;
                 }

Index: server-config.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/server-config.c,v
diff -p -u -r1.106.6.1 -r1.106.6.2
--- server-config.c	19 Feb 2008 15:31:54 -0000	1.106.6.1
+++ server-config.c	21 Feb 2008 02:10:10 -0000	1.106.6.2
@@ -112,6 +112,7 @@ static DOTCONF_CB(get_secret_key);
 static DOTCONF_CB(get_coalescing_high_watermark);
 static DOTCONF_CB(get_coalescing_low_watermark);
 static DOTCONF_CB(get_trove_method);
+static DOTCONF_CB(get_small_file_size);
 
 static FUNC_ERRORHANDLER(errorhandler);
 const char *contextchecker(command_t *cmd, unsigned long mask);
@@ -909,6 +910,9 @@ static const configoption_t options[] =
      */
     {"SecretKey",ARG_STR, get_secret_key,NULL,CTX_FILESYSTEM,NULL},
 
+    /* Specifies the size of the small file transition point */
+    {"SmallFileSize", ARG_INT, get_small_file_size, NULL, CTX_FILESYSTEM, NULL},
+
     LAST_OPTION
 };
 
@@ -2643,6 +2647,20 @@ DOTCONF_CB(get_trove_method)
     }
     return NULL;
 }
+
+DOTCONF_CB(get_small_file_size)
+{
+    struct server_configuration_s *config_s =
+        (struct server_configuration_s *)cmd->context;
+
+    /* we must be in a storagehints inside a filesystem context */
+    struct filesystem_configuration_s *fs_conf =
+        (struct filesystem_configuration_s *) PINT_llist_head(config_s->file_systems);
+
+    fs_conf->small_file_size = cmd->data.value;
+    return NULL;
+}
+
 
 /*
  * Function: PINT_config_release

Index: server-config.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/server-config.h,v
diff -p -u -r1.60.6.1 -r1.60.6.2
--- server-config.h	19 Feb 2008 15:31:54 -0000	1.60.6.1
+++ server-config.h	21 Feb 2008 02:10:10 -0000	1.60.6.2
@@ -115,6 +115,8 @@ typedef struct filesystem_configuration_
 
     PVFS_uid exp_anon_uid;
     PVFS_gid exp_anon_gid;
+
+    int32_t small_file_size;
 } filesystem_configuration_s;
 
 typedef struct distribution_param_configuration_s



More information about the Pvfs2-cvs mailing list