David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | ******************************************************************************* |
| 3 | ** |
| 4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 5 | ** Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 6 | ** |
| 7 | ** This copyrighted material is made available to anyone wishing to use, |
| 8 | ** modify, copy, or redistribute it subject to the terms and conditions |
| 9 | ** of the GNU General Public License v.2. |
| 10 | ** |
| 11 | ******************************************************************************* |
| 12 | ******************************************************************************/ |
| 13 | |
| 14 | #include <linux/kernel.h> |
| 15 | #include <linux/module.h> |
| 16 | #include <linux/configfs.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 17 | #include <linux/slab.h> |
David Teigland | 44be6fd | 2008-08-28 11:36:19 -0500 | [diff] [blame] | 18 | #include <linux/in.h> |
| 19 | #include <linux/in6.h> |
| 20 | #include <net/ipv6.h> |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 21 | #include <net/sock.h> |
| 22 | |
| 23 | #include "config.h" |
David Teigland | 1c032c0 | 2006-04-28 10:50:41 -0400 | [diff] [blame] | 24 | #include "lowcomms.h" |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 25 | |
| 26 | /* |
| 27 | * /config/dlm/<cluster>/spaces/<space>/nodes/<node>/nodeid |
| 28 | * /config/dlm/<cluster>/spaces/<space>/nodes/<node>/weight |
| 29 | * /config/dlm/<cluster>/comms/<comm>/nodeid |
| 30 | * /config/dlm/<cluster>/comms/<comm>/local |
| 31 | * /config/dlm/<cluster>/comms/<comm>/addr |
| 32 | * The <cluster> level is useless, but I haven't figured out how to avoid it. |
| 33 | */ |
| 34 | |
| 35 | static struct config_group *space_list; |
| 36 | static struct config_group *comm_list; |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 37 | static struct dlm_comm *local_comm; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 38 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 39 | struct dlm_clusters; |
| 40 | struct dlm_cluster; |
| 41 | struct dlm_spaces; |
| 42 | struct dlm_space; |
| 43 | struct dlm_comms; |
| 44 | struct dlm_comm; |
| 45 | struct dlm_nodes; |
| 46 | struct dlm_node; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 47 | |
Joel Becker | f89ab86 | 2008-07-17 14:53:48 -0700 | [diff] [blame] | 48 | static struct config_group *make_cluster(struct config_group *, const char *); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 49 | static void drop_cluster(struct config_group *, struct config_item *); |
| 50 | static void release_cluster(struct config_item *); |
Joel Becker | f89ab86 | 2008-07-17 14:53:48 -0700 | [diff] [blame] | 51 | static struct config_group *make_space(struct config_group *, const char *); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 52 | static void drop_space(struct config_group *, struct config_item *); |
| 53 | static void release_space(struct config_item *); |
Joel Becker | f89ab86 | 2008-07-17 14:53:48 -0700 | [diff] [blame] | 54 | static struct config_item *make_comm(struct config_group *, const char *); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 55 | static void drop_comm(struct config_group *, struct config_item *); |
| 56 | static void release_comm(struct config_item *); |
Joel Becker | f89ab86 | 2008-07-17 14:53:48 -0700 | [diff] [blame] | 57 | static struct config_item *make_node(struct config_group *, const char *); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 58 | static void drop_node(struct config_group *, struct config_item *); |
| 59 | static void release_node(struct config_item *); |
| 60 | |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 61 | static ssize_t show_cluster(struct config_item *i, struct configfs_attribute *a, |
| 62 | char *buf); |
| 63 | static ssize_t store_cluster(struct config_item *i, |
| 64 | struct configfs_attribute *a, |
| 65 | const char *buf, size_t len); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 66 | static ssize_t show_comm(struct config_item *i, struct configfs_attribute *a, |
| 67 | char *buf); |
| 68 | static ssize_t store_comm(struct config_item *i, struct configfs_attribute *a, |
| 69 | const char *buf, size_t len); |
| 70 | static ssize_t show_node(struct config_item *i, struct configfs_attribute *a, |
| 71 | char *buf); |
| 72 | static ssize_t store_node(struct config_item *i, struct configfs_attribute *a, |
| 73 | const char *buf, size_t len); |
| 74 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 75 | static ssize_t comm_nodeid_read(struct dlm_comm *cm, char *buf); |
| 76 | static ssize_t comm_nodeid_write(struct dlm_comm *cm, const char *buf, |
| 77 | size_t len); |
| 78 | static ssize_t comm_local_read(struct dlm_comm *cm, char *buf); |
| 79 | static ssize_t comm_local_write(struct dlm_comm *cm, const char *buf, |
| 80 | size_t len); |
| 81 | static ssize_t comm_addr_write(struct dlm_comm *cm, const char *buf, |
| 82 | size_t len); |
| 83 | static ssize_t node_nodeid_read(struct dlm_node *nd, char *buf); |
| 84 | static ssize_t node_nodeid_write(struct dlm_node *nd, const char *buf, |
| 85 | size_t len); |
| 86 | static ssize_t node_weight_read(struct dlm_node *nd, char *buf); |
| 87 | static ssize_t node_weight_write(struct dlm_node *nd, const char *buf, |
| 88 | size_t len); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 89 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 90 | struct dlm_cluster { |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 91 | struct config_group group; |
| 92 | unsigned int cl_tcp_port; |
| 93 | unsigned int cl_buffer_size; |
| 94 | unsigned int cl_rsbtbl_size; |
| 95 | unsigned int cl_lkbtbl_size; |
| 96 | unsigned int cl_dirtbl_size; |
| 97 | unsigned int cl_recover_timer; |
| 98 | unsigned int cl_toss_secs; |
| 99 | unsigned int cl_scan_secs; |
| 100 | unsigned int cl_log_debug; |
Patrick Caulfield | 6ed7257 | 2007-04-17 15:39:57 +0100 | [diff] [blame] | 101 | unsigned int cl_protocol; |
David Teigland | 3ae1acf | 2007-05-18 08:59:31 -0500 | [diff] [blame] | 102 | unsigned int cl_timewarn_cs; |
David Teigland | c6ff669 | 2011-03-28 14:17:26 -0500 | [diff] [blame] | 103 | unsigned int cl_waitwarn_us; |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 104 | }; |
| 105 | |
| 106 | enum { |
| 107 | CLUSTER_ATTR_TCP_PORT = 0, |
| 108 | CLUSTER_ATTR_BUFFER_SIZE, |
| 109 | CLUSTER_ATTR_RSBTBL_SIZE, |
| 110 | CLUSTER_ATTR_LKBTBL_SIZE, |
| 111 | CLUSTER_ATTR_DIRTBL_SIZE, |
| 112 | CLUSTER_ATTR_RECOVER_TIMER, |
| 113 | CLUSTER_ATTR_TOSS_SECS, |
| 114 | CLUSTER_ATTR_SCAN_SECS, |
| 115 | CLUSTER_ATTR_LOG_DEBUG, |
Patrick Caulfield | 6ed7257 | 2007-04-17 15:39:57 +0100 | [diff] [blame] | 116 | CLUSTER_ATTR_PROTOCOL, |
David Teigland | 3ae1acf | 2007-05-18 08:59:31 -0500 | [diff] [blame] | 117 | CLUSTER_ATTR_TIMEWARN_CS, |
David Teigland | c6ff669 | 2011-03-28 14:17:26 -0500 | [diff] [blame] | 118 | CLUSTER_ATTR_WAITWARN_US, |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 119 | }; |
| 120 | |
| 121 | struct cluster_attribute { |
| 122 | struct configfs_attribute attr; |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 123 | ssize_t (*show)(struct dlm_cluster *, char *); |
| 124 | ssize_t (*store)(struct dlm_cluster *, const char *, size_t); |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 125 | }; |
| 126 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 127 | static ssize_t cluster_set(struct dlm_cluster *cl, unsigned int *cl_field, |
Harvey Harrison | 5416b70 | 2008-02-13 16:54:29 -0800 | [diff] [blame] | 128 | int *info_field, int check_zero, |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 129 | const char *buf, size_t len) |
| 130 | { |
| 131 | unsigned int x; |
| 132 | |
| 133 | if (!capable(CAP_SYS_ADMIN)) |
| 134 | return -EACCES; |
| 135 | |
| 136 | x = simple_strtoul(buf, NULL, 0); |
| 137 | |
| 138 | if (check_zero && !x) |
| 139 | return -EINVAL; |
| 140 | |
| 141 | *cl_field = x; |
| 142 | *info_field = x; |
| 143 | |
| 144 | return len; |
| 145 | } |
| 146 | |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 147 | #define CLUSTER_ATTR(name, check_zero) \ |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 148 | static ssize_t name##_write(struct dlm_cluster *cl, const char *buf, size_t len) \ |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 149 | { \ |
| 150 | return cluster_set(cl, &cl->cl_##name, &dlm_config.ci_##name, \ |
| 151 | check_zero, buf, len); \ |
| 152 | } \ |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 153 | static ssize_t name##_read(struct dlm_cluster *cl, char *buf) \ |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 154 | { \ |
| 155 | return snprintf(buf, PAGE_SIZE, "%u\n", cl->cl_##name); \ |
| 156 | } \ |
| 157 | static struct cluster_attribute cluster_attr_##name = \ |
| 158 | __CONFIGFS_ATTR(name, 0644, name##_read, name##_write) |
| 159 | |
| 160 | CLUSTER_ATTR(tcp_port, 1); |
| 161 | CLUSTER_ATTR(buffer_size, 1); |
| 162 | CLUSTER_ATTR(rsbtbl_size, 1); |
| 163 | CLUSTER_ATTR(lkbtbl_size, 1); |
| 164 | CLUSTER_ATTR(dirtbl_size, 1); |
| 165 | CLUSTER_ATTR(recover_timer, 1); |
| 166 | CLUSTER_ATTR(toss_secs, 1); |
| 167 | CLUSTER_ATTR(scan_secs, 1); |
| 168 | CLUSTER_ATTR(log_debug, 0); |
Patrick Caulfield | 6ed7257 | 2007-04-17 15:39:57 +0100 | [diff] [blame] | 169 | CLUSTER_ATTR(protocol, 0); |
David Teigland | 3ae1acf | 2007-05-18 08:59:31 -0500 | [diff] [blame] | 170 | CLUSTER_ATTR(timewarn_cs, 1); |
David Teigland | c6ff669 | 2011-03-28 14:17:26 -0500 | [diff] [blame] | 171 | CLUSTER_ATTR(waitwarn_us, 0); |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 172 | |
| 173 | static struct configfs_attribute *cluster_attrs[] = { |
| 174 | [CLUSTER_ATTR_TCP_PORT] = &cluster_attr_tcp_port.attr, |
| 175 | [CLUSTER_ATTR_BUFFER_SIZE] = &cluster_attr_buffer_size.attr, |
| 176 | [CLUSTER_ATTR_RSBTBL_SIZE] = &cluster_attr_rsbtbl_size.attr, |
| 177 | [CLUSTER_ATTR_LKBTBL_SIZE] = &cluster_attr_lkbtbl_size.attr, |
| 178 | [CLUSTER_ATTR_DIRTBL_SIZE] = &cluster_attr_dirtbl_size.attr, |
| 179 | [CLUSTER_ATTR_RECOVER_TIMER] = &cluster_attr_recover_timer.attr, |
| 180 | [CLUSTER_ATTR_TOSS_SECS] = &cluster_attr_toss_secs.attr, |
| 181 | [CLUSTER_ATTR_SCAN_SECS] = &cluster_attr_scan_secs.attr, |
| 182 | [CLUSTER_ATTR_LOG_DEBUG] = &cluster_attr_log_debug.attr, |
Patrick Caulfield | 6ed7257 | 2007-04-17 15:39:57 +0100 | [diff] [blame] | 183 | [CLUSTER_ATTR_PROTOCOL] = &cluster_attr_protocol.attr, |
David Teigland | 3ae1acf | 2007-05-18 08:59:31 -0500 | [diff] [blame] | 184 | [CLUSTER_ATTR_TIMEWARN_CS] = &cluster_attr_timewarn_cs.attr, |
David Teigland | c6ff669 | 2011-03-28 14:17:26 -0500 | [diff] [blame] | 185 | [CLUSTER_ATTR_WAITWARN_US] = &cluster_attr_waitwarn_us.attr, |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 186 | NULL, |
| 187 | }; |
| 188 | |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 189 | enum { |
| 190 | COMM_ATTR_NODEID = 0, |
| 191 | COMM_ATTR_LOCAL, |
| 192 | COMM_ATTR_ADDR, |
| 193 | }; |
| 194 | |
| 195 | struct comm_attribute { |
| 196 | struct configfs_attribute attr; |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 197 | ssize_t (*show)(struct dlm_comm *, char *); |
| 198 | ssize_t (*store)(struct dlm_comm *, const char *, size_t); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 199 | }; |
| 200 | |
| 201 | static struct comm_attribute comm_attr_nodeid = { |
| 202 | .attr = { .ca_owner = THIS_MODULE, |
| 203 | .ca_name = "nodeid", |
| 204 | .ca_mode = S_IRUGO | S_IWUSR }, |
| 205 | .show = comm_nodeid_read, |
| 206 | .store = comm_nodeid_write, |
| 207 | }; |
| 208 | |
| 209 | static struct comm_attribute comm_attr_local = { |
| 210 | .attr = { .ca_owner = THIS_MODULE, |
| 211 | .ca_name = "local", |
| 212 | .ca_mode = S_IRUGO | S_IWUSR }, |
| 213 | .show = comm_local_read, |
| 214 | .store = comm_local_write, |
| 215 | }; |
| 216 | |
| 217 | static struct comm_attribute comm_attr_addr = { |
| 218 | .attr = { .ca_owner = THIS_MODULE, |
| 219 | .ca_name = "addr", |
| 220 | .ca_mode = S_IRUGO | S_IWUSR }, |
| 221 | .store = comm_addr_write, |
| 222 | }; |
| 223 | |
| 224 | static struct configfs_attribute *comm_attrs[] = { |
| 225 | [COMM_ATTR_NODEID] = &comm_attr_nodeid.attr, |
| 226 | [COMM_ATTR_LOCAL] = &comm_attr_local.attr, |
| 227 | [COMM_ATTR_ADDR] = &comm_attr_addr.attr, |
| 228 | NULL, |
| 229 | }; |
| 230 | |
| 231 | enum { |
| 232 | NODE_ATTR_NODEID = 0, |
| 233 | NODE_ATTR_WEIGHT, |
| 234 | }; |
| 235 | |
| 236 | struct node_attribute { |
| 237 | struct configfs_attribute attr; |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 238 | ssize_t (*show)(struct dlm_node *, char *); |
| 239 | ssize_t (*store)(struct dlm_node *, const char *, size_t); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 240 | }; |
| 241 | |
| 242 | static struct node_attribute node_attr_nodeid = { |
| 243 | .attr = { .ca_owner = THIS_MODULE, |
| 244 | .ca_name = "nodeid", |
| 245 | .ca_mode = S_IRUGO | S_IWUSR }, |
| 246 | .show = node_nodeid_read, |
| 247 | .store = node_nodeid_write, |
| 248 | }; |
| 249 | |
| 250 | static struct node_attribute node_attr_weight = { |
| 251 | .attr = { .ca_owner = THIS_MODULE, |
| 252 | .ca_name = "weight", |
| 253 | .ca_mode = S_IRUGO | S_IWUSR }, |
| 254 | .show = node_weight_read, |
| 255 | .store = node_weight_write, |
| 256 | }; |
| 257 | |
| 258 | static struct configfs_attribute *node_attrs[] = { |
| 259 | [NODE_ATTR_NODEID] = &node_attr_nodeid.attr, |
| 260 | [NODE_ATTR_WEIGHT] = &node_attr_weight.attr, |
| 261 | NULL, |
| 262 | }; |
| 263 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 264 | struct dlm_clusters { |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 265 | struct configfs_subsystem subsys; |
| 266 | }; |
| 267 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 268 | struct dlm_spaces { |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 269 | struct config_group ss_group; |
| 270 | }; |
| 271 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 272 | struct dlm_space { |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 273 | struct config_group group; |
| 274 | struct list_head members; |
David Teigland | 9013592 | 2006-01-20 08:47:07 +0000 | [diff] [blame] | 275 | struct mutex members_lock; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 276 | int members_count; |
| 277 | }; |
| 278 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 279 | struct dlm_comms { |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 280 | struct config_group cs_group; |
| 281 | }; |
| 282 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 283 | struct dlm_comm { |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 284 | struct config_item item; |
| 285 | int nodeid; |
| 286 | int local; |
| 287 | int addr_count; |
| 288 | struct sockaddr_storage *addr[DLM_MAX_ADDR_COUNT]; |
| 289 | }; |
| 290 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 291 | struct dlm_nodes { |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 292 | struct config_group ns_group; |
| 293 | }; |
| 294 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 295 | struct dlm_node { |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 296 | struct config_item item; |
| 297 | struct list_head list; /* space->members */ |
| 298 | int nodeid; |
| 299 | int weight; |
David Teigland | d44e0fc | 2008-03-18 14:22:11 -0500 | [diff] [blame] | 300 | int new; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 301 | }; |
| 302 | |
| 303 | static struct configfs_group_operations clusters_ops = { |
| 304 | .make_group = make_cluster, |
| 305 | .drop_item = drop_cluster, |
| 306 | }; |
| 307 | |
| 308 | static struct configfs_item_operations cluster_ops = { |
| 309 | .release = release_cluster, |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 310 | .show_attribute = show_cluster, |
| 311 | .store_attribute = store_cluster, |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 312 | }; |
| 313 | |
| 314 | static struct configfs_group_operations spaces_ops = { |
| 315 | .make_group = make_space, |
| 316 | .drop_item = drop_space, |
| 317 | }; |
| 318 | |
| 319 | static struct configfs_item_operations space_ops = { |
| 320 | .release = release_space, |
| 321 | }; |
| 322 | |
| 323 | static struct configfs_group_operations comms_ops = { |
| 324 | .make_item = make_comm, |
| 325 | .drop_item = drop_comm, |
| 326 | }; |
| 327 | |
| 328 | static struct configfs_item_operations comm_ops = { |
| 329 | .release = release_comm, |
| 330 | .show_attribute = show_comm, |
| 331 | .store_attribute = store_comm, |
| 332 | }; |
| 333 | |
| 334 | static struct configfs_group_operations nodes_ops = { |
| 335 | .make_item = make_node, |
| 336 | .drop_item = drop_node, |
| 337 | }; |
| 338 | |
| 339 | static struct configfs_item_operations node_ops = { |
| 340 | .release = release_node, |
| 341 | .show_attribute = show_node, |
| 342 | .store_attribute = store_node, |
| 343 | }; |
| 344 | |
| 345 | static struct config_item_type clusters_type = { |
| 346 | .ct_group_ops = &clusters_ops, |
| 347 | .ct_owner = THIS_MODULE, |
| 348 | }; |
| 349 | |
| 350 | static struct config_item_type cluster_type = { |
| 351 | .ct_item_ops = &cluster_ops, |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 352 | .ct_attrs = cluster_attrs, |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 353 | .ct_owner = THIS_MODULE, |
| 354 | }; |
| 355 | |
| 356 | static struct config_item_type spaces_type = { |
| 357 | .ct_group_ops = &spaces_ops, |
| 358 | .ct_owner = THIS_MODULE, |
| 359 | }; |
| 360 | |
| 361 | static struct config_item_type space_type = { |
| 362 | .ct_item_ops = &space_ops, |
| 363 | .ct_owner = THIS_MODULE, |
| 364 | }; |
| 365 | |
| 366 | static struct config_item_type comms_type = { |
| 367 | .ct_group_ops = &comms_ops, |
| 368 | .ct_owner = THIS_MODULE, |
| 369 | }; |
| 370 | |
| 371 | static struct config_item_type comm_type = { |
| 372 | .ct_item_ops = &comm_ops, |
| 373 | .ct_attrs = comm_attrs, |
| 374 | .ct_owner = THIS_MODULE, |
| 375 | }; |
| 376 | |
| 377 | static struct config_item_type nodes_type = { |
| 378 | .ct_group_ops = &nodes_ops, |
| 379 | .ct_owner = THIS_MODULE, |
| 380 | }; |
| 381 | |
| 382 | static struct config_item_type node_type = { |
| 383 | .ct_item_ops = &node_ops, |
| 384 | .ct_attrs = node_attrs, |
| 385 | .ct_owner = THIS_MODULE, |
| 386 | }; |
| 387 | |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 388 | static struct dlm_cluster *config_item_to_cluster(struct config_item *i) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 389 | { |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 390 | return i ? container_of(to_config_group(i), struct dlm_cluster, group) : |
| 391 | NULL; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 392 | } |
| 393 | |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 394 | static struct dlm_space *config_item_to_space(struct config_item *i) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 395 | { |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 396 | return i ? container_of(to_config_group(i), struct dlm_space, group) : |
| 397 | NULL; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 398 | } |
| 399 | |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 400 | static struct dlm_comm *config_item_to_comm(struct config_item *i) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 401 | { |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 402 | return i ? container_of(i, struct dlm_comm, item) : NULL; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 403 | } |
| 404 | |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 405 | static struct dlm_node *config_item_to_node(struct config_item *i) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 406 | { |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 407 | return i ? container_of(i, struct dlm_node, item) : NULL; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 408 | } |
| 409 | |
Joel Becker | f89ab86 | 2008-07-17 14:53:48 -0700 | [diff] [blame] | 410 | static struct config_group *make_cluster(struct config_group *g, |
| 411 | const char *name) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 412 | { |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 413 | struct dlm_cluster *cl = NULL; |
| 414 | struct dlm_spaces *sps = NULL; |
| 415 | struct dlm_comms *cms = NULL; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 416 | void *gps = NULL; |
| 417 | |
David Teigland | 573c24c | 2009-11-30 16:34:43 -0600 | [diff] [blame] | 418 | cl = kzalloc(sizeof(struct dlm_cluster), GFP_NOFS); |
| 419 | gps = kcalloc(3, sizeof(struct config_group *), GFP_NOFS); |
| 420 | sps = kzalloc(sizeof(struct dlm_spaces), GFP_NOFS); |
| 421 | cms = kzalloc(sizeof(struct dlm_comms), GFP_NOFS); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 422 | |
| 423 | if (!cl || !gps || !sps || !cms) |
| 424 | goto fail; |
| 425 | |
| 426 | config_group_init_type_name(&cl->group, name, &cluster_type); |
| 427 | config_group_init_type_name(&sps->ss_group, "spaces", &spaces_type); |
| 428 | config_group_init_type_name(&cms->cs_group, "comms", &comms_type); |
| 429 | |
| 430 | cl->group.default_groups = gps; |
| 431 | cl->group.default_groups[0] = &sps->ss_group; |
| 432 | cl->group.default_groups[1] = &cms->cs_group; |
| 433 | cl->group.default_groups[2] = NULL; |
| 434 | |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 435 | cl->cl_tcp_port = dlm_config.ci_tcp_port; |
| 436 | cl->cl_buffer_size = dlm_config.ci_buffer_size; |
| 437 | cl->cl_rsbtbl_size = dlm_config.ci_rsbtbl_size; |
| 438 | cl->cl_lkbtbl_size = dlm_config.ci_lkbtbl_size; |
| 439 | cl->cl_dirtbl_size = dlm_config.ci_dirtbl_size; |
| 440 | cl->cl_recover_timer = dlm_config.ci_recover_timer; |
| 441 | cl->cl_toss_secs = dlm_config.ci_toss_secs; |
| 442 | cl->cl_scan_secs = dlm_config.ci_scan_secs; |
| 443 | cl->cl_log_debug = dlm_config.ci_log_debug; |
David Teigland | 0b7cac0 | 2007-05-29 08:47:51 -0500 | [diff] [blame] | 444 | cl->cl_protocol = dlm_config.ci_protocol; |
David Teigland | 84d8cd6 | 2007-05-29 08:44:23 -0500 | [diff] [blame] | 445 | cl->cl_timewarn_cs = dlm_config.ci_timewarn_cs; |
David Teigland | c6ff669 | 2011-03-28 14:17:26 -0500 | [diff] [blame] | 446 | cl->cl_waitwarn_us = dlm_config.ci_waitwarn_us; |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 447 | |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 448 | space_list = &sps->ss_group; |
| 449 | comm_list = &cms->cs_group; |
Joel Becker | f89ab86 | 2008-07-17 14:53:48 -0700 | [diff] [blame] | 450 | return &cl->group; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 451 | |
| 452 | fail: |
| 453 | kfree(cl); |
| 454 | kfree(gps); |
| 455 | kfree(sps); |
| 456 | kfree(cms); |
Joel Becker | a6795e9 | 2008-07-17 15:21:29 -0700 | [diff] [blame] | 457 | return ERR_PTR(-ENOMEM); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 458 | } |
| 459 | |
| 460 | static void drop_cluster(struct config_group *g, struct config_item *i) |
| 461 | { |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 462 | struct dlm_cluster *cl = config_item_to_cluster(i); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 463 | struct config_item *tmp; |
| 464 | int j; |
| 465 | |
| 466 | for (j = 0; cl->group.default_groups[j]; j++) { |
| 467 | tmp = &cl->group.default_groups[j]->cg_item; |
| 468 | cl->group.default_groups[j] = NULL; |
| 469 | config_item_put(tmp); |
| 470 | } |
| 471 | |
| 472 | space_list = NULL; |
| 473 | comm_list = NULL; |
| 474 | |
| 475 | config_item_put(i); |
| 476 | } |
| 477 | |
| 478 | static void release_cluster(struct config_item *i) |
| 479 | { |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 480 | struct dlm_cluster *cl = config_item_to_cluster(i); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 481 | kfree(cl->group.default_groups); |
| 482 | kfree(cl); |
| 483 | } |
| 484 | |
Joel Becker | f89ab86 | 2008-07-17 14:53:48 -0700 | [diff] [blame] | 485 | static struct config_group *make_space(struct config_group *g, const char *name) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 486 | { |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 487 | struct dlm_space *sp = NULL; |
| 488 | struct dlm_nodes *nds = NULL; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 489 | void *gps = NULL; |
| 490 | |
David Teigland | 573c24c | 2009-11-30 16:34:43 -0600 | [diff] [blame] | 491 | sp = kzalloc(sizeof(struct dlm_space), GFP_NOFS); |
| 492 | gps = kcalloc(2, sizeof(struct config_group *), GFP_NOFS); |
| 493 | nds = kzalloc(sizeof(struct dlm_nodes), GFP_NOFS); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 494 | |
| 495 | if (!sp || !gps || !nds) |
| 496 | goto fail; |
| 497 | |
| 498 | config_group_init_type_name(&sp->group, name, &space_type); |
| 499 | config_group_init_type_name(&nds->ns_group, "nodes", &nodes_type); |
| 500 | |
| 501 | sp->group.default_groups = gps; |
| 502 | sp->group.default_groups[0] = &nds->ns_group; |
| 503 | sp->group.default_groups[1] = NULL; |
| 504 | |
| 505 | INIT_LIST_HEAD(&sp->members); |
David Teigland | 9013592 | 2006-01-20 08:47:07 +0000 | [diff] [blame] | 506 | mutex_init(&sp->members_lock); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 507 | sp->members_count = 0; |
Joel Becker | f89ab86 | 2008-07-17 14:53:48 -0700 | [diff] [blame] | 508 | return &sp->group; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 509 | |
| 510 | fail: |
| 511 | kfree(sp); |
| 512 | kfree(gps); |
| 513 | kfree(nds); |
Joel Becker | a6795e9 | 2008-07-17 15:21:29 -0700 | [diff] [blame] | 514 | return ERR_PTR(-ENOMEM); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 515 | } |
| 516 | |
| 517 | static void drop_space(struct config_group *g, struct config_item *i) |
| 518 | { |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 519 | struct dlm_space *sp = config_item_to_space(i); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 520 | struct config_item *tmp; |
| 521 | int j; |
| 522 | |
| 523 | /* assert list_empty(&sp->members) */ |
| 524 | |
| 525 | for (j = 0; sp->group.default_groups[j]; j++) { |
| 526 | tmp = &sp->group.default_groups[j]->cg_item; |
| 527 | sp->group.default_groups[j] = NULL; |
| 528 | config_item_put(tmp); |
| 529 | } |
| 530 | |
| 531 | config_item_put(i); |
| 532 | } |
| 533 | |
| 534 | static void release_space(struct config_item *i) |
| 535 | { |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 536 | struct dlm_space *sp = config_item_to_space(i); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 537 | kfree(sp->group.default_groups); |
| 538 | kfree(sp); |
| 539 | } |
| 540 | |
Joel Becker | f89ab86 | 2008-07-17 14:53:48 -0700 | [diff] [blame] | 541 | static struct config_item *make_comm(struct config_group *g, const char *name) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 542 | { |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 543 | struct dlm_comm *cm; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 544 | |
David Teigland | 573c24c | 2009-11-30 16:34:43 -0600 | [diff] [blame] | 545 | cm = kzalloc(sizeof(struct dlm_comm), GFP_NOFS); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 546 | if (!cm) |
Joel Becker | a6795e9 | 2008-07-17 15:21:29 -0700 | [diff] [blame] | 547 | return ERR_PTR(-ENOMEM); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 548 | |
| 549 | config_item_init_type_name(&cm->item, name, &comm_type); |
| 550 | cm->nodeid = -1; |
| 551 | cm->local = 0; |
| 552 | cm->addr_count = 0; |
Joel Becker | f89ab86 | 2008-07-17 14:53:48 -0700 | [diff] [blame] | 553 | return &cm->item; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 554 | } |
| 555 | |
| 556 | static void drop_comm(struct config_group *g, struct config_item *i) |
| 557 | { |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 558 | struct dlm_comm *cm = config_item_to_comm(i); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 559 | if (local_comm == cm) |
| 560 | local_comm = NULL; |
David Teigland | 1c032c0 | 2006-04-28 10:50:41 -0400 | [diff] [blame] | 561 | dlm_lowcomms_close(cm->nodeid); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 562 | while (cm->addr_count--) |
| 563 | kfree(cm->addr[cm->addr_count]); |
| 564 | config_item_put(i); |
| 565 | } |
| 566 | |
| 567 | static void release_comm(struct config_item *i) |
| 568 | { |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 569 | struct dlm_comm *cm = config_item_to_comm(i); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 570 | kfree(cm); |
| 571 | } |
| 572 | |
Joel Becker | f89ab86 | 2008-07-17 14:53:48 -0700 | [diff] [blame] | 573 | static struct config_item *make_node(struct config_group *g, const char *name) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 574 | { |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 575 | struct dlm_space *sp = config_item_to_space(g->cg_item.ci_parent); |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 576 | struct dlm_node *nd; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 577 | |
David Teigland | 573c24c | 2009-11-30 16:34:43 -0600 | [diff] [blame] | 578 | nd = kzalloc(sizeof(struct dlm_node), GFP_NOFS); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 579 | if (!nd) |
Joel Becker | a6795e9 | 2008-07-17 15:21:29 -0700 | [diff] [blame] | 580 | return ERR_PTR(-ENOMEM); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 581 | |
| 582 | config_item_init_type_name(&nd->item, name, &node_type); |
| 583 | nd->nodeid = -1; |
| 584 | nd->weight = 1; /* default weight of 1 if none is set */ |
David Teigland | d44e0fc | 2008-03-18 14:22:11 -0500 | [diff] [blame] | 585 | nd->new = 1; /* set to 0 once it's been read by dlm_nodeid_list() */ |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 586 | |
David Teigland | 9013592 | 2006-01-20 08:47:07 +0000 | [diff] [blame] | 587 | mutex_lock(&sp->members_lock); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 588 | list_add(&nd->list, &sp->members); |
| 589 | sp->members_count++; |
David Teigland | 9013592 | 2006-01-20 08:47:07 +0000 | [diff] [blame] | 590 | mutex_unlock(&sp->members_lock); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 591 | |
Joel Becker | f89ab86 | 2008-07-17 14:53:48 -0700 | [diff] [blame] | 592 | return &nd->item; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 593 | } |
| 594 | |
| 595 | static void drop_node(struct config_group *g, struct config_item *i) |
| 596 | { |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 597 | struct dlm_space *sp = config_item_to_space(g->cg_item.ci_parent); |
| 598 | struct dlm_node *nd = config_item_to_node(i); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 599 | |
David Teigland | 9013592 | 2006-01-20 08:47:07 +0000 | [diff] [blame] | 600 | mutex_lock(&sp->members_lock); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 601 | list_del(&nd->list); |
| 602 | sp->members_count--; |
David Teigland | 9013592 | 2006-01-20 08:47:07 +0000 | [diff] [blame] | 603 | mutex_unlock(&sp->members_lock); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 604 | |
| 605 | config_item_put(i); |
| 606 | } |
| 607 | |
| 608 | static void release_node(struct config_item *i) |
| 609 | { |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 610 | struct dlm_node *nd = config_item_to_node(i); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 611 | kfree(nd); |
| 612 | } |
| 613 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 614 | static struct dlm_clusters clusters_root = { |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 615 | .subsys = { |
| 616 | .su_group = { |
| 617 | .cg_item = { |
| 618 | .ci_namebuf = "dlm", |
| 619 | .ci_type = &clusters_type, |
| 620 | }, |
| 621 | }, |
| 622 | }, |
| 623 | }; |
| 624 | |
Denis Cheng | 3072717 | 2008-02-02 01:53:46 +0800 | [diff] [blame] | 625 | int __init dlm_config_init(void) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 626 | { |
| 627 | config_group_init(&clusters_root.subsys.su_group); |
Joel Becker | e6bd07a | 2007-07-06 23:33:17 -0700 | [diff] [blame] | 628 | mutex_init(&clusters_root.subsys.su_mutex); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 629 | return configfs_register_subsystem(&clusters_root.subsys); |
| 630 | } |
| 631 | |
| 632 | void dlm_config_exit(void) |
| 633 | { |
| 634 | configfs_unregister_subsystem(&clusters_root.subsys); |
| 635 | } |
| 636 | |
| 637 | /* |
| 638 | * Functions for user space to read/write attributes |
| 639 | */ |
| 640 | |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 641 | static ssize_t show_cluster(struct config_item *i, struct configfs_attribute *a, |
| 642 | char *buf) |
| 643 | { |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 644 | struct dlm_cluster *cl = config_item_to_cluster(i); |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 645 | struct cluster_attribute *cla = |
| 646 | container_of(a, struct cluster_attribute, attr); |
| 647 | return cla->show ? cla->show(cl, buf) : 0; |
| 648 | } |
| 649 | |
| 650 | static ssize_t store_cluster(struct config_item *i, |
| 651 | struct configfs_attribute *a, |
| 652 | const char *buf, size_t len) |
| 653 | { |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 654 | struct dlm_cluster *cl = config_item_to_cluster(i); |
David Teigland | d200778 | 2007-01-09 09:46:02 -0600 | [diff] [blame] | 655 | struct cluster_attribute *cla = |
| 656 | container_of(a, struct cluster_attribute, attr); |
| 657 | return cla->store ? cla->store(cl, buf, len) : -EINVAL; |
| 658 | } |
| 659 | |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 660 | static ssize_t show_comm(struct config_item *i, struct configfs_attribute *a, |
| 661 | char *buf) |
| 662 | { |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 663 | struct dlm_comm *cm = config_item_to_comm(i); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 664 | struct comm_attribute *cma = |
| 665 | container_of(a, struct comm_attribute, attr); |
| 666 | return cma->show ? cma->show(cm, buf) : 0; |
| 667 | } |
| 668 | |
| 669 | static ssize_t store_comm(struct config_item *i, struct configfs_attribute *a, |
| 670 | const char *buf, size_t len) |
| 671 | { |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 672 | struct dlm_comm *cm = config_item_to_comm(i); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 673 | struct comm_attribute *cma = |
| 674 | container_of(a, struct comm_attribute, attr); |
| 675 | return cma->store ? cma->store(cm, buf, len) : -EINVAL; |
| 676 | } |
| 677 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 678 | static ssize_t comm_nodeid_read(struct dlm_comm *cm, char *buf) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 679 | { |
| 680 | return sprintf(buf, "%d\n", cm->nodeid); |
| 681 | } |
| 682 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 683 | static ssize_t comm_nodeid_write(struct dlm_comm *cm, const char *buf, |
| 684 | size_t len) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 685 | { |
| 686 | cm->nodeid = simple_strtol(buf, NULL, 0); |
| 687 | return len; |
| 688 | } |
| 689 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 690 | static ssize_t comm_local_read(struct dlm_comm *cm, char *buf) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 691 | { |
| 692 | return sprintf(buf, "%d\n", cm->local); |
| 693 | } |
| 694 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 695 | static ssize_t comm_local_write(struct dlm_comm *cm, const char *buf, |
| 696 | size_t len) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 697 | { |
| 698 | cm->local= simple_strtol(buf, NULL, 0); |
| 699 | if (cm->local && !local_comm) |
| 700 | local_comm = cm; |
| 701 | return len; |
| 702 | } |
| 703 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 704 | static ssize_t comm_addr_write(struct dlm_comm *cm, const char *buf, size_t len) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 705 | { |
| 706 | struct sockaddr_storage *addr; |
| 707 | |
| 708 | if (len != sizeof(struct sockaddr_storage)) |
| 709 | return -EINVAL; |
| 710 | |
| 711 | if (cm->addr_count >= DLM_MAX_ADDR_COUNT) |
| 712 | return -ENOSPC; |
| 713 | |
David Teigland | 573c24c | 2009-11-30 16:34:43 -0600 | [diff] [blame] | 714 | addr = kzalloc(sizeof(*addr), GFP_NOFS); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 715 | if (!addr) |
| 716 | return -ENOMEM; |
| 717 | |
| 718 | memcpy(addr, buf, len); |
| 719 | cm->addr[cm->addr_count++] = addr; |
| 720 | return len; |
| 721 | } |
| 722 | |
| 723 | static ssize_t show_node(struct config_item *i, struct configfs_attribute *a, |
| 724 | char *buf) |
| 725 | { |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 726 | struct dlm_node *nd = config_item_to_node(i); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 727 | struct node_attribute *nda = |
| 728 | container_of(a, struct node_attribute, attr); |
| 729 | return nda->show ? nda->show(nd, buf) : 0; |
| 730 | } |
| 731 | |
| 732 | static ssize_t store_node(struct config_item *i, struct configfs_attribute *a, |
| 733 | const char *buf, size_t len) |
| 734 | { |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 735 | struct dlm_node *nd = config_item_to_node(i); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 736 | struct node_attribute *nda = |
| 737 | container_of(a, struct node_attribute, attr); |
| 738 | return nda->store ? nda->store(nd, buf, len) : -EINVAL; |
| 739 | } |
| 740 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 741 | static ssize_t node_nodeid_read(struct dlm_node *nd, char *buf) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 742 | { |
| 743 | return sprintf(buf, "%d\n", nd->nodeid); |
| 744 | } |
| 745 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 746 | static ssize_t node_nodeid_write(struct dlm_node *nd, const char *buf, |
| 747 | size_t len) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 748 | { |
| 749 | nd->nodeid = simple_strtol(buf, NULL, 0); |
| 750 | return len; |
| 751 | } |
| 752 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 753 | static ssize_t node_weight_read(struct dlm_node *nd, char *buf) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 754 | { |
| 755 | return sprintf(buf, "%d\n", nd->weight); |
| 756 | } |
| 757 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 758 | static ssize_t node_weight_write(struct dlm_node *nd, const char *buf, |
| 759 | size_t len) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 760 | { |
| 761 | nd->weight = simple_strtol(buf, NULL, 0); |
| 762 | return len; |
| 763 | } |
| 764 | |
| 765 | /* |
| 766 | * Functions for the dlm to get the info that's been configured |
| 767 | */ |
| 768 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 769 | static struct dlm_space *get_space(char *name) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 770 | { |
Satyam Sharma | 3168b07 | 2007-05-08 09:18:58 +0100 | [diff] [blame] | 771 | struct config_item *i; |
| 772 | |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 773 | if (!space_list) |
| 774 | return NULL; |
Satyam Sharma | 3168b07 | 2007-05-08 09:18:58 +0100 | [diff] [blame] | 775 | |
Joel Becker | e6bd07a | 2007-07-06 23:33:17 -0700 | [diff] [blame] | 776 | mutex_lock(&space_list->cg_subsys->su_mutex); |
Satyam Sharma | 3fe6c5c | 2007-07-04 16:37:16 +0530 | [diff] [blame] | 777 | i = config_group_find_item(space_list, name); |
Joel Becker | e6bd07a | 2007-07-06 23:33:17 -0700 | [diff] [blame] | 778 | mutex_unlock(&space_list->cg_subsys->su_mutex); |
Satyam Sharma | 3168b07 | 2007-05-08 09:18:58 +0100 | [diff] [blame] | 779 | |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 780 | return config_item_to_space(i); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 781 | } |
| 782 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 783 | static void put_space(struct dlm_space *sp) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 784 | { |
| 785 | config_item_put(&sp->group.cg_item); |
| 786 | } |
| 787 | |
David Teigland | 44be6fd | 2008-08-28 11:36:19 -0500 | [diff] [blame] | 788 | static int addr_compare(struct sockaddr_storage *x, struct sockaddr_storage *y) |
| 789 | { |
| 790 | switch (x->ss_family) { |
| 791 | case AF_INET: { |
| 792 | struct sockaddr_in *sinx = (struct sockaddr_in *)x; |
| 793 | struct sockaddr_in *siny = (struct sockaddr_in *)y; |
| 794 | if (sinx->sin_addr.s_addr != siny->sin_addr.s_addr) |
| 795 | return 0; |
| 796 | if (sinx->sin_port != siny->sin_port) |
| 797 | return 0; |
| 798 | break; |
| 799 | } |
| 800 | case AF_INET6: { |
| 801 | struct sockaddr_in6 *sinx = (struct sockaddr_in6 *)x; |
| 802 | struct sockaddr_in6 *siny = (struct sockaddr_in6 *)y; |
| 803 | if (!ipv6_addr_equal(&sinx->sin6_addr, &siny->sin6_addr)) |
| 804 | return 0; |
| 805 | if (sinx->sin6_port != siny->sin6_port) |
| 806 | return 0; |
| 807 | break; |
| 808 | } |
| 809 | default: |
| 810 | return 0; |
| 811 | } |
| 812 | return 1; |
| 813 | } |
| 814 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 815 | static struct dlm_comm *get_comm(int nodeid, struct sockaddr_storage *addr) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 816 | { |
| 817 | struct config_item *i; |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 818 | struct dlm_comm *cm = NULL; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 819 | int found = 0; |
| 820 | |
| 821 | if (!comm_list) |
| 822 | return NULL; |
| 823 | |
Joel Becker | e6bd07a | 2007-07-06 23:33:17 -0700 | [diff] [blame] | 824 | mutex_lock(&clusters_root.subsys.su_mutex); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 825 | |
| 826 | list_for_each_entry(i, &comm_list->cg_children, ci_entry) { |
Andrew Morton | 27eccf4 | 2008-09-05 08:42:08 -0500 | [diff] [blame] | 827 | cm = config_item_to_comm(i); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 828 | |
| 829 | if (nodeid) { |
| 830 | if (cm->nodeid != nodeid) |
| 831 | continue; |
| 832 | found = 1; |
Satyam Sharma | 3168b07 | 2007-05-08 09:18:58 +0100 | [diff] [blame] | 833 | config_item_get(i); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 834 | break; |
| 835 | } else { |
David Teigland | 44be6fd | 2008-08-28 11:36:19 -0500 | [diff] [blame] | 836 | if (!cm->addr_count || !addr_compare(cm->addr[0], addr)) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 837 | continue; |
| 838 | found = 1; |
Satyam Sharma | 3168b07 | 2007-05-08 09:18:58 +0100 | [diff] [blame] | 839 | config_item_get(i); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 840 | break; |
| 841 | } |
| 842 | } |
Joel Becker | e6bd07a | 2007-07-06 23:33:17 -0700 | [diff] [blame] | 843 | mutex_unlock(&clusters_root.subsys.su_mutex); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 844 | |
Satyam Sharma | 3168b07 | 2007-05-08 09:18:58 +0100 | [diff] [blame] | 845 | if (!found) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 846 | cm = NULL; |
| 847 | return cm; |
| 848 | } |
| 849 | |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 850 | static void put_comm(struct dlm_comm *cm) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 851 | { |
| 852 | config_item_put(&cm->item); |
| 853 | } |
| 854 | |
| 855 | /* caller must free mem */ |
David Teigland | d44e0fc | 2008-03-18 14:22:11 -0500 | [diff] [blame] | 856 | int dlm_nodeid_list(char *lsname, int **ids_out, int *ids_count_out, |
| 857 | int **new_out, int *new_count_out) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 858 | { |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 859 | struct dlm_space *sp; |
| 860 | struct dlm_node *nd; |
David Teigland | d44e0fc | 2008-03-18 14:22:11 -0500 | [diff] [blame] | 861 | int i = 0, rv = 0, ids_count = 0, new_count = 0; |
| 862 | int *ids, *new; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 863 | |
| 864 | sp = get_space(lsname); |
| 865 | if (!sp) |
| 866 | return -EEXIST; |
| 867 | |
David Teigland | 9013592 | 2006-01-20 08:47:07 +0000 | [diff] [blame] | 868 | mutex_lock(&sp->members_lock); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 869 | if (!sp->members_count) { |
David Teigland | d44e0fc | 2008-03-18 14:22:11 -0500 | [diff] [blame] | 870 | rv = -EINVAL; |
| 871 | printk(KERN_ERR "dlm: zero members_count\n"); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 872 | goto out; |
| 873 | } |
| 874 | |
David Teigland | d44e0fc | 2008-03-18 14:22:11 -0500 | [diff] [blame] | 875 | ids_count = sp->members_count; |
| 876 | |
David Teigland | 573c24c | 2009-11-30 16:34:43 -0600 | [diff] [blame] | 877 | ids = kcalloc(ids_count, sizeof(int), GFP_NOFS); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 878 | if (!ids) { |
| 879 | rv = -ENOMEM; |
| 880 | goto out; |
| 881 | } |
| 882 | |
David Teigland | d44e0fc | 2008-03-18 14:22:11 -0500 | [diff] [blame] | 883 | list_for_each_entry(nd, &sp->members, list) { |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 884 | ids[i++] = nd->nodeid; |
David Teigland | d44e0fc | 2008-03-18 14:22:11 -0500 | [diff] [blame] | 885 | if (nd->new) |
| 886 | new_count++; |
| 887 | } |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 888 | |
David Teigland | d44e0fc | 2008-03-18 14:22:11 -0500 | [diff] [blame] | 889 | if (ids_count != i) |
| 890 | printk(KERN_ERR "dlm: bad nodeid count %d %d\n", ids_count, i); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 891 | |
David Teigland | d44e0fc | 2008-03-18 14:22:11 -0500 | [diff] [blame] | 892 | if (!new_count) |
| 893 | goto out_ids; |
| 894 | |
David Teigland | 573c24c | 2009-11-30 16:34:43 -0600 | [diff] [blame] | 895 | new = kcalloc(new_count, sizeof(int), GFP_NOFS); |
David Teigland | d44e0fc | 2008-03-18 14:22:11 -0500 | [diff] [blame] | 896 | if (!new) { |
| 897 | kfree(ids); |
| 898 | rv = -ENOMEM; |
| 899 | goto out; |
| 900 | } |
| 901 | |
| 902 | i = 0; |
| 903 | list_for_each_entry(nd, &sp->members, list) { |
| 904 | if (nd->new) { |
| 905 | new[i++] = nd->nodeid; |
| 906 | nd->new = 0; |
| 907 | } |
| 908 | } |
| 909 | *new_count_out = new_count; |
| 910 | *new_out = new; |
| 911 | |
| 912 | out_ids: |
| 913 | *ids_count_out = ids_count; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 914 | *ids_out = ids; |
| 915 | out: |
David Teigland | 9013592 | 2006-01-20 08:47:07 +0000 | [diff] [blame] | 916 | mutex_unlock(&sp->members_lock); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 917 | put_space(sp); |
| 918 | return rv; |
| 919 | } |
| 920 | |
| 921 | int dlm_node_weight(char *lsname, int nodeid) |
| 922 | { |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 923 | struct dlm_space *sp; |
| 924 | struct dlm_node *nd; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 925 | int w = -EEXIST; |
| 926 | |
| 927 | sp = get_space(lsname); |
| 928 | if (!sp) |
| 929 | goto out; |
| 930 | |
David Teigland | 9013592 | 2006-01-20 08:47:07 +0000 | [diff] [blame] | 931 | mutex_lock(&sp->members_lock); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 932 | list_for_each_entry(nd, &sp->members, list) { |
| 933 | if (nd->nodeid != nodeid) |
| 934 | continue; |
| 935 | w = nd->weight; |
| 936 | break; |
| 937 | } |
David Teigland | 9013592 | 2006-01-20 08:47:07 +0000 | [diff] [blame] | 938 | mutex_unlock(&sp->members_lock); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 939 | put_space(sp); |
| 940 | out: |
| 941 | return w; |
| 942 | } |
| 943 | |
| 944 | int dlm_nodeid_to_addr(int nodeid, struct sockaddr_storage *addr) |
| 945 | { |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 946 | struct dlm_comm *cm = get_comm(nodeid, NULL); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 947 | if (!cm) |
| 948 | return -EEXIST; |
| 949 | if (!cm->addr_count) |
| 950 | return -ENOENT; |
| 951 | memcpy(addr, cm->addr[0], sizeof(*addr)); |
| 952 | put_comm(cm); |
| 953 | return 0; |
| 954 | } |
| 955 | |
| 956 | int dlm_addr_to_nodeid(struct sockaddr_storage *addr, int *nodeid) |
| 957 | { |
David Teigland | 5140934 | 2008-07-31 09:31:53 -0500 | [diff] [blame] | 958 | struct dlm_comm *cm = get_comm(0, addr); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 959 | if (!cm) |
| 960 | return -EEXIST; |
| 961 | *nodeid = cm->nodeid; |
| 962 | put_comm(cm); |
| 963 | return 0; |
| 964 | } |
| 965 | |
| 966 | int dlm_our_nodeid(void) |
| 967 | { |
| 968 | return local_comm ? local_comm->nodeid : 0; |
| 969 | } |
| 970 | |
| 971 | /* num 0 is first addr, num 1 is second addr */ |
| 972 | int dlm_our_addr(struct sockaddr_storage *addr, int num) |
| 973 | { |
| 974 | if (!local_comm) |
| 975 | return -1; |
| 976 | if (num + 1 > local_comm->addr_count) |
| 977 | return -1; |
| 978 | memcpy(addr, local_comm->addr[num], sizeof(*addr)); |
| 979 | return 0; |
| 980 | } |
| 981 | |
| 982 | /* Config file defaults */ |
| 983 | #define DEFAULT_TCP_PORT 21064 |
| 984 | #define DEFAULT_BUFFER_SIZE 4096 |
David Teigland | e3853a9 | 2011-03-10 13:07:17 -0600 | [diff] [blame] | 985 | #define DEFAULT_RSBTBL_SIZE 1024 |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 986 | #define DEFAULT_LKBTBL_SIZE 1024 |
David Teigland | e3853a9 | 2011-03-10 13:07:17 -0600 | [diff] [blame] | 987 | #define DEFAULT_DIRTBL_SIZE 1024 |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 988 | #define DEFAULT_RECOVER_TIMER 5 |
| 989 | #define DEFAULT_TOSS_SECS 10 |
| 990 | #define DEFAULT_SCAN_SECS 5 |
David Teigland | 99fc648 | 2007-01-09 09:44:01 -0600 | [diff] [blame] | 991 | #define DEFAULT_LOG_DEBUG 0 |
Patrick Caulfield | 6ed7257 | 2007-04-17 15:39:57 +0100 | [diff] [blame] | 992 | #define DEFAULT_PROTOCOL 0 |
David Teigland | 3ae1acf | 2007-05-18 08:59:31 -0500 | [diff] [blame] | 993 | #define DEFAULT_TIMEWARN_CS 500 /* 5 sec = 500 centiseconds */ |
David Teigland | c6ff669 | 2011-03-28 14:17:26 -0500 | [diff] [blame] | 994 | #define DEFAULT_WAITWARN_US 0 |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 995 | |
| 996 | struct dlm_config_info dlm_config = { |
David Teigland | 68c817a | 2007-01-09 09:41:48 -0600 | [diff] [blame] | 997 | .ci_tcp_port = DEFAULT_TCP_PORT, |
| 998 | .ci_buffer_size = DEFAULT_BUFFER_SIZE, |
| 999 | .ci_rsbtbl_size = DEFAULT_RSBTBL_SIZE, |
| 1000 | .ci_lkbtbl_size = DEFAULT_LKBTBL_SIZE, |
| 1001 | .ci_dirtbl_size = DEFAULT_DIRTBL_SIZE, |
| 1002 | .ci_recover_timer = DEFAULT_RECOVER_TIMER, |
| 1003 | .ci_toss_secs = DEFAULT_TOSS_SECS, |
David Teigland | 99fc648 | 2007-01-09 09:44:01 -0600 | [diff] [blame] | 1004 | .ci_scan_secs = DEFAULT_SCAN_SECS, |
Patrick Caulfield | 6ed7257 | 2007-04-17 15:39:57 +0100 | [diff] [blame] | 1005 | .ci_log_debug = DEFAULT_LOG_DEBUG, |
David Teigland | 3ae1acf | 2007-05-18 08:59:31 -0500 | [diff] [blame] | 1006 | .ci_protocol = DEFAULT_PROTOCOL, |
David Teigland | c6ff669 | 2011-03-28 14:17:26 -0500 | [diff] [blame] | 1007 | .ci_timewarn_cs = DEFAULT_TIMEWARN_CS, |
| 1008 | .ci_waitwarn_us = DEFAULT_WAITWARN_US |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 1009 | }; |
| 1010 | |