diff options
author | Sunil Mushran <sunil.mushran@oracle.com> | 2010-10-06 20:55:21 -0400 |
---|---|---|
committer | Sunil Mushran <sunil.mushran@oracle.com> | 2010-10-06 20:55:21 -0400 |
commit | 823a637ae933fde8fdb280612dd3ff9912e301e3 (patch) | |
tree | 32a6bd6591379ff05285c03f1fcd0f843c351476 | |
parent | 8ca8b0bbd841b6bcd8ac05e51b0143aa61cfeff3 (diff) |
ocfs2/cluster: Maintain live node bitmap per heartbeat region
Currently we track a global livenode bitmap that keeps track of all nodes
that are heartbeating in all regions.
This patch adds the ability to track the livenode bitmap on a per region basis.
We will use this facility in a later patch to allow us to withstand the loss of
a minority number of regions.
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
-rw-r--r-- | fs/ocfs2/cluster/heartbeat.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 16e49765c853..188f50269b89 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c | |||
@@ -174,6 +174,9 @@ struct o2hb_region { | |||
174 | struct block_device *hr_bdev; | 174 | struct block_device *hr_bdev; |
175 | struct o2hb_disk_slot *hr_slots; | 175 | struct o2hb_disk_slot *hr_slots; |
176 | 176 | ||
177 | /* live node map of this region */ | ||
178 | unsigned long hr_live_node_bitmap[BITS_TO_LONGS(O2NM_MAX_NODES)]; | ||
179 | |||
177 | /* let the person setting up hb wait for it to return until it | 180 | /* let the person setting up hb wait for it to return until it |
178 | * has reached a 'steady' state. This will be fixed when we have | 181 | * has reached a 'steady' state. This will be fixed when we have |
179 | * a more complete api that doesn't lead to this sort of fragility. */ | 182 | * a more complete api that doesn't lead to this sort of fragility. */ |
@@ -688,6 +691,8 @@ fire_callbacks: | |||
688 | mlog(ML_HEARTBEAT, "Node %d (id 0x%llx) joined my region\n", | 691 | mlog(ML_HEARTBEAT, "Node %d (id 0x%llx) joined my region\n", |
689 | slot->ds_node_num, (long long)slot->ds_last_generation); | 692 | slot->ds_node_num, (long long)slot->ds_last_generation); |
690 | 693 | ||
694 | set_bit(slot->ds_node_num, reg->hr_live_node_bitmap); | ||
695 | |||
691 | /* first on the list generates a callback */ | 696 | /* first on the list generates a callback */ |
692 | if (list_empty(&o2hb_live_slots[slot->ds_node_num])) { | 697 | if (list_empty(&o2hb_live_slots[slot->ds_node_num])) { |
693 | set_bit(slot->ds_node_num, o2hb_live_node_bitmap); | 698 | set_bit(slot->ds_node_num, o2hb_live_node_bitmap); |
@@ -733,6 +738,8 @@ fire_callbacks: | |||
733 | mlog(ML_HEARTBEAT, "Node %d left my region\n", | 738 | mlog(ML_HEARTBEAT, "Node %d left my region\n", |
734 | slot->ds_node_num); | 739 | slot->ds_node_num); |
735 | 740 | ||
741 | clear_bit(slot->ds_node_num, reg->hr_live_node_bitmap); | ||
742 | |||
736 | /* last off the live_slot generates a callback */ | 743 | /* last off the live_slot generates a callback */ |
737 | list_del_init(&slot->ds_live_item); | 744 | list_del_init(&slot->ds_live_item); |
738 | if (list_empty(&o2hb_live_slots[slot->ds_node_num])) { | 745 | if (list_empty(&o2hb_live_slots[slot->ds_node_num])) { |