[Pvfs2-cvs] commit by pcarns in pvfs2-1/src/common/misc:
pint-cached-config.c pint-cached-config.h
CVS commit program
cvs at parl.clemson.edu
Thu Feb 21 09:34:33 EST 2008
Update of /projects/cvsroot/pvfs2-1/src/common/misc
In directory parlweb1:/tmp/cvs-serv3393/src/common/misc
Modified Files:
Tag: small-file-branch
pint-cached-config.c pint-cached-config.h
Log Message:
Make precreate pools safe for split io server / meta server configurations.
Only meta servers are supposed to spool up precreated handles.
Index: pint-cached-config.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/common/misc/pint-cached-config.c,v
diff -p -u -r1.22.2.3 -r1.22.2.4
--- pint-cached-config.c 21 Feb 2008 02:10:10 -0000 1.22.2.3
+++ pint-cached-config.c 21 Feb 2008 14:34:33 -0000 1.22.2.4
@@ -826,6 +826,52 @@ const char *PINT_cached_config_map_addr(
return NULL;
}
+
+/* PINT_cached_config_check_type()
+ *
+ * Retrieves the server type flags for a specified BMI addr string
+ *
+ * returns 0 on success, -errno on failure
+ */
+int PINT_cached_config_check_type(
+ PVFS_fs_id fsid,
+ const char *server_addr_str,
+ int* server_type)
+{
+ int ret = -PVFS_EINVAL, i = 0;
+ struct qlist_head *hash_link = NULL;
+ struct config_fs_cache_s *cur_config_cache = NULL;
+
+ hash_link = qhash_search(PINT_fsid_config_cache_table,&(fsid));
+ if (!hash_link)
+ {
+ return(-PVFS_EINVAL);
+ }
+ cur_config_cache = qlist_entry(
+ hash_link, struct config_fs_cache_s, hash_link);
+ assert(cur_config_cache);
+ assert(cur_config_cache->fs);
+
+ ret = cache_server_array(fsid);
+ if (ret < 0)
+ {
+ return(ret);
+ }
+
+ /* run through general server list for a match */
+ for(i = 0; i < cur_config_cache->server_count; i++)
+ {
+ if (!(strcmp(cur_config_cache->server_array[i].addr_string,
+ server_addr_str)))
+ {
+ *server_type = cur_config_cache->server_array[i].server_type;
+ return(0);
+ }
+ }
+ return(-PVFS_EINVAL);
+}
+
+
/* PINT_cached_config_count_servers()
*
* counts the number of physical servers of the specified type
Index: pint-cached-config.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/common/misc/pint-cached-config.h,v
diff -p -u -r1.11.2.3 -r1.11.2.4
--- pint-cached-config.h 21 Feb 2008 02:10:10 -0000 1.11.2.3
+++ pint-cached-config.h 21 Feb 2008 14:34:33 -0000 1.11.2.4
@@ -111,6 +111,11 @@ int PINT_cached_config_get_server_handle
PVFS_fs_id fs_id,
uint64_t *handle_count);
+int PINT_cached_config_check_type(
+ PVFS_fs_id fsid,
+ const char *server_addr_str,
+ int* server_type);
+
int PINT_cached_config_get_root_handle(
PVFS_fs_id fsid,
PVFS_handle *fh_root);
More information about the Pvfs2-cvs
mailing list