diff options
author | Mark Fasheh <mark.fasheh@oracle.com> | 2007-09-24 18:09:41 -0400 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2008-01-25 17:36:40 -0500 |
commit | 6f7b056ea9c6fa978c79ca626eff43549df94dbb (patch) | |
tree | e8318b4f7390547ad84208c393608f7141c027d3 | |
parent | 6561168cb442be8d2769dce663870b6a28573e16 (diff) |
ocfs2: Remove fs dependency on ocfs2_heartbeat module
Now that the dlm exposes domain information to us, we don't need generic
node up / node down callbacks. And since the DLM is only telling us when a
node goes down unexpectedly, we no longer need to optimize away node down
callbacks via the umount map.
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
-rw-r--r-- | fs/ocfs2/heartbeat.c | 73 | ||||
-rw-r--r-- | fs/ocfs2/heartbeat.h | 2 | ||||
-rw-r--r-- | fs/ocfs2/super.c | 8 |
3 files changed, 0 insertions, 83 deletions
diff --git a/fs/ocfs2/heartbeat.c b/fs/ocfs2/heartbeat.c index c4c36171240d..6239fc52790c 100644 --- a/fs/ocfs2/heartbeat.c +++ b/fs/ocfs2/heartbeat.c | |||
@@ -30,9 +30,6 @@ | |||
30 | #include <linux/highmem.h> | 30 | #include <linux/highmem.h> |
31 | #include <linux/kmod.h> | 31 | #include <linux/kmod.h> |
32 | 32 | ||
33 | #include <cluster/heartbeat.h> | ||
34 | #include <cluster/nodemanager.h> | ||
35 | |||
36 | #include <dlm/dlmapi.h> | 33 | #include <dlm/dlmapi.h> |
37 | 34 | ||
38 | #define MLOG_MASK_PREFIX ML_SUPER | 35 | #define MLOG_MASK_PREFIX ML_SUPER |
@@ -48,9 +45,6 @@ | |||
48 | 45 | ||
49 | #include "buffer_head_io.h" | 46 | #include "buffer_head_io.h" |
50 | 47 | ||
51 | #define OCFS2_HB_NODE_DOWN_PRI (0x0000002) | ||
52 | #define OCFS2_HB_NODE_UP_PRI OCFS2_HB_NODE_DOWN_PRI | ||
53 | |||
54 | static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map, | 48 | static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map, |
55 | int bit); | 49 | int bit); |
56 | static inline void __ocfs2_node_map_clear_bit(struct ocfs2_node_map *map, | 50 | static inline void __ocfs2_node_map_clear_bit(struct ocfs2_node_map *map, |
@@ -87,26 +81,11 @@ static void ocfs2_do_node_down(int node_num, | |||
87 | return; | 81 | return; |
88 | } | 82 | } |
89 | 83 | ||
90 | if (ocfs2_node_map_test_bit(osb, &osb->umount_map, node_num)) { | ||
91 | /* If a node is in the umount map, then we've been | ||
92 | * expecting him to go down and we know ahead of time | ||
93 | * that recovery is not necessary. */ | ||
94 | ocfs2_node_map_clear_bit(osb, &osb->umount_map, node_num); | ||
95 | return; | ||
96 | } | ||
97 | |||
98 | ocfs2_recovery_thread(osb, node_num); | 84 | ocfs2_recovery_thread(osb, node_num); |
99 | 85 | ||
100 | ocfs2_remove_node_from_vote_queues(osb, node_num); | 86 | ocfs2_remove_node_from_vote_queues(osb, node_num); |
101 | } | 87 | } |
102 | 88 | ||
103 | static void ocfs2_hb_node_down_cb(struct o2nm_node *node, | ||
104 | int node_num, | ||
105 | void *data) | ||
106 | { | ||
107 | ocfs2_do_node_down(node_num, (struct ocfs2_super *) data); | ||
108 | } | ||
109 | |||
110 | /* Called from the dlm when it's about to evict a node. We may also | 89 | /* Called from the dlm when it's about to evict a node. We may also |
111 | * get a heartbeat callback later. */ | 90 | * get a heartbeat callback later. */ |
112 | static void ocfs2_dlm_eviction_cb(int node_num, | 91 | static void ocfs2_dlm_eviction_cb(int node_num, |
@@ -121,27 +100,8 @@ static void ocfs2_dlm_eviction_cb(int node_num, | |||
121 | ocfs2_do_node_down(node_num, osb); | 100 | ocfs2_do_node_down(node_num, osb); |
122 | } | 101 | } |
123 | 102 | ||
124 | static void ocfs2_hb_node_up_cb(struct o2nm_node *node, | ||
125 | int node_num, | ||
126 | void *data) | ||
127 | { | ||
128 | struct ocfs2_super *osb = data; | ||
129 | |||
130 | BUG_ON(osb->node_num == node_num); | ||
131 | |||
132 | mlog(0, "node up event for %d\n", node_num); | ||
133 | ocfs2_node_map_clear_bit(osb, &osb->umount_map, node_num); | ||
134 | } | ||
135 | |||
136 | void ocfs2_setup_hb_callbacks(struct ocfs2_super *osb) | 103 | void ocfs2_setup_hb_callbacks(struct ocfs2_super *osb) |
137 | { | 104 | { |
138 | o2hb_setup_callback(&osb->osb_hb_down, O2HB_NODE_DOWN_CB, | ||
139 | ocfs2_hb_node_down_cb, osb, | ||
140 | OCFS2_HB_NODE_DOWN_PRI); | ||
141 | |||
142 | o2hb_setup_callback(&osb->osb_hb_up, O2HB_NODE_UP_CB, | ||
143 | ocfs2_hb_node_up_cb, osb, OCFS2_HB_NODE_UP_PRI); | ||
144 | |||
145 | /* Not exactly a heartbeat callback, but leads to essentially | 105 | /* Not exactly a heartbeat callback, but leads to essentially |
146 | * the same path so we set it up here. */ | 106 | * the same path so we set it up here. */ |
147 | dlm_setup_eviction_cb(&osb->osb_eviction_cb, | 107 | dlm_setup_eviction_cb(&osb->osb_eviction_cb, |
@@ -149,39 +109,6 @@ void ocfs2_setup_hb_callbacks(struct ocfs2_super *osb) | |||
149 | osb); | 109 | osb); |
150 | } | 110 | } |
151 | 111 | ||
152 | /* Most functions here are just stubs for now... */ | ||
153 | int ocfs2_register_hb_callbacks(struct ocfs2_super *osb) | ||
154 | { | ||
155 | int status; | ||
156 | |||
157 | if (ocfs2_mount_local(osb)) | ||
158 | return 0; | ||
159 | |||
160 | status = o2hb_register_callback(osb->uuid_str, &osb->osb_hb_down); | ||
161 | if (status < 0) { | ||
162 | mlog_errno(status); | ||
163 | goto bail; | ||
164 | } | ||
165 | |||
166 | status = o2hb_register_callback(osb->uuid_str, &osb->osb_hb_up); | ||
167 | if (status < 0) { | ||
168 | mlog_errno(status); | ||
169 | o2hb_unregister_callback(osb->uuid_str, &osb->osb_hb_down); | ||
170 | } | ||
171 | |||
172 | bail: | ||
173 | return status; | ||
174 | } | ||
175 | |||
176 | void ocfs2_clear_hb_callbacks(struct ocfs2_super *osb) | ||
177 | { | ||
178 | if (ocfs2_mount_local(osb)) | ||
179 | return; | ||
180 | |||
181 | o2hb_unregister_callback(osb->uuid_str, &osb->osb_hb_down); | ||
182 | o2hb_unregister_callback(osb->uuid_str, &osb->osb_hb_up); | ||
183 | } | ||
184 | |||
185 | void ocfs2_stop_heartbeat(struct ocfs2_super *osb) | 112 | void ocfs2_stop_heartbeat(struct ocfs2_super *osb) |
186 | { | 113 | { |
187 | int ret; | 114 | int ret; |
diff --git a/fs/ocfs2/heartbeat.h b/fs/ocfs2/heartbeat.h index e8fb079122e4..56859211888a 100644 --- a/fs/ocfs2/heartbeat.h +++ b/fs/ocfs2/heartbeat.h | |||
@@ -29,8 +29,6 @@ | |||
29 | void ocfs2_init_node_maps(struct ocfs2_super *osb); | 29 | void ocfs2_init_node_maps(struct ocfs2_super *osb); |
30 | 30 | ||
31 | void ocfs2_setup_hb_callbacks(struct ocfs2_super *osb); | 31 | void ocfs2_setup_hb_callbacks(struct ocfs2_super *osb); |
32 | int ocfs2_register_hb_callbacks(struct ocfs2_super *osb); | ||
33 | void ocfs2_clear_hb_callbacks(struct ocfs2_super *osb); | ||
34 | void ocfs2_stop_heartbeat(struct ocfs2_super *osb); | 32 | void ocfs2_stop_heartbeat(struct ocfs2_super *osb); |
35 | 33 | ||
36 | /* node map functions - used to keep track of mounted and in-recovery | 34 | /* node map functions - used to keep track of mounted and in-recovery |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 5ee775420665..64b81b341ece 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -1117,12 +1117,6 @@ static int ocfs2_mount_volume(struct super_block *sb) | |||
1117 | goto leave; | 1117 | goto leave; |
1118 | } | 1118 | } |
1119 | 1119 | ||
1120 | status = ocfs2_register_hb_callbacks(osb); | ||
1121 | if (status < 0) { | ||
1122 | mlog_errno(status); | ||
1123 | goto leave; | ||
1124 | } | ||
1125 | |||
1126 | status = ocfs2_dlm_init(osb); | 1120 | status = ocfs2_dlm_init(osb); |
1127 | if (status < 0) { | 1121 | if (status < 0) { |
1128 | mlog_errno(status); | 1122 | mlog_errno(status); |
@@ -1260,8 +1254,6 @@ static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err) | |||
1260 | ocfs2_dlm_shutdown(osb); | 1254 | ocfs2_dlm_shutdown(osb); |
1261 | } | 1255 | } |
1262 | 1256 | ||
1263 | ocfs2_clear_hb_callbacks(osb); | ||
1264 | |||
1265 | debugfs_remove(osb->osb_debug_root); | 1257 | debugfs_remove(osb->osb_debug_root); |
1266 | 1258 | ||
1267 | if (!mnt_err) | 1259 | if (!mnt_err) |