gfs2-utils: master - Revert "gfs_controld: Remove three unused functions"
David Teigland
teigland at fedoraproject.org
Thu Oct 15 18:59:57 UTC 2009
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=8428fc6366ab3948099258548a325c7d34f182fb
Commit: 8428fc6366ab3948099258548a325c7d34f182fb
Parent: b5c970dd8facb2b78aefc1b91ecd90bca192044e
Author: David Teigland <teigland at redhat.com>
AuthorDate: Thu Oct 15 11:42:41 2009 -0500
Committer: David Teigland <teigland at redhat.com>
CommitterDate: Thu Oct 15 11:42:41 2009 -0500
Revert "gfs_controld: Remove three unused functions"
This reverts commit b5c970dd8facb2b78aefc1b91ecd90bca192044e.
---
group/gfs_controld/cpg-new.c | 36 ++++++++++++++++++++++++++++++++++++
group/gfs_controld/gfs_daemon.h | 3 +++
group/gfs_controld/main.c | 11 +++++++++++
3 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/group/gfs_controld/cpg-new.c b/group/gfs_controld/cpg-new.c
index e355590..23b7a86 100644
--- a/group/gfs_controld/cpg-new.c
+++ b/group/gfs_controld/cpg-new.c
@@ -530,6 +530,42 @@ static void node_history_init(struct mountgroup *mg, int nodeid,
node->added_seq = cg->seq; /* for queries */
}
+void node_history_cluster_add(int nodeid)
+{
+ struct mountgroup *mg;
+ struct node *node;
+
+ list_for_each_entry(mg, &mountgroups, list) {
+ node_history_init(mg, nodeid, NULL);
+
+ node = get_node_history(mg, nodeid);
+ if (!node) {
+ log_error("node_history_cluster_add no nodeid %d",
+ nodeid);
+ return;
+ }
+
+ node->cluster_add_time = time(NULL);
+ }
+}
+
+void node_history_cluster_remove(int nodeid)
+{
+ struct mountgroup *mg;
+ struct node *node;
+
+ list_for_each_entry(mg, &mountgroups, list) {
+ node = get_node_history(mg, nodeid);
+ if (!node) {
+ log_error("node_history_cluster_remove no nodeid %d",
+ nodeid);
+ return;
+ }
+
+ node->cluster_remove_time = time(NULL);
+ }
+}
+
static void node_history_start(struct mountgroup *mg, int nodeid)
{
struct node *node;
diff --git a/group/gfs_controld/gfs_daemon.h b/group/gfs_controld/gfs_daemon.h
index 7199c00..1d89497 100644
--- a/group/gfs_controld/gfs_daemon.h
+++ b/group/gfs_controld/gfs_daemon.h
@@ -189,6 +189,8 @@ int set_mountgroups(int *count, struct gfsc_mountgroup **mgs_out);
int set_mountgroup_nodes(struct mountgroup *mg, int option, int *node_count,
struct gfsc_node **nodes_out);
void free_mg(struct mountgroup *mg);
+void node_history_cluster_add(int nodeid);
+void node_history_cluster_remove(int nodeid);
/* main.c */
int do_read(int fd, void *buf, size_t count);
@@ -200,6 +202,7 @@ void client_ignore(int ci, int fd);
void client_back(int ci, int fd);
struct mountgroup *create_mg(char *name);
struct mountgroup *find_mg(char *name);
+struct mountgroup *find_mg_id(uint32_t id);
void client_reply_remount(struct mountgroup *mg, int ci, int result);
void client_reply_join(int ci, struct gfsc_mount_args *ma, int result);
void client_reply_join_full(struct mountgroup *mg, int result);
diff --git a/group/gfs_controld/main.c b/group/gfs_controld/main.c
index 959954c..2b5a87e 100644
--- a/group/gfs_controld/main.c
+++ b/group/gfs_controld/main.c
@@ -178,6 +178,17 @@ struct mountgroup *find_mg(char *name)
return NULL;
}
+struct mountgroup *find_mg_id(uint32_t id)
+{
+ struct mountgroup *mg;
+
+ list_for_each_entry(mg, &mountgroups, list) {
+ if (mg->id == id)
+ return mg;
+ }
+ return NULL;
+}
+
enum {
Env_ACTION = 0,
Env_SUBSYSTEM,
More information about the cluster-commits
mailing list