diff options
Diffstat (limited to 'fs/ocfs2/cluster')
-rw-r--r-- | fs/ocfs2/cluster/heartbeat.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index f890656127fa..b06b9e52fba8 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c | |||
@@ -76,6 +76,9 @@ static unsigned long o2hb_quorum_region_bitmap[BITS_TO_LONGS(O2NM_MAX_REGIONS)]; | |||
76 | static unsigned long o2hb_failed_region_bitmap[BITS_TO_LONGS(O2NM_MAX_REGIONS)]; | 76 | static unsigned long o2hb_failed_region_bitmap[BITS_TO_LONGS(O2NM_MAX_REGIONS)]; |
77 | 77 | ||
78 | #define O2HB_DB_TYPE_LIVENODES 0 | 78 | #define O2HB_DB_TYPE_LIVENODES 0 |
79 | #define O2HB_DB_TYPE_LIVEREGIONS 1 | ||
80 | #define O2HB_DB_TYPE_QUORUMREGIONS 2 | ||
81 | #define O2HB_DB_TYPE_FAILEDREGIONS 3 | ||
79 | struct o2hb_debug_buf { | 82 | struct o2hb_debug_buf { |
80 | int db_type; | 83 | int db_type; |
81 | int db_size; | 84 | int db_size; |
@@ -84,12 +87,21 @@ struct o2hb_debug_buf { | |||
84 | }; | 87 | }; |
85 | 88 | ||
86 | static struct o2hb_debug_buf *o2hb_db_livenodes; | 89 | static struct o2hb_debug_buf *o2hb_db_livenodes; |
90 | static struct o2hb_debug_buf *o2hb_db_liveregions; | ||
91 | static struct o2hb_debug_buf *o2hb_db_quorumregions; | ||
92 | static struct o2hb_debug_buf *o2hb_db_failedregions; | ||
87 | 93 | ||
88 | #define O2HB_DEBUG_DIR "o2hb" | 94 | #define O2HB_DEBUG_DIR "o2hb" |
89 | #define O2HB_DEBUG_LIVENODES "livenodes" | 95 | #define O2HB_DEBUG_LIVENODES "livenodes" |
96 | #define O2HB_DEBUG_LIVEREGIONS "live_regions" | ||
97 | #define O2HB_DEBUG_QUORUMREGIONS "quorum_regions" | ||
98 | #define O2HB_DEBUG_FAILEDREGIONS "failed_regions" | ||
90 | 99 | ||
91 | static struct dentry *o2hb_debug_dir; | 100 | static struct dentry *o2hb_debug_dir; |
92 | static struct dentry *o2hb_debug_livenodes; | 101 | static struct dentry *o2hb_debug_livenodes; |
102 | static struct dentry *o2hb_debug_liveregions; | ||
103 | static struct dentry *o2hb_debug_quorumregions; | ||
104 | static struct dentry *o2hb_debug_failedregions; | ||
93 | 105 | ||
94 | static LIST_HEAD(o2hb_all_regions); | 106 | static LIST_HEAD(o2hb_all_regions); |
95 | 107 | ||
@@ -1085,6 +1097,9 @@ static int o2hb_debug_open(struct inode *inode, struct file *file) | |||
1085 | 1097 | ||
1086 | switch (db->db_type) { | 1098 | switch (db->db_type) { |
1087 | case O2HB_DB_TYPE_LIVENODES: | 1099 | case O2HB_DB_TYPE_LIVENODES: |
1100 | case O2HB_DB_TYPE_LIVEREGIONS: | ||
1101 | case O2HB_DB_TYPE_QUORUMREGIONS: | ||
1102 | case O2HB_DB_TYPE_FAILEDREGIONS: | ||
1088 | spin_lock(&o2hb_live_lock); | 1103 | spin_lock(&o2hb_live_lock); |
1089 | memcpy(map, db->db_data, db->db_size); | 1104 | memcpy(map, db->db_data, db->db_size); |
1090 | spin_unlock(&o2hb_live_lock); | 1105 | spin_unlock(&o2hb_live_lock); |
@@ -1146,6 +1161,12 @@ static const struct file_operations o2hb_debug_fops = { | |||
1146 | void o2hb_exit(void) | 1161 | void o2hb_exit(void) |
1147 | { | 1162 | { |
1148 | kfree(o2hb_db_livenodes); | 1163 | kfree(o2hb_db_livenodes); |
1164 | kfree(o2hb_db_liveregions); | ||
1165 | kfree(o2hb_db_quorumregions); | ||
1166 | kfree(o2hb_db_failedregions); | ||
1167 | debugfs_remove(o2hb_debug_failedregions); | ||
1168 | debugfs_remove(o2hb_debug_quorumregions); | ||
1169 | debugfs_remove(o2hb_debug_liveregions); | ||
1149 | debugfs_remove(o2hb_debug_livenodes); | 1170 | debugfs_remove(o2hb_debug_livenodes); |
1150 | debugfs_remove(o2hb_debug_dir); | 1171 | debugfs_remove(o2hb_debug_dir); |
1151 | } | 1172 | } |
@@ -1189,6 +1210,48 @@ static int o2hb_debug_init(void) | |||
1189 | mlog_errno(ret); | 1210 | mlog_errno(ret); |
1190 | goto bail; | 1211 | goto bail; |
1191 | } | 1212 | } |
1213 | |||
1214 | o2hb_debug_liveregions = o2hb_debug_create(O2HB_DEBUG_LIVEREGIONS, | ||
1215 | o2hb_debug_dir, | ||
1216 | &o2hb_db_liveregions, | ||
1217 | sizeof(*o2hb_db_liveregions), | ||
1218 | O2HB_DB_TYPE_LIVEREGIONS, | ||
1219 | sizeof(o2hb_live_region_bitmap), | ||
1220 | O2NM_MAX_REGIONS, | ||
1221 | o2hb_live_region_bitmap); | ||
1222 | if (!o2hb_debug_liveregions) { | ||
1223 | mlog_errno(ret); | ||
1224 | goto bail; | ||
1225 | } | ||
1226 | |||
1227 | o2hb_debug_quorumregions = | ||
1228 | o2hb_debug_create(O2HB_DEBUG_QUORUMREGIONS, | ||
1229 | o2hb_debug_dir, | ||
1230 | &o2hb_db_quorumregions, | ||
1231 | sizeof(*o2hb_db_quorumregions), | ||
1232 | O2HB_DB_TYPE_QUORUMREGIONS, | ||
1233 | sizeof(o2hb_quorum_region_bitmap), | ||
1234 | O2NM_MAX_REGIONS, | ||
1235 | o2hb_quorum_region_bitmap); | ||
1236 | if (!o2hb_debug_quorumregions) { | ||
1237 | mlog_errno(ret); | ||
1238 | goto bail; | ||
1239 | } | ||
1240 | |||
1241 | o2hb_debug_failedregions = | ||
1242 | o2hb_debug_create(O2HB_DEBUG_FAILEDREGIONS, | ||
1243 | o2hb_debug_dir, | ||
1244 | &o2hb_db_failedregions, | ||
1245 | sizeof(*o2hb_db_failedregions), | ||
1246 | O2HB_DB_TYPE_FAILEDREGIONS, | ||
1247 | sizeof(o2hb_failed_region_bitmap), | ||
1248 | O2NM_MAX_REGIONS, | ||
1249 | o2hb_failed_region_bitmap); | ||
1250 | if (!o2hb_debug_failedregions) { | ||
1251 | mlog_errno(ret); | ||
1252 | goto bail; | ||
1253 | } | ||
1254 | |||
1192 | ret = 0; | 1255 | ret = 0; |
1193 | bail: | 1256 | bail: |
1194 | if (ret) | 1257 | if (ret) |