~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/ocfs2/cluster/heartbeat.h

Version: ~ [ linux-4.14 ] ~ [ linux-4.13.12 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.61 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.97 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.46 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.80 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.50 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.95 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.27.62 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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 #define O2HB_MAX_REGION_NAME_LEN        32
 35 
 36 /* number of changes to be seen as live */
 37 #define O2HB_LIVE_THRESHOLD        2
 38 /* number of equal samples to be seen as dead */
 39 extern unsigned int o2hb_dead_threshold;
 40 #define O2HB_DEFAULT_DEAD_THRESHOLD        31
 41 /* Otherwise MAX_WRITE_TIMEOUT will be zero... */
 42 #define O2HB_MIN_DEAD_THRESHOLD   2
 43 #define O2HB_MAX_WRITE_TIMEOUT_MS (O2HB_REGION_TIMEOUT_MS * (o2hb_dead_threshold - 1))
 44 
 45 #define O2HB_CB_MAGIC           0x51d1e4ec
 46 
 47 /* callback stuff */
 48 enum o2hb_callback_type {
 49         O2HB_NODE_DOWN_CB = 0,
 50         O2HB_NODE_UP_CB,
 51         O2HB_NUM_CB
 52 };
 53 
 54 struct o2nm_node;
 55 typedef void (o2hb_cb_func)(struct o2nm_node *, int, void *);
 56 
 57 struct o2hb_callback_func {
 58         u32                     hc_magic;
 59         struct list_head        hc_item;
 60         o2hb_cb_func            *hc_func;
 61         void                    *hc_data;
 62         int                     hc_priority;
 63         enum o2hb_callback_type hc_type;
 64 };
 65 
 66 struct config_group *o2hb_alloc_hb_set(void);
 67 void o2hb_free_hb_set(struct config_group *group);
 68 
 69 void o2hb_setup_callback(struct o2hb_callback_func *hc,
 70                          enum o2hb_callback_type type,
 71                          o2hb_cb_func *func,
 72                          void *data,
 73                          int priority);
 74 int o2hb_register_callback(const char *region_uuid,
 75                            struct o2hb_callback_func *hc);
 76 void o2hb_unregister_callback(const char *region_uuid,
 77                               struct o2hb_callback_func *hc);
 78 void o2hb_fill_node_map(unsigned long *map,
 79                         unsigned bytes);
 80 void o2hb_exit(void);
 81 int o2hb_init(void);
 82 int o2hb_check_node_heartbeating(u8 node_num);
 83 int o2hb_check_node_heartbeating_no_sem(u8 node_num);
 84 int o2hb_check_node_heartbeating_from_callback(u8 node_num);
 85 int o2hb_check_local_node_heartbeating(void);
 86 void o2hb_stop_all_regions(void);
 87 int o2hb_get_all_regions(char *region_uuids, u8 numregions);
 88 int o2hb_global_heartbeat_active(void);
 89 
 90 #endif /* O2CLUSTER_HEARTBEAT_H */
 91 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp