diff options
author | Mark Fasheh <mark.fasheh@oracle.com> | 2005-12-15 17:31:23 -0500 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2006-01-03 14:45:46 -0500 |
commit | a7f6a5fb4bde142b622706e2006ba33f793e13ed (patch) | |
tree | 27db335992f61a13658e604ee56f4c6a3c79aea5 /fs/ocfs2/cluster/heartbeat.h | |
parent | 0c83ed8eeb28a045cdbd0b216679938aa9e665fe (diff) |
[PATCH] OCFS2: The Second Oracle Cluster Filesystem
Disk based heartbeat. Configured and started from userspace, the
kernel component handles I/O submission and event generation via
callback mechanism.
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Diffstat (limited to 'fs/ocfs2/cluster/heartbeat.h')
-rw-r--r-- | fs/ocfs2/cluster/heartbeat.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/fs/ocfs2/cluster/heartbeat.h b/fs/ocfs2/cluster/heartbeat.h new file mode 100644 index 000000000000..cac6223206a9 --- /dev/null +++ b/fs/ocfs2/cluster/heartbeat.h | |||
@@ -0,0 +1,82 @@ | |||
1 | /* -*- mode: c; c-basic-offset: 8; -*- | ||
2 | * vim: noexpandtab sw=8 ts=8 sts=0: | ||
3 | * | ||
4 | * heartbeat.h | ||
5 | * | ||
6 | * Function prototypes | ||
7 | * | ||
8 | * Copyright (C) 2004 Oracle. All rights reserved. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or | ||
11 | * modify it under the terms of the GNU General Public | ||
12 | * License as published by the Free Software Foundation; either | ||
13 | * version 2 of the License, or (at your option) any later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
18 | * General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public | ||
21 | * License along with this program; if not, write to the | ||
22 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
23 | * Boston, MA 021110-1307, USA. | ||
24 | * | ||
25 | */ | ||
26 | |||
27 | #ifndef O2CLUSTER_HEARTBEAT_H | ||
28 | #define O2CLUSTER_HEARTBEAT_H | ||
29 | |||
30 | #include "ocfs2_heartbeat.h" | ||
31 | |||
32 | #define O2HB_REGION_TIMEOUT_MS 2000 | ||
33 | |||
34 | /* number of changes to be seen as live */ | ||
35 | #define O2HB_LIVE_THRESHOLD 2 | ||
36 | /* number of equal samples to be seen as dead */ | ||
37 | extern unsigned int o2hb_dead_threshold; | ||
38 | #define O2HB_DEFAULT_DEAD_THRESHOLD 7 | ||
39 | /* Otherwise MAX_WRITE_TIMEOUT will be zero... */ | ||
40 | #define O2HB_MIN_DEAD_THRESHOLD 2 | ||
41 | #define O2HB_MAX_WRITE_TIMEOUT_MS (O2HB_REGION_TIMEOUT_MS * (o2hb_dead_threshold - 1)) | ||
42 | |||
43 | #define O2HB_CB_MAGIC 0x51d1e4ec | ||
44 | |||
45 | /* callback stuff */ | ||
46 | enum o2hb_callback_type { | ||
47 | O2HB_NODE_DOWN_CB = 0, | ||
48 | O2HB_NODE_UP_CB, | ||
49 | O2HB_NUM_CB | ||
50 | }; | ||
51 | |||
52 | struct o2nm_node; | ||
53 | typedef void (o2hb_cb_func)(struct o2nm_node *, int, void *); | ||
54 | |||
55 | struct o2hb_callback_func { | ||
56 | u32 hc_magic; | ||
57 | struct list_head hc_item; | ||
58 | o2hb_cb_func *hc_func; | ||
59 | void *hc_data; | ||
60 | int hc_priority; | ||
61 | enum o2hb_callback_type hc_type; | ||
62 | }; | ||
63 | |||
64 | struct config_group *o2hb_alloc_hb_set(void); | ||
65 | void o2hb_free_hb_set(struct config_group *group); | ||
66 | |||
67 | void o2hb_setup_callback(struct o2hb_callback_func *hc, | ||
68 | enum o2hb_callback_type type, | ||
69 | o2hb_cb_func *func, | ||
70 | void *data, | ||
71 | int priority); | ||
72 | int o2hb_register_callback(struct o2hb_callback_func *hc); | ||
73 | int o2hb_unregister_callback(struct o2hb_callback_func *hc); | ||
74 | void o2hb_fill_node_map(unsigned long *map, | ||
75 | unsigned bytes); | ||
76 | void o2hb_init(void); | ||
77 | int o2hb_check_node_heartbeating(u8 node_num); | ||
78 | int o2hb_check_node_heartbeating_from_callback(u8 node_num); | ||
79 | int o2hb_check_local_node_heartbeating(void); | ||
80 | void o2hb_stop_all_regions(void); | ||
81 | |||
82 | #endif /* O2CLUSTER_HEARTBEAT_H */ | ||