Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 212783
b: refs/heads/master
c: b3c85c4
h: refs/heads/master
i:
  212781: b19f3bf
  212779: d1f1701
  212775: f849be9
  212767: 620f27b
v: v3
  • Loading branch information
Sunil Mushran committed Oct 7, 2010
1 parent 7aa758e commit 4360815
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b1365d0bd14b912cceb424cbeed9fe939a9038e3
refs/heads/master: b3c85c4cdf77154acc940dd0f14d1fb99cbbaf75
34 changes: 34 additions & 0 deletions trunk/fs/ocfs2/cluster/heartbeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,9 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g
if (reg == NULL)
return ERR_PTR(-ENOMEM);

if (strlen(name) > O2HB_MAX_REGION_NAME_LEN)
return ERR_PTR(-ENAMETOOLONG);

config_item_init_type_name(&reg->hr_item, name, &o2hb_region_type);

spin_lock(&o2hb_live_lock);
Expand Down Expand Up @@ -2035,3 +2038,34 @@ void o2hb_stop_all_regions(void)
spin_unlock(&o2hb_live_lock);
}
EXPORT_SYMBOL_GPL(o2hb_stop_all_regions);

int o2hb_get_all_regions(char *region_uuids, u8 max_regions)
{
struct o2hb_region *reg;
int numregs = 0;
char *p;

spin_lock(&o2hb_live_lock);

p = region_uuids;
list_for_each_entry(reg, &o2hb_all_regions, hr_all_item) {
mlog(0, "Region: %s\n", config_item_name(&reg->hr_item));
if (numregs < max_regions) {
memcpy(p, config_item_name(&reg->hr_item),
O2HB_MAX_REGION_NAME_LEN);
p += O2HB_MAX_REGION_NAME_LEN;
}
numregs++;
}

spin_unlock(&o2hb_live_lock);

return numregs;
}
EXPORT_SYMBOL_GPL(o2hb_get_all_regions);

int o2hb_global_heartbeat_active(void)
{
return 0;
}
EXPORT_SYMBOL(o2hb_global_heartbeat_active);
4 changes: 4 additions & 0 deletions trunk/fs/ocfs2/cluster/heartbeat.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

#define O2HB_REGION_TIMEOUT_MS 2000

#define O2HB_MAX_REGION_NAME_LEN 32

/* number of changes to be seen as live */
#define O2HB_LIVE_THRESHOLD 2
/* number of equal samples to be seen as dead */
Expand Down Expand Up @@ -81,5 +83,7 @@ int o2hb_check_node_heartbeating(u8 node_num);
int o2hb_check_node_heartbeating_from_callback(u8 node_num);
int o2hb_check_local_node_heartbeating(void);
void o2hb_stop_all_regions(void);
int o2hb_get_all_regions(char *region_uuids, u8 numregions);
int o2hb_global_heartbeat_active(void);

#endif /* O2CLUSTER_HEARTBEAT_H */

0 comments on commit 4360815

Please sign in to comment.