Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
config.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/configfs.h>
#include <linux/slab.h>
#include <linux/in.h>
#include <linux/in6.h>
#include <linux/dlmconstants.h>
#include <net/ipv6.h>
#include <net/sock.h>
#include "config.h"
#include "lowcomms.h"

Go to the source code of this file.

Data Structures

struct  dlm_cluster
 
struct  cluster_attribute
 
struct  comm_attribute
 
struct  node_attribute
 
struct  dlm_clusters
 
struct  dlm_spaces
 
struct  dlm_space
 
struct  dlm_comms
 
struct  dlm_comm
 
struct  dlm_nodes
 
struct  dlm_node
 

Macros

#define CLUSTER_ATTR(name, check_zero)
 
#define DEFAULT_TCP_PORT   21064
 
#define DEFAULT_BUFFER_SIZE   4096
 
#define DEFAULT_RSBTBL_SIZE   1024
 
#define DEFAULT_RECOVER_TIMER   5
 
#define DEFAULT_TOSS_SECS   10
 
#define DEFAULT_SCAN_SECS   5
 
#define DEFAULT_LOG_DEBUG   0
 
#define DEFAULT_PROTOCOL   0
 
#define DEFAULT_TIMEWARN_CS   500 /* 5 sec = 500 centiseconds */
 
#define DEFAULT_WAITWARN_US   0
 
#define DEFAULT_NEW_RSB_COUNT   128
 
#define DEFAULT_RECOVER_CALLBACKS   0
 
#define DEFAULT_CLUSTER_NAME   ""
 

Enumerations

enum  {
  CLUSTER_ATTR_TCP_PORT = 0, CLUSTER_ATTR_BUFFER_SIZE, CLUSTER_ATTR_RSBTBL_SIZE, CLUSTER_ATTR_RECOVER_TIMER,
  CLUSTER_ATTR_TOSS_SECS, CLUSTER_ATTR_SCAN_SECS, CLUSTER_ATTR_LOG_DEBUG, CLUSTER_ATTR_PROTOCOL,
  CLUSTER_ATTR_TIMEWARN_CS, CLUSTER_ATTR_WAITWARN_US, CLUSTER_ATTR_NEW_RSB_COUNT, CLUSTER_ATTR_RECOVER_CALLBACKS,
  CLUSTER_ATTR_CLUSTER_NAME
}
 
enum  { COMM_ATTR_NODEID = 0, COMM_ATTR_LOCAL, COMM_ATTR_ADDR, COMM_ATTR_ADDR_LIST }
 
enum  { NODE_ATTR_NODEID = 0, NODE_ATTR_WEIGHT }
 

Functions

 CLUSTER_ATTR (tcp_port, 1)
 
 CLUSTER_ATTR (buffer_size, 1)
 
 CLUSTER_ATTR (rsbtbl_size, 1)
 
 CLUSTER_ATTR (recover_timer, 1)
 
 CLUSTER_ATTR (toss_secs, 1)
 
 CLUSTER_ATTR (scan_secs, 1)
 
 CLUSTER_ATTR (log_debug, 0)
 
 CLUSTER_ATTR (protocol, 0)
 
 CLUSTER_ATTR (timewarn_cs, 1)
 
 CLUSTER_ATTR (waitwarn_us, 0)
 
 CLUSTER_ATTR (new_rsb_count, 0)
 
 CLUSTER_ATTR (recover_callbacks, 0)
 
int __init dlm_config_init (void)
 
void dlm_config_exit (void)
 
int dlm_config_nodes (char *lsname, struct dlm_config_node **nodes_out, int *count_out)
 
int dlm_comm_seq (int nodeid, uint32_t *seq)
 
int dlm_our_nodeid (void)
 
int dlm_our_addr (struct sockaddr_storage *addr, int num)
 

Variables

struct dlm_config_info dlm_config
 

Macro Definition Documentation

#define CLUSTER_ATTR (   name,
  check_zero 
)
Value:
static ssize_t name##_write(struct dlm_cluster *cl, const char *buf, size_t len) \
{ \
return cluster_set(cl, &cl->cl_##name, &dlm_config.ci_##name, \
check_zero, buf, len); \
} \
static ssize_t name##_read(struct dlm_cluster *cl, char *buf) \
{ \
return snprintf(buf, PAGE_SIZE, "%u\n", cl->cl_##name); \
} \
static struct cluster_attribute cluster_attr_##name = \
__CONFIGFS_ATTR(name, 0644, name##_read, name##_write)

Definition at line 174 of file config.c.

#define DEFAULT_BUFFER_SIZE   4096

Definition at line 997 of file config.c.

#define DEFAULT_CLUSTER_NAME   ""

Definition at line 1008 of file config.c.

#define DEFAULT_LOG_DEBUG   0

Definition at line 1002 of file config.c.

#define DEFAULT_NEW_RSB_COUNT   128

Definition at line 1006 of file config.c.

#define DEFAULT_PROTOCOL   0

Definition at line 1003 of file config.c.

#define DEFAULT_RECOVER_CALLBACKS   0

Definition at line 1007 of file config.c.

#define DEFAULT_RECOVER_TIMER   5

Definition at line 999 of file config.c.

#define DEFAULT_RSBTBL_SIZE   1024

Definition at line 998 of file config.c.

#define DEFAULT_SCAN_SECS   5

Definition at line 1001 of file config.c.

#define DEFAULT_TCP_PORT   21064

Definition at line 996 of file config.c.

#define DEFAULT_TIMEWARN_CS   500 /* 5 sec = 500 centiseconds */

Definition at line 1004 of file config.c.

#define DEFAULT_TOSS_SECS   10

Definition at line 1000 of file config.c.

#define DEFAULT_WAITWARN_US   0

Definition at line 1005 of file config.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
CLUSTER_ATTR_TCP_PORT 
CLUSTER_ATTR_BUFFER_SIZE 
CLUSTER_ATTR_RSBTBL_SIZE 
CLUSTER_ATTR_RECOVER_TIMER 
CLUSTER_ATTR_TOSS_SECS 
CLUSTER_ATTR_SCAN_SECS 
CLUSTER_ATTR_LOG_DEBUG 
CLUSTER_ATTR_PROTOCOL 
CLUSTER_ATTR_TIMEWARN_CS 
CLUSTER_ATTR_WAITWARN_US 
CLUSTER_ATTR_NEW_RSB_COUNT 
CLUSTER_ATTR_RECOVER_CALLBACKS 
CLUSTER_ATTR_CLUSTER_NAME 

Definition at line 111 of file config.c.

anonymous enum
Enumerator:
COMM_ATTR_NODEID 
COMM_ATTR_LOCAL 
COMM_ATTR_ADDR 
COMM_ATTR_ADDR_LIST 

Definition at line 217 of file config.c.

anonymous enum
Enumerator:
NODE_ATTR_NODEID 
NODE_ATTR_WEIGHT 

Definition at line 268 of file config.c.

Function Documentation

CLUSTER_ATTR ( tcp_port  ,
 
)
CLUSTER_ATTR ( buffer_size  ,
 
)
CLUSTER_ATTR ( rsbtbl_size  ,
 
)
CLUSTER_ATTR ( recover_timer  ,
 
)
CLUSTER_ATTR ( toss_secs  ,
 
)
CLUSTER_ATTR ( scan_secs  ,
 
)
CLUSTER_ATTR ( log_debug  ,
 
)
CLUSTER_ATTR ( protocol  ,
 
)
CLUSTER_ATTR ( timewarn_cs  ,
 
)
CLUSTER_ATTR ( waitwarn_us  ,
 
)
CLUSTER_ATTR ( new_rsb_count  ,
 
)
CLUSTER_ATTR ( recover_callbacks  ,
 
)
int dlm_comm_seq ( int  nodeid,
uint32_t seq 
)

Definition at line 969 of file config.c.

void dlm_config_exit ( void  )

Definition at line 678 of file config.c.

int __init dlm_config_init ( void  )

Definition at line 671 of file config.c.

int dlm_config_nodes ( char lsname,
struct dlm_config_node **  nodes_out,
int count_out 
)

Definition at line 922 of file config.c.

int dlm_our_addr ( struct sockaddr_storage addr,
int  num 
)

Definition at line 985 of file config.c.

int dlm_our_nodeid ( void  )

Definition at line 979 of file config.c.

Variable Documentation

struct dlm_config_info dlm_config
Initial value:
= {
.ci_tcp_port = DEFAULT_TCP_PORT,
.ci_buffer_size = DEFAULT_BUFFER_SIZE,
.ci_rsbtbl_size = DEFAULT_RSBTBL_SIZE,
.ci_recover_timer = DEFAULT_RECOVER_TIMER,
.ci_toss_secs = DEFAULT_TOSS_SECS,
.ci_scan_secs = DEFAULT_SCAN_SECS,
.ci_log_debug = DEFAULT_LOG_DEBUG,
.ci_protocol = DEFAULT_PROTOCOL,
.ci_timewarn_cs = DEFAULT_TIMEWARN_CS,
.ci_waitwarn_us = DEFAULT_WAITWARN_US,
.ci_new_rsb_count = DEFAULT_NEW_RSB_COUNT,
.ci_recover_callbacks = DEFAULT_RECOVER_CALLBACKS,
.ci_cluster_name = DEFAULT_CLUSTER_NAME
}

Definition at line 1010 of file config.c.