[PVFS2-CVS]
commit by neill in pvfs2/src/common/misc: server-config-mgr.c
server-config-mgr.h
CVS commit program
cvs at parl.clemson.edu
Tue Jul 27 18:26:23 EDT 2004
Update of /projects/cvsroot/pvfs2/src/common/misc
In directory parlweb:/tmp/cvs-serv2768/src/common/misc
Modified Files:
server-config-mgr.c server-config-mgr.h
Log Message:
- add a method that can return the absolute minimum handle recycle time
(in seconds) across all filesystems and configured servers
Index: server-config-mgr.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/server-config-mgr.c,v
diff -p -u -r1.8 -r1.9
--- server-config-mgr.c 22 Jul 2004 16:21:41 -0000 1.8
+++ server-config-mgr.c 27 Jul 2004 21:26:23 -0000 1.9
@@ -37,6 +37,13 @@ typedef struct
static struct qhash_table *s_fsid_to_config_table = NULL;
static gen_mutex_t *s_server_config_mgr_mutex = NULL;
+/*
+ while loading configuration settings for all known file systems
+ (across all configured servers), we keep track of the minimum handle
+ recycle timeout for *any* file system, and expose this value since
+ this is the only place that has access to all of this information.
+*/
+static int s_min_handle_recycle_timeout_in_sec = -1;
static int hash_fsid(void *key, int table_size);
static int hash_fsid_compare(void *key, struct qlist_head *link);
@@ -70,6 +77,7 @@ int PINT_server_config_mgr_initialize(vo
s_server_config_mgr_mutex = gen_mutex_build();
if (s_server_config_mgr_mutex)
{
+ s_min_handle_recycle_timeout_in_sec = -1;
ret = 0;
}
else
@@ -122,6 +130,7 @@ int PINT_server_config_mgr_finalize(void
gen_mutex_unlock(s_server_config_mgr_mutex);
gen_mutex_destroy(s_server_config_mgr_mutex);
s_server_config_mgr_mutex = NULL;
+ s_min_handle_recycle_timeout_in_sec = -1;
ret = 0;
}
@@ -169,6 +178,20 @@ int PINT_server_config_mgr_reload_cached
cur_fs = PINT_llist_head(cur);
assert(cur_fs);
+ assert(cur_fs->handle_recycle_timeout_sec.tv_sec > -1);
+
+ /* find the minimum handle recycle timeout here */
+ if ((cur_fs->handle_recycle_timeout_sec.tv_sec <
+ s_min_handle_recycle_timeout_in_sec) ||
+ (s_min_handle_recycle_timeout_in_sec == -1))
+ {
+ s_min_handle_recycle_timeout_in_sec =
+ cur_fs->handle_recycle_timeout_sec.tv_sec;
+
+ gossip_debug(GOSSIP_CLIENT_DEBUG, "Set min handle "
+ "recycle time to %d seconds\n",
+ s_min_handle_recycle_timeout_in_sec);
+ }
gossip_debug(GOSSIP_CLIENT_DEBUG,
"Reloading handle mappings for fs_id %d\n",
@@ -380,6 +403,12 @@ void __PINT_server_config_mgr_put_config
}
gen_mutex_unlock(s_server_config_mgr_mutex);
}
+}
+
+int PINT_server_config_mgr_get_abs_min_handle_recycle_time(void)
+{
+ assert(s_min_handle_recycle_timeout_in_sec != -1);
+ return s_min_handle_recycle_timeout_in_sec;
}
static int hash_fsid(void *key, int table_size)
Index: server-config-mgr.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/server-config-mgr.h,v
diff -p -u -r1.3 -r1.4
--- server-config-mgr.h 22 Jul 2004 16:21:41 -0000 1.3
+++ server-config-mgr.h 27 Jul 2004 21:26:23 -0000 1.4
@@ -28,6 +28,8 @@ struct server_configuration_s *__PINT_se
void __PINT_server_config_mgr_put_config(
struct server_configuration_s *config_s);
+int PINT_server_config_mgr_get_abs_min_handle_recycle_time(void);
+
/* client and server retrieve fs configuration from different sources */
#if defined(__PVFS2_CLIENT__)
#define PINT_server_config_mgr_get_config __PINT_server_config_mgr_get_config
More information about the PVFS2-CVS
mailing list