Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
heartbeat.c File Reference
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/jiffies.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/bio.h>
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/file.h>
#include <linux/kthread.h>
#include <linux/configfs.h>
#include <linux/random.h>
#include <linux/crc32.h>
#include <linux/time.h>
#include <linux/debugfs.h>
#include <linux/slab.h>
#include "heartbeat.h"
#include "tcp.h"
#include "nodemanager.h"
#include "quorum.h"
#include "masklog.h"

Go to the source code of this file.

Data Structures

struct  o2hb_debug_buf
 
struct  o2hb_callback
 
struct  o2hb_node_event
 
struct  o2hb_disk_slot
 
struct  o2hb_region
 
struct  o2hb_bio_wait_ctxt
 
struct  o2hb_region_attribute
 
struct  o2hb_heartbeat_group
 
struct  o2hb_heartbeat_group_attribute
 

Macros

#define O2HB_DB_TYPE_LIVENODES   0
 
#define O2HB_DB_TYPE_LIVEREGIONS   1
 
#define O2HB_DB_TYPE_QUORUMREGIONS   2
 
#define O2HB_DB_TYPE_FAILEDREGIONS   3
 
#define O2HB_DB_TYPE_REGION_LIVENODES   4
 
#define O2HB_DB_TYPE_REGION_NUMBER   5
 
#define O2HB_DB_TYPE_REGION_ELAPSED_TIME   6
 
#define O2HB_DB_TYPE_REGION_PINNED   7
 
#define O2HB_DEBUG_DIR   "o2hb"
 
#define O2HB_DEBUG_LIVENODES   "livenodes"
 
#define O2HB_DEBUG_LIVEREGIONS   "live_regions"
 
#define O2HB_DEBUG_QUORUMREGIONS   "quorum_regions"
 
#define O2HB_DEBUG_FAILEDREGIONS   "failed_regions"
 
#define O2HB_DEBUG_REGION_NUMBER   "num"
 
#define O2HB_DEBUG_REGION_ELAPSED_TIME   "elapsed_time_in_ms"
 
#define O2HB_DEBUG_REGION_PINNED   "pinned"
 
#define O2HB_DEFAULT_BLOCK_BITS   9
 
#define O2HB_PIN_CUT_OFF   3
 
#define ERRSTR1   "Another node is heartbeating on device"
 
#define ERRSTR2   "Heartbeat generation mismatch on device"
 
#define ERRSTR3   "Heartbeat sequence mismatch on device"
 

Enumerations

enum  o2hb_heartbeat_modes { O2HB_HEARTBEAT_LOCAL = 0, O2HB_HEARTBEAT_GLOBAL, O2HB_HEARTBEAT_NUM_MODES }
 

Functions

void o2hb_exit (void)
 
int o2hb_init (void)
 
void o2hb_fill_node_map (unsigned long *map, unsigned bytes)
 
 EXPORT_SYMBOL_GPL (o2hb_fill_node_map)
 
struct config_groupo2hb_alloc_hb_set (void)
 
void o2hb_free_hb_set (struct config_group *group)
 
void o2hb_setup_callback (struct o2hb_callback_func *hc, enum o2hb_callback_type type, o2hb_cb_func *func, void *data, int priority)
 
 EXPORT_SYMBOL_GPL (o2hb_setup_callback)
 
void o2hb_region_dec_user (const char *region_uuid)
 
int o2hb_register_callback (const char *region_uuid, struct o2hb_callback_func *hc)
 
 EXPORT_SYMBOL_GPL (o2hb_register_callback)
 
void o2hb_unregister_callback (const char *region_uuid, struct o2hb_callback_func *hc)
 
 EXPORT_SYMBOL_GPL (o2hb_unregister_callback)
 
int o2hb_check_node_heartbeating (u8 node_num)
 
 EXPORT_SYMBOL_GPL (o2hb_check_node_heartbeating)
 
int o2hb_check_node_heartbeating_from_callback (u8 node_num)
 
 EXPORT_SYMBOL_GPL (o2hb_check_node_heartbeating_from_callback)
 
int o2hb_check_local_node_heartbeating (void)
 
 EXPORT_SYMBOL_GPL (o2hb_check_local_node_heartbeating)
 
void o2hb_stop_all_regions (void)
 
 EXPORT_SYMBOL_GPL (o2hb_stop_all_regions)
 
int o2hb_get_all_regions (char *region_uuids, u8 max_regions)
 
 EXPORT_SYMBOL_GPL (o2hb_get_all_regions)
 
int o2hb_global_heartbeat_active (void)
 
 EXPORT_SYMBOL (o2hb_global_heartbeat_active)
 

Variables

charo2hb_heartbeat_mode_desc [O2HB_HEARTBEAT_NUM_MODES]
 
unsigned int o2hb_dead_threshold = O2HB_DEFAULT_DEAD_THRESHOLD
 
unsigned int o2hb_heartbeat_mode = O2HB_HEARTBEAT_LOCAL
 
unsigned int o2hb_dependent_users
 

Macro Definition Documentation

#define ERRSTR1   "Another node is heartbeating on device"
#define ERRSTR2   "Heartbeat generation mismatch on device"
#define ERRSTR3   "Heartbeat sequence mismatch on device"
#define O2HB_DB_TYPE_FAILEDREGIONS   3

Definition at line 81 of file heartbeat.c.

#define O2HB_DB_TYPE_LIVENODES   0

Definition at line 78 of file heartbeat.c.

#define O2HB_DB_TYPE_LIVEREGIONS   1

Definition at line 79 of file heartbeat.c.

#define O2HB_DB_TYPE_QUORUMREGIONS   2

Definition at line 80 of file heartbeat.c.

#define O2HB_DB_TYPE_REGION_ELAPSED_TIME   6

Definition at line 84 of file heartbeat.c.

#define O2HB_DB_TYPE_REGION_LIVENODES   4

Definition at line 82 of file heartbeat.c.

#define O2HB_DB_TYPE_REGION_NUMBER   5

Definition at line 83 of file heartbeat.c.

#define O2HB_DB_TYPE_REGION_PINNED   7

Definition at line 85 of file heartbeat.c.

#define O2HB_DEBUG_DIR   "o2hb"

Definition at line 98 of file heartbeat.c.

#define O2HB_DEBUG_FAILEDREGIONS   "failed_regions"

Definition at line 102 of file heartbeat.c.

#define O2HB_DEBUG_LIVENODES   "livenodes"

Definition at line 99 of file heartbeat.c.

#define O2HB_DEBUG_LIVEREGIONS   "live_regions"

Definition at line 100 of file heartbeat.c.

#define O2HB_DEBUG_QUORUMREGIONS   "quorum_regions"

Definition at line 101 of file heartbeat.c.

#define O2HB_DEBUG_REGION_ELAPSED_TIME   "elapsed_time_in_ms"

Definition at line 104 of file heartbeat.c.

#define O2HB_DEBUG_REGION_NUMBER   "num"

Definition at line 103 of file heartbeat.c.

#define O2HB_DEBUG_REGION_PINNED   "pinned"

Definition at line 105 of file heartbeat.c.

#define O2HB_DEFAULT_BLOCK_BITS   9

Definition at line 121 of file heartbeat.c.

#define O2HB_PIN_CUT_OFF   3

Definition at line 151 of file heartbeat.c.

Enumeration Type Documentation

Enumerator:
O2HB_HEARTBEAT_LOCAL 
O2HB_HEARTBEAT_GLOBAL 
O2HB_HEARTBEAT_NUM_MODES 

Definition at line 123 of file heartbeat.c.

Function Documentation

EXPORT_SYMBOL ( o2hb_global_heartbeat_active  )
EXPORT_SYMBOL_GPL ( o2hb_fill_node_map  )
EXPORT_SYMBOL_GPL ( o2hb_setup_callback  )
EXPORT_SYMBOL_GPL ( o2hb_register_callback  )
EXPORT_SYMBOL_GPL ( o2hb_unregister_callback  )
EXPORT_SYMBOL_GPL ( o2hb_check_node_heartbeating  )
EXPORT_SYMBOL_GPL ( o2hb_check_local_node_heartbeating  )
EXPORT_SYMBOL_GPL ( o2hb_stop_all_regions  )
EXPORT_SYMBOL_GPL ( o2hb_get_all_regions  )
struct config_group* o2hb_alloc_hb_set ( void  )
read

Definition at line 2328 of file heartbeat.c.

int o2hb_check_local_node_heartbeating ( void  )

Definition at line 2615 of file heartbeat.c.

int o2hb_check_node_heartbeating ( u8  node_num)

Definition at line 2581 of file heartbeat.c.

int o2hb_check_node_heartbeating_from_callback ( u8  node_num)

Definition at line 2597 of file heartbeat.c.

void o2hb_exit ( void  )

Definition at line 1304 of file heartbeat.c.

void o2hb_fill_node_map ( unsigned long map,
unsigned  bytes 
)

Definition at line 1441 of file heartbeat.c.

void o2hb_free_hb_set ( struct config_group group)

Definition at line 2347 of file heartbeat.c.

int o2hb_get_all_regions ( char region_uuids,
u8  max_regions 
)

Definition at line 2649 of file heartbeat.c.

int o2hb_global_heartbeat_active ( void  )

Definition at line 2674 of file heartbeat.c.

int o2hb_init ( void  )

Definition at line 1406 of file heartbeat.c.

void o2hb_region_dec_user ( const char region_uuid)

Definition at line 2490 of file heartbeat.c.

int o2hb_register_callback ( const char region_uuid,
struct o2hb_callback_func hc 
)

Definition at line 2512 of file heartbeat.c.

void o2hb_setup_callback ( struct o2hb_callback_func hc,
enum o2hb_callback_type  type,
o2hb_cb_func func,
void data,
int  priority 
)

Definition at line 2363 of file heartbeat.c.

void o2hb_stop_all_regions ( void  )

Definition at line 2634 of file heartbeat.c.

void o2hb_unregister_callback ( const char region_uuid,
struct o2hb_callback_func hc 
)

Definition at line 2558 of file heartbeat.c.

Variable Documentation

unsigned int o2hb_dead_threshold = O2HB_DEFAULT_DEAD_THRESHOLD

Definition at line 134 of file heartbeat.c.

unsigned int o2hb_dependent_users

Definition at line 143 of file heartbeat.c.

unsigned int o2hb_heartbeat_mode = O2HB_HEARTBEAT_LOCAL

Definition at line 135 of file heartbeat.c.

char* o2hb_heartbeat_mode_desc[O2HB_HEARTBEAT_NUM_MODES]
Initial value:
= {
"local",
"global",
}

Definition at line 129 of file heartbeat.c.