blob: 89d2fb7b991ae13f1ada96176a5dca785b9dd646 [file] [log] [blame]
David Teiglande7fd4172006-01-18 09:30:29 +00001/******************************************************************************
2*******************************************************************************
3**
4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
David Teigland51409342008-07-31 09:31:53 -05005** Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
David Teiglande7fd4172006-01-18 09:30:29 +00006**
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>
17#include <net/sock.h>
18
19#include "config.h"
David Teigland1c032c02006-04-28 10:50:41 -040020#include "lowcomms.h"
David Teiglande7fd4172006-01-18 09:30:29 +000021
22/*
23 * /config/dlm/<cluster>/spaces/<space>/nodes/<node>/nodeid
24 * /config/dlm/<cluster>/spaces/<space>/nodes/<node>/weight
25 * /config/dlm/<cluster>/comms/<comm>/nodeid
26 * /config/dlm/<cluster>/comms/<comm>/local
27 * /config/dlm/<cluster>/comms/<comm>/addr
28 * The <cluster> level is useless, but I haven't figured out how to avoid it.
29 */
30
31static struct config_group *space_list;
32static struct config_group *comm_list;
David Teigland51409342008-07-31 09:31:53 -050033static struct dlm_comm *local_comm;
David Teiglande7fd4172006-01-18 09:30:29 +000034
David Teigland51409342008-07-31 09:31:53 -050035struct dlm_clusters;
36struct dlm_cluster;
37struct dlm_spaces;
38struct dlm_space;
39struct dlm_comms;
40struct dlm_comm;
41struct dlm_nodes;
42struct dlm_node;
David Teiglande7fd4172006-01-18 09:30:29 +000043
Joel Beckerf89ab862008-07-17 14:53:48 -070044static struct config_group *make_cluster(struct config_group *, const char *);
David Teiglande7fd4172006-01-18 09:30:29 +000045static void drop_cluster(struct config_group *, struct config_item *);
46static void release_cluster(struct config_item *);
Joel Beckerf89ab862008-07-17 14:53:48 -070047static struct config_group *make_space(struct config_group *, const char *);
David Teiglande7fd4172006-01-18 09:30:29 +000048static void drop_space(struct config_group *, struct config_item *);
49static void release_space(struct config_item *);
Joel Beckerf89ab862008-07-17 14:53:48 -070050static struct config_item *make_comm(struct config_group *, const char *);
David Teiglande7fd4172006-01-18 09:30:29 +000051static void drop_comm(struct config_group *, struct config_item *);
52static void release_comm(struct config_item *);
Joel Beckerf89ab862008-07-17 14:53:48 -070053static struct config_item *make_node(struct config_group *, const char *);
David Teiglande7fd4172006-01-18 09:30:29 +000054static void drop_node(struct config_group *, struct config_item *);
55static void release_node(struct config_item *);
56
David Teiglandd2007782007-01-09 09:46:02 -060057static ssize_t show_cluster(struct config_item *i, struct configfs_attribute *a,
58 char *buf);
59static ssize_t store_cluster(struct config_item *i,
60 struct configfs_attribute *a,
61 const char *buf, size_t len);
David Teiglande7fd4172006-01-18 09:30:29 +000062static ssize_t show_comm(struct config_item *i, struct configfs_attribute *a,
63 char *buf);
64static ssize_t store_comm(struct config_item *i, struct configfs_attribute *a,
65 const char *buf, size_t len);
66static ssize_t show_node(struct config_item *i, struct configfs_attribute *a,
67 char *buf);
68static ssize_t store_node(struct config_item *i, struct configfs_attribute *a,
69 const char *buf, size_t len);
70
David Teigland51409342008-07-31 09:31:53 -050071static ssize_t comm_nodeid_read(struct dlm_comm *cm, char *buf);
72static ssize_t comm_nodeid_write(struct dlm_comm *cm, const char *buf,
73 size_t len);
74static ssize_t comm_local_read(struct dlm_comm *cm, char *buf);
75static ssize_t comm_local_write(struct dlm_comm *cm, const char *buf,
76 size_t len);
77static ssize_t comm_addr_write(struct dlm_comm *cm, const char *buf,
78 size_t len);
79static ssize_t node_nodeid_read(struct dlm_node *nd, char *buf);
80static ssize_t node_nodeid_write(struct dlm_node *nd, const char *buf,
81 size_t len);
82static ssize_t node_weight_read(struct dlm_node *nd, char *buf);
83static ssize_t node_weight_write(struct dlm_node *nd, const char *buf,
84 size_t len);
David Teiglande7fd4172006-01-18 09:30:29 +000085
David Teigland51409342008-07-31 09:31:53 -050086struct dlm_cluster {
David Teiglandd2007782007-01-09 09:46:02 -060087 struct config_group group;
88 unsigned int cl_tcp_port;
89 unsigned int cl_buffer_size;
90 unsigned int cl_rsbtbl_size;
91 unsigned int cl_lkbtbl_size;
92 unsigned int cl_dirtbl_size;
93 unsigned int cl_recover_timer;
94 unsigned int cl_toss_secs;
95 unsigned int cl_scan_secs;
96 unsigned int cl_log_debug;
Patrick Caulfield6ed7257b2007-04-17 15:39:57 +010097 unsigned int cl_protocol;
David Teigland3ae1acf2007-05-18 08:59:31 -050098 unsigned int cl_timewarn_cs;
David Teiglandd2007782007-01-09 09:46:02 -060099};
100
101enum {
102 CLUSTER_ATTR_TCP_PORT = 0,
103 CLUSTER_ATTR_BUFFER_SIZE,
104 CLUSTER_ATTR_RSBTBL_SIZE,
105 CLUSTER_ATTR_LKBTBL_SIZE,
106 CLUSTER_ATTR_DIRTBL_SIZE,
107 CLUSTER_ATTR_RECOVER_TIMER,
108 CLUSTER_ATTR_TOSS_SECS,
109 CLUSTER_ATTR_SCAN_SECS,
110 CLUSTER_ATTR_LOG_DEBUG,
Patrick Caulfield6ed7257b2007-04-17 15:39:57 +0100111 CLUSTER_ATTR_PROTOCOL,
David Teigland3ae1acf2007-05-18 08:59:31 -0500112 CLUSTER_ATTR_TIMEWARN_CS,
David Teiglandd2007782007-01-09 09:46:02 -0600113};
114
115struct cluster_attribute {
116 struct configfs_attribute attr;
David Teigland51409342008-07-31 09:31:53 -0500117 ssize_t (*show)(struct dlm_cluster *, char *);
118 ssize_t (*store)(struct dlm_cluster *, const char *, size_t);
David Teiglandd2007782007-01-09 09:46:02 -0600119};
120
David Teigland51409342008-07-31 09:31:53 -0500121static ssize_t cluster_set(struct dlm_cluster *cl, unsigned int *cl_field,
Harvey Harrison5416b702008-02-13 16:54:29 -0800122 int *info_field, int check_zero,
David Teiglandd2007782007-01-09 09:46:02 -0600123 const char *buf, size_t len)
124{
125 unsigned int x;
126
127 if (!capable(CAP_SYS_ADMIN))
128 return -EACCES;
129
130 x = simple_strtoul(buf, NULL, 0);
131
132 if (check_zero && !x)
133 return -EINVAL;
134
135 *cl_field = x;
136 *info_field = x;
137
138 return len;
139}
140
David Teiglandd2007782007-01-09 09:46:02 -0600141#define CLUSTER_ATTR(name, check_zero) \
David Teigland51409342008-07-31 09:31:53 -0500142static ssize_t name##_write(struct dlm_cluster *cl, const char *buf, size_t len) \
David Teiglandd2007782007-01-09 09:46:02 -0600143{ \
144 return cluster_set(cl, &cl->cl_##name, &dlm_config.ci_##name, \
145 check_zero, buf, len); \
146} \
David Teigland51409342008-07-31 09:31:53 -0500147static ssize_t name##_read(struct dlm_cluster *cl, char *buf) \
David Teiglandd2007782007-01-09 09:46:02 -0600148{ \
149 return snprintf(buf, PAGE_SIZE, "%u\n", cl->cl_##name); \
150} \
151static struct cluster_attribute cluster_attr_##name = \
152__CONFIGFS_ATTR(name, 0644, name##_read, name##_write)
153
154CLUSTER_ATTR(tcp_port, 1);
155CLUSTER_ATTR(buffer_size, 1);
156CLUSTER_ATTR(rsbtbl_size, 1);
157CLUSTER_ATTR(lkbtbl_size, 1);
158CLUSTER_ATTR(dirtbl_size, 1);
159CLUSTER_ATTR(recover_timer, 1);
160CLUSTER_ATTR(toss_secs, 1);
161CLUSTER_ATTR(scan_secs, 1);
162CLUSTER_ATTR(log_debug, 0);
Patrick Caulfield6ed7257b2007-04-17 15:39:57 +0100163CLUSTER_ATTR(protocol, 0);
David Teigland3ae1acf2007-05-18 08:59:31 -0500164CLUSTER_ATTR(timewarn_cs, 1);
David Teiglandd2007782007-01-09 09:46:02 -0600165
166static struct configfs_attribute *cluster_attrs[] = {
167 [CLUSTER_ATTR_TCP_PORT] = &cluster_attr_tcp_port.attr,
168 [CLUSTER_ATTR_BUFFER_SIZE] = &cluster_attr_buffer_size.attr,
169 [CLUSTER_ATTR_RSBTBL_SIZE] = &cluster_attr_rsbtbl_size.attr,
170 [CLUSTER_ATTR_LKBTBL_SIZE] = &cluster_attr_lkbtbl_size.attr,
171 [CLUSTER_ATTR_DIRTBL_SIZE] = &cluster_attr_dirtbl_size.attr,
172 [CLUSTER_ATTR_RECOVER_TIMER] = &cluster_attr_recover_timer.attr,
173 [CLUSTER_ATTR_TOSS_SECS] = &cluster_attr_toss_secs.attr,
174 [CLUSTER_ATTR_SCAN_SECS] = &cluster_attr_scan_secs.attr,
175 [CLUSTER_ATTR_LOG_DEBUG] = &cluster_attr_log_debug.attr,
Patrick Caulfield6ed7257b2007-04-17 15:39:57 +0100176 [CLUSTER_ATTR_PROTOCOL] = &cluster_attr_protocol.attr,
David Teigland3ae1acf2007-05-18 08:59:31 -0500177 [CLUSTER_ATTR_TIMEWARN_CS] = &cluster_attr_timewarn_cs.attr,
David Teiglandd2007782007-01-09 09:46:02 -0600178 NULL,
179};
180
David Teiglande7fd4172006-01-18 09:30:29 +0000181enum {
182 COMM_ATTR_NODEID = 0,
183 COMM_ATTR_LOCAL,
184 COMM_ATTR_ADDR,
185};
186
187struct comm_attribute {
188 struct configfs_attribute attr;
David Teigland51409342008-07-31 09:31:53 -0500189 ssize_t (*show)(struct dlm_comm *, char *);
190 ssize_t (*store)(struct dlm_comm *, const char *, size_t);
David Teiglande7fd4172006-01-18 09:30:29 +0000191};
192
193static struct comm_attribute comm_attr_nodeid = {
194 .attr = { .ca_owner = THIS_MODULE,
195 .ca_name = "nodeid",
196 .ca_mode = S_IRUGO | S_IWUSR },
197 .show = comm_nodeid_read,
198 .store = comm_nodeid_write,
199};
200
201static struct comm_attribute comm_attr_local = {
202 .attr = { .ca_owner = THIS_MODULE,
203 .ca_name = "local",
204 .ca_mode = S_IRUGO | S_IWUSR },
205 .show = comm_local_read,
206 .store = comm_local_write,
207};
208
209static struct comm_attribute comm_attr_addr = {
210 .attr = { .ca_owner = THIS_MODULE,
211 .ca_name = "addr",
212 .ca_mode = S_IRUGO | S_IWUSR },
213 .store = comm_addr_write,
214};
215
216static struct configfs_attribute *comm_attrs[] = {
217 [COMM_ATTR_NODEID] = &comm_attr_nodeid.attr,
218 [COMM_ATTR_LOCAL] = &comm_attr_local.attr,
219 [COMM_ATTR_ADDR] = &comm_attr_addr.attr,
220 NULL,
221};
222
223enum {
224 NODE_ATTR_NODEID = 0,
225 NODE_ATTR_WEIGHT,
226};
227
228struct node_attribute {
229 struct configfs_attribute attr;
David Teigland51409342008-07-31 09:31:53 -0500230 ssize_t (*show)(struct dlm_node *, char *);
231 ssize_t (*store)(struct dlm_node *, const char *, size_t);
David Teiglande7fd4172006-01-18 09:30:29 +0000232};
233
234static struct node_attribute node_attr_nodeid = {
235 .attr = { .ca_owner = THIS_MODULE,
236 .ca_name = "nodeid",
237 .ca_mode = S_IRUGO | S_IWUSR },
238 .show = node_nodeid_read,
239 .store = node_nodeid_write,
240};
241
242static struct node_attribute node_attr_weight = {
243 .attr = { .ca_owner = THIS_MODULE,
244 .ca_name = "weight",
245 .ca_mode = S_IRUGO | S_IWUSR },
246 .show = node_weight_read,
247 .store = node_weight_write,
248};
249
250static struct configfs_attribute *node_attrs[] = {
251 [NODE_ATTR_NODEID] = &node_attr_nodeid.attr,
252 [NODE_ATTR_WEIGHT] = &node_attr_weight.attr,
253 NULL,
254};
255
David Teigland51409342008-07-31 09:31:53 -0500256struct dlm_clusters {
David Teiglande7fd4172006-01-18 09:30:29 +0000257 struct configfs_subsystem subsys;
258};
259
David Teigland51409342008-07-31 09:31:53 -0500260struct dlm_spaces {
David Teiglande7fd4172006-01-18 09:30:29 +0000261 struct config_group ss_group;
262};
263
David Teigland51409342008-07-31 09:31:53 -0500264struct dlm_space {
David Teiglande7fd4172006-01-18 09:30:29 +0000265 struct config_group group;
266 struct list_head members;
David Teigland90135922006-01-20 08:47:07 +0000267 struct mutex members_lock;
David Teiglande7fd4172006-01-18 09:30:29 +0000268 int members_count;
269};
270
David Teigland51409342008-07-31 09:31:53 -0500271struct dlm_comms {
David Teiglande7fd4172006-01-18 09:30:29 +0000272 struct config_group cs_group;
273};
274
David Teigland51409342008-07-31 09:31:53 -0500275struct dlm_comm {
David Teiglande7fd4172006-01-18 09:30:29 +0000276 struct config_item item;
277 int nodeid;
278 int local;
279 int addr_count;
280 struct sockaddr_storage *addr[DLM_MAX_ADDR_COUNT];
281};
282
David Teigland51409342008-07-31 09:31:53 -0500283struct dlm_nodes {
David Teiglande7fd4172006-01-18 09:30:29 +0000284 struct config_group ns_group;
285};
286
David Teigland51409342008-07-31 09:31:53 -0500287struct dlm_node {
David Teiglande7fd4172006-01-18 09:30:29 +0000288 struct config_item item;
289 struct list_head list; /* space->members */
290 int nodeid;
291 int weight;
David Teiglandd44e0fc2008-03-18 14:22:11 -0500292 int new;
David Teiglande7fd4172006-01-18 09:30:29 +0000293};
294
295static struct configfs_group_operations clusters_ops = {
296 .make_group = make_cluster,
297 .drop_item = drop_cluster,
298};
299
300static struct configfs_item_operations cluster_ops = {
301 .release = release_cluster,
David Teiglandd2007782007-01-09 09:46:02 -0600302 .show_attribute = show_cluster,
303 .store_attribute = store_cluster,
David Teiglande7fd4172006-01-18 09:30:29 +0000304};
305
306static struct configfs_group_operations spaces_ops = {
307 .make_group = make_space,
308 .drop_item = drop_space,
309};
310
311static struct configfs_item_operations space_ops = {
312 .release = release_space,
313};
314
315static struct configfs_group_operations comms_ops = {
316 .make_item = make_comm,
317 .drop_item = drop_comm,
318};
319
320static struct configfs_item_operations comm_ops = {
321 .release = release_comm,
322 .show_attribute = show_comm,
323 .store_attribute = store_comm,
324};
325
326static struct configfs_group_operations nodes_ops = {
327 .make_item = make_node,
328 .drop_item = drop_node,
329};
330
331static struct configfs_item_operations node_ops = {
332 .release = release_node,
333 .show_attribute = show_node,
334 .store_attribute = store_node,
335};
336
337static struct config_item_type clusters_type = {
338 .ct_group_ops = &clusters_ops,
339 .ct_owner = THIS_MODULE,
340};
341
342static struct config_item_type cluster_type = {
343 .ct_item_ops = &cluster_ops,
David Teiglandd2007782007-01-09 09:46:02 -0600344 .ct_attrs = cluster_attrs,
David Teiglande7fd4172006-01-18 09:30:29 +0000345 .ct_owner = THIS_MODULE,
346};
347
348static struct config_item_type spaces_type = {
349 .ct_group_ops = &spaces_ops,
350 .ct_owner = THIS_MODULE,
351};
352
353static struct config_item_type space_type = {
354 .ct_item_ops = &space_ops,
355 .ct_owner = THIS_MODULE,
356};
357
358static struct config_item_type comms_type = {
359 .ct_group_ops = &comms_ops,
360 .ct_owner = THIS_MODULE,
361};
362
363static struct config_item_type comm_type = {
364 .ct_item_ops = &comm_ops,
365 .ct_attrs = comm_attrs,
366 .ct_owner = THIS_MODULE,
367};
368
369static struct config_item_type nodes_type = {
370 .ct_group_ops = &nodes_ops,
371 .ct_owner = THIS_MODULE,
372};
373
374static struct config_item_type node_type = {
375 .ct_item_ops = &node_ops,
376 .ct_attrs = node_attrs,
377 .ct_owner = THIS_MODULE,
378};
379
David Teigland51409342008-07-31 09:31:53 -0500380static struct dlm_cluster *to_cluster(struct config_item *i)
David Teiglande7fd4172006-01-18 09:30:29 +0000381{
David Teigland51409342008-07-31 09:31:53 -0500382 return i ? container_of(to_config_group(i), struct dlm_cluster, group) :
383 NULL;
David Teiglande7fd4172006-01-18 09:30:29 +0000384}
385
David Teigland51409342008-07-31 09:31:53 -0500386static struct dlm_space *to_space(struct config_item *i)
David Teiglande7fd4172006-01-18 09:30:29 +0000387{
David Teigland51409342008-07-31 09:31:53 -0500388 return i ? container_of(to_config_group(i), struct dlm_space, group) :
389 NULL;
David Teiglande7fd4172006-01-18 09:30:29 +0000390}
391
David Teigland51409342008-07-31 09:31:53 -0500392static struct dlm_comm *to_comm(struct config_item *i)
David Teiglande7fd4172006-01-18 09:30:29 +0000393{
David Teigland51409342008-07-31 09:31:53 -0500394 return i ? container_of(i, struct dlm_comm, item) : NULL;
David Teiglande7fd4172006-01-18 09:30:29 +0000395}
396
David Teigland51409342008-07-31 09:31:53 -0500397static struct dlm_node *to_node(struct config_item *i)
David Teiglande7fd4172006-01-18 09:30:29 +0000398{
David Teigland51409342008-07-31 09:31:53 -0500399 return i ? container_of(i, struct dlm_node, item) : NULL;
David Teiglande7fd4172006-01-18 09:30:29 +0000400}
401
Joel Beckerf89ab862008-07-17 14:53:48 -0700402static struct config_group *make_cluster(struct config_group *g,
403 const char *name)
David Teiglande7fd4172006-01-18 09:30:29 +0000404{
David Teigland51409342008-07-31 09:31:53 -0500405 struct dlm_cluster *cl = NULL;
406 struct dlm_spaces *sps = NULL;
407 struct dlm_comms *cms = NULL;
David Teiglande7fd4172006-01-18 09:30:29 +0000408 void *gps = NULL;
409
David Teigland51409342008-07-31 09:31:53 -0500410 cl = kzalloc(sizeof(struct dlm_cluster), GFP_KERNEL);
David Teiglande7fd4172006-01-18 09:30:29 +0000411 gps = kcalloc(3, sizeof(struct config_group *), GFP_KERNEL);
David Teigland51409342008-07-31 09:31:53 -0500412 sps = kzalloc(sizeof(struct dlm_spaces), GFP_KERNEL);
413 cms = kzalloc(sizeof(struct dlm_comms), GFP_KERNEL);
David Teiglande7fd4172006-01-18 09:30:29 +0000414
415 if (!cl || !gps || !sps || !cms)
416 goto fail;
417
418 config_group_init_type_name(&cl->group, name, &cluster_type);
419 config_group_init_type_name(&sps->ss_group, "spaces", &spaces_type);
420 config_group_init_type_name(&cms->cs_group, "comms", &comms_type);
421
422 cl->group.default_groups = gps;
423 cl->group.default_groups[0] = &sps->ss_group;
424 cl->group.default_groups[1] = &cms->cs_group;
425 cl->group.default_groups[2] = NULL;
426
David Teiglandd2007782007-01-09 09:46:02 -0600427 cl->cl_tcp_port = dlm_config.ci_tcp_port;
428 cl->cl_buffer_size = dlm_config.ci_buffer_size;
429 cl->cl_rsbtbl_size = dlm_config.ci_rsbtbl_size;
430 cl->cl_lkbtbl_size = dlm_config.ci_lkbtbl_size;
431 cl->cl_dirtbl_size = dlm_config.ci_dirtbl_size;
432 cl->cl_recover_timer = dlm_config.ci_recover_timer;
433 cl->cl_toss_secs = dlm_config.ci_toss_secs;
434 cl->cl_scan_secs = dlm_config.ci_scan_secs;
435 cl->cl_log_debug = dlm_config.ci_log_debug;
David Teigland0b7cac02007-05-29 08:47:51 -0500436 cl->cl_protocol = dlm_config.ci_protocol;
David Teigland84d8cd62007-05-29 08:44:23 -0500437 cl->cl_timewarn_cs = dlm_config.ci_timewarn_cs;
David Teiglandd2007782007-01-09 09:46:02 -0600438
David Teiglande7fd4172006-01-18 09:30:29 +0000439 space_list = &sps->ss_group;
440 comm_list = &cms->cs_group;
Joel Beckerf89ab862008-07-17 14:53:48 -0700441 return &cl->group;
David Teiglande7fd4172006-01-18 09:30:29 +0000442
443 fail:
444 kfree(cl);
445 kfree(gps);
446 kfree(sps);
447 kfree(cms);
Joel Beckera6795e92008-07-17 15:21:29 -0700448 return ERR_PTR(-ENOMEM);
David Teiglande7fd4172006-01-18 09:30:29 +0000449}
450
451static void drop_cluster(struct config_group *g, struct config_item *i)
452{
David Teigland51409342008-07-31 09:31:53 -0500453 struct dlm_cluster *cl = to_cluster(i);
David Teiglande7fd4172006-01-18 09:30:29 +0000454 struct config_item *tmp;
455 int j;
456
457 for (j = 0; cl->group.default_groups[j]; j++) {
458 tmp = &cl->group.default_groups[j]->cg_item;
459 cl->group.default_groups[j] = NULL;
460 config_item_put(tmp);
461 }
462
463 space_list = NULL;
464 comm_list = NULL;
465
466 config_item_put(i);
467}
468
469static void release_cluster(struct config_item *i)
470{
David Teigland51409342008-07-31 09:31:53 -0500471 struct dlm_cluster *cl = to_cluster(i);
David Teiglande7fd4172006-01-18 09:30:29 +0000472 kfree(cl->group.default_groups);
473 kfree(cl);
474}
475
Joel Beckerf89ab862008-07-17 14:53:48 -0700476static struct config_group *make_space(struct config_group *g, const char *name)
David Teiglande7fd4172006-01-18 09:30:29 +0000477{
David Teigland51409342008-07-31 09:31:53 -0500478 struct dlm_space *sp = NULL;
479 struct dlm_nodes *nds = NULL;
David Teiglande7fd4172006-01-18 09:30:29 +0000480 void *gps = NULL;
481
David Teigland51409342008-07-31 09:31:53 -0500482 sp = kzalloc(sizeof(struct dlm_space), GFP_KERNEL);
David Teiglande7fd4172006-01-18 09:30:29 +0000483 gps = kcalloc(2, sizeof(struct config_group *), GFP_KERNEL);
David Teigland51409342008-07-31 09:31:53 -0500484 nds = kzalloc(sizeof(struct dlm_nodes), GFP_KERNEL);
David Teiglande7fd4172006-01-18 09:30:29 +0000485
486 if (!sp || !gps || !nds)
487 goto fail;
488
489 config_group_init_type_name(&sp->group, name, &space_type);
490 config_group_init_type_name(&nds->ns_group, "nodes", &nodes_type);
491
492 sp->group.default_groups = gps;
493 sp->group.default_groups[0] = &nds->ns_group;
494 sp->group.default_groups[1] = NULL;
495
496 INIT_LIST_HEAD(&sp->members);
David Teigland90135922006-01-20 08:47:07 +0000497 mutex_init(&sp->members_lock);
David Teiglande7fd4172006-01-18 09:30:29 +0000498 sp->members_count = 0;
Joel Beckerf89ab862008-07-17 14:53:48 -0700499 return &sp->group;
David Teiglande7fd4172006-01-18 09:30:29 +0000500
501 fail:
502 kfree(sp);
503 kfree(gps);
504 kfree(nds);
Joel Beckera6795e92008-07-17 15:21:29 -0700505 return ERR_PTR(-ENOMEM);
David Teiglande7fd4172006-01-18 09:30:29 +0000506}
507
508static void drop_space(struct config_group *g, struct config_item *i)
509{
David Teigland51409342008-07-31 09:31:53 -0500510 struct dlm_space *sp = to_space(i);
David Teiglande7fd4172006-01-18 09:30:29 +0000511 struct config_item *tmp;
512 int j;
513
514 /* assert list_empty(&sp->members) */
515
516 for (j = 0; sp->group.default_groups[j]; j++) {
517 tmp = &sp->group.default_groups[j]->cg_item;
518 sp->group.default_groups[j] = NULL;
519 config_item_put(tmp);
520 }
521
522 config_item_put(i);
523}
524
525static void release_space(struct config_item *i)
526{
David Teigland51409342008-07-31 09:31:53 -0500527 struct dlm_space *sp = to_space(i);
David Teiglande7fd4172006-01-18 09:30:29 +0000528 kfree(sp->group.default_groups);
529 kfree(sp);
530}
531
Joel Beckerf89ab862008-07-17 14:53:48 -0700532static struct config_item *make_comm(struct config_group *g, const char *name)
David Teiglande7fd4172006-01-18 09:30:29 +0000533{
David Teigland51409342008-07-31 09:31:53 -0500534 struct dlm_comm *cm;
David Teiglande7fd4172006-01-18 09:30:29 +0000535
David Teigland51409342008-07-31 09:31:53 -0500536 cm = kzalloc(sizeof(struct dlm_comm), GFP_KERNEL);
David Teiglande7fd4172006-01-18 09:30:29 +0000537 if (!cm)
Joel Beckera6795e92008-07-17 15:21:29 -0700538 return ERR_PTR(-ENOMEM);
David Teiglande7fd4172006-01-18 09:30:29 +0000539
540 config_item_init_type_name(&cm->item, name, &comm_type);
541 cm->nodeid = -1;
542 cm->local = 0;
543 cm->addr_count = 0;
Joel Beckerf89ab862008-07-17 14:53:48 -0700544 return &cm->item;
David Teiglande7fd4172006-01-18 09:30:29 +0000545}
546
547static void drop_comm(struct config_group *g, struct config_item *i)
548{
David Teigland51409342008-07-31 09:31:53 -0500549 struct dlm_comm *cm = to_comm(i);
David Teiglande7fd4172006-01-18 09:30:29 +0000550 if (local_comm == cm)
551 local_comm = NULL;
David Teigland1c032c02006-04-28 10:50:41 -0400552 dlm_lowcomms_close(cm->nodeid);
David Teiglande7fd4172006-01-18 09:30:29 +0000553 while (cm->addr_count--)
554 kfree(cm->addr[cm->addr_count]);
555 config_item_put(i);
556}
557
558static void release_comm(struct config_item *i)
559{
David Teigland51409342008-07-31 09:31:53 -0500560 struct dlm_comm *cm = to_comm(i);
David Teiglande7fd4172006-01-18 09:30:29 +0000561 kfree(cm);
562}
563
Joel Beckerf89ab862008-07-17 14:53:48 -0700564static struct config_item *make_node(struct config_group *g, const char *name)
David Teiglande7fd4172006-01-18 09:30:29 +0000565{
David Teigland51409342008-07-31 09:31:53 -0500566 struct dlm_space *sp = to_space(g->cg_item.ci_parent);
567 struct dlm_node *nd;
David Teiglande7fd4172006-01-18 09:30:29 +0000568
David Teigland51409342008-07-31 09:31:53 -0500569 nd = kzalloc(sizeof(struct dlm_node), GFP_KERNEL);
David Teiglande7fd4172006-01-18 09:30:29 +0000570 if (!nd)
Joel Beckera6795e92008-07-17 15:21:29 -0700571 return ERR_PTR(-ENOMEM);
David Teiglande7fd4172006-01-18 09:30:29 +0000572
573 config_item_init_type_name(&nd->item, name, &node_type);
574 nd->nodeid = -1;
575 nd->weight = 1; /* default weight of 1 if none is set */
David Teiglandd44e0fc2008-03-18 14:22:11 -0500576 nd->new = 1; /* set to 0 once it's been read by dlm_nodeid_list() */
David Teiglande7fd4172006-01-18 09:30:29 +0000577
David Teigland90135922006-01-20 08:47:07 +0000578 mutex_lock(&sp->members_lock);
David Teiglande7fd4172006-01-18 09:30:29 +0000579 list_add(&nd->list, &sp->members);
580 sp->members_count++;
David Teigland90135922006-01-20 08:47:07 +0000581 mutex_unlock(&sp->members_lock);
David Teiglande7fd4172006-01-18 09:30:29 +0000582
Joel Beckerf89ab862008-07-17 14:53:48 -0700583 return &nd->item;
David Teiglande7fd4172006-01-18 09:30:29 +0000584}
585
586static void drop_node(struct config_group *g, struct config_item *i)
587{
David Teigland51409342008-07-31 09:31:53 -0500588 struct dlm_space *sp = to_space(g->cg_item.ci_parent);
589 struct dlm_node *nd = to_node(i);
David Teiglande7fd4172006-01-18 09:30:29 +0000590
David Teigland90135922006-01-20 08:47:07 +0000591 mutex_lock(&sp->members_lock);
David Teiglande7fd4172006-01-18 09:30:29 +0000592 list_del(&nd->list);
593 sp->members_count--;
David Teigland90135922006-01-20 08:47:07 +0000594 mutex_unlock(&sp->members_lock);
David Teiglande7fd4172006-01-18 09:30:29 +0000595
596 config_item_put(i);
597}
598
599static void release_node(struct config_item *i)
600{
David Teigland51409342008-07-31 09:31:53 -0500601 struct dlm_node *nd = to_node(i);
David Teiglande7fd4172006-01-18 09:30:29 +0000602 kfree(nd);
603}
604
David Teigland51409342008-07-31 09:31:53 -0500605static struct dlm_clusters clusters_root = {
David Teiglande7fd4172006-01-18 09:30:29 +0000606 .subsys = {
607 .su_group = {
608 .cg_item = {
609 .ci_namebuf = "dlm",
610 .ci_type = &clusters_type,
611 },
612 },
613 },
614};
615
Denis Cheng30727172008-02-02 01:53:46 +0800616int __init dlm_config_init(void)
David Teiglande7fd4172006-01-18 09:30:29 +0000617{
618 config_group_init(&clusters_root.subsys.su_group);
Joel Beckere6bd07a2007-07-06 23:33:17 -0700619 mutex_init(&clusters_root.subsys.su_mutex);
David Teiglande7fd4172006-01-18 09:30:29 +0000620 return configfs_register_subsystem(&clusters_root.subsys);
621}
622
623void dlm_config_exit(void)
624{
625 configfs_unregister_subsystem(&clusters_root.subsys);
626}
627
628/*
629 * Functions for user space to read/write attributes
630 */
631
David Teiglandd2007782007-01-09 09:46:02 -0600632static ssize_t show_cluster(struct config_item *i, struct configfs_attribute *a,
633 char *buf)
634{
David Teigland51409342008-07-31 09:31:53 -0500635 struct dlm_cluster *cl = to_cluster(i);
David Teiglandd2007782007-01-09 09:46:02 -0600636 struct cluster_attribute *cla =
637 container_of(a, struct cluster_attribute, attr);
638 return cla->show ? cla->show(cl, buf) : 0;
639}
640
641static ssize_t store_cluster(struct config_item *i,
642 struct configfs_attribute *a,
643 const char *buf, size_t len)
644{
David Teigland51409342008-07-31 09:31:53 -0500645 struct dlm_cluster *cl = to_cluster(i);
David Teiglandd2007782007-01-09 09:46:02 -0600646 struct cluster_attribute *cla =
647 container_of(a, struct cluster_attribute, attr);
648 return cla->store ? cla->store(cl, buf, len) : -EINVAL;
649}
650
David Teiglande7fd4172006-01-18 09:30:29 +0000651static ssize_t show_comm(struct config_item *i, struct configfs_attribute *a,
652 char *buf)
653{
David Teigland51409342008-07-31 09:31:53 -0500654 struct dlm_comm *cm = to_comm(i);
David Teiglande7fd4172006-01-18 09:30:29 +0000655 struct comm_attribute *cma =
656 container_of(a, struct comm_attribute, attr);
657 return cma->show ? cma->show(cm, buf) : 0;
658}
659
660static ssize_t store_comm(struct config_item *i, struct configfs_attribute *a,
661 const char *buf, size_t len)
662{
David Teigland51409342008-07-31 09:31:53 -0500663 struct dlm_comm *cm = to_comm(i);
David Teiglande7fd4172006-01-18 09:30:29 +0000664 struct comm_attribute *cma =
665 container_of(a, struct comm_attribute, attr);
666 return cma->store ? cma->store(cm, buf, len) : -EINVAL;
667}
668
David Teigland51409342008-07-31 09:31:53 -0500669static ssize_t comm_nodeid_read(struct dlm_comm *cm, char *buf)
David Teiglande7fd4172006-01-18 09:30:29 +0000670{
671 return sprintf(buf, "%d\n", cm->nodeid);
672}
673
David Teigland51409342008-07-31 09:31:53 -0500674static ssize_t comm_nodeid_write(struct dlm_comm *cm, const char *buf,
675 size_t len)
David Teiglande7fd4172006-01-18 09:30:29 +0000676{
677 cm->nodeid = simple_strtol(buf, NULL, 0);
678 return len;
679}
680
David Teigland51409342008-07-31 09:31:53 -0500681static ssize_t comm_local_read(struct dlm_comm *cm, char *buf)
David Teiglande7fd4172006-01-18 09:30:29 +0000682{
683 return sprintf(buf, "%d\n", cm->local);
684}
685
David Teigland51409342008-07-31 09:31:53 -0500686static ssize_t comm_local_write(struct dlm_comm *cm, const char *buf,
687 size_t len)
David Teiglande7fd4172006-01-18 09:30:29 +0000688{
689 cm->local= simple_strtol(buf, NULL, 0);
690 if (cm->local && !local_comm)
691 local_comm = cm;
692 return len;
693}
694
David Teigland51409342008-07-31 09:31:53 -0500695static ssize_t comm_addr_write(struct dlm_comm *cm, const char *buf, size_t len)
David Teiglande7fd4172006-01-18 09:30:29 +0000696{
697 struct sockaddr_storage *addr;
698
699 if (len != sizeof(struct sockaddr_storage))
700 return -EINVAL;
701
702 if (cm->addr_count >= DLM_MAX_ADDR_COUNT)
703 return -ENOSPC;
704
705 addr = kzalloc(sizeof(*addr), GFP_KERNEL);
706 if (!addr)
707 return -ENOMEM;
708
709 memcpy(addr, buf, len);
710 cm->addr[cm->addr_count++] = addr;
711 return len;
712}
713
714static ssize_t show_node(struct config_item *i, struct configfs_attribute *a,
715 char *buf)
716{
David Teigland51409342008-07-31 09:31:53 -0500717 struct dlm_node *nd = to_node(i);
David Teiglande7fd4172006-01-18 09:30:29 +0000718 struct node_attribute *nda =
719 container_of(a, struct node_attribute, attr);
720 return nda->show ? nda->show(nd, buf) : 0;
721}
722
723static ssize_t store_node(struct config_item *i, struct configfs_attribute *a,
724 const char *buf, size_t len)
725{
David Teigland51409342008-07-31 09:31:53 -0500726 struct dlm_node *nd = to_node(i);
David Teiglande7fd4172006-01-18 09:30:29 +0000727 struct node_attribute *nda =
728 container_of(a, struct node_attribute, attr);
729 return nda->store ? nda->store(nd, buf, len) : -EINVAL;
730}
731
David Teigland51409342008-07-31 09:31:53 -0500732static ssize_t node_nodeid_read(struct dlm_node *nd, char *buf)
David Teiglande7fd4172006-01-18 09:30:29 +0000733{
734 return sprintf(buf, "%d\n", nd->nodeid);
735}
736
David Teigland51409342008-07-31 09:31:53 -0500737static ssize_t node_nodeid_write(struct dlm_node *nd, const char *buf,
738 size_t len)
David Teiglande7fd4172006-01-18 09:30:29 +0000739{
740 nd->nodeid = simple_strtol(buf, NULL, 0);
741 return len;
742}
743
David Teigland51409342008-07-31 09:31:53 -0500744static ssize_t node_weight_read(struct dlm_node *nd, char *buf)
David Teiglande7fd4172006-01-18 09:30:29 +0000745{
746 return sprintf(buf, "%d\n", nd->weight);
747}
748
David Teigland51409342008-07-31 09:31:53 -0500749static ssize_t node_weight_write(struct dlm_node *nd, const char *buf,
750 size_t len)
David Teiglande7fd4172006-01-18 09:30:29 +0000751{
752 nd->weight = simple_strtol(buf, NULL, 0);
753 return len;
754}
755
756/*
757 * Functions for the dlm to get the info that's been configured
758 */
759
David Teigland51409342008-07-31 09:31:53 -0500760static struct dlm_space *get_space(char *name)
David Teiglande7fd4172006-01-18 09:30:29 +0000761{
Satyam Sharma3168b072007-05-08 09:18:58 +0100762 struct config_item *i;
763
David Teiglande7fd4172006-01-18 09:30:29 +0000764 if (!space_list)
765 return NULL;
Satyam Sharma3168b072007-05-08 09:18:58 +0100766
Joel Beckere6bd07a2007-07-06 23:33:17 -0700767 mutex_lock(&space_list->cg_subsys->su_mutex);
Satyam Sharma3fe6c5c2007-07-04 16:37:16 +0530768 i = config_group_find_item(space_list, name);
Joel Beckere6bd07a2007-07-06 23:33:17 -0700769 mutex_unlock(&space_list->cg_subsys->su_mutex);
Satyam Sharma3168b072007-05-08 09:18:58 +0100770
771 return to_space(i);
David Teiglande7fd4172006-01-18 09:30:29 +0000772}
773
David Teigland51409342008-07-31 09:31:53 -0500774static void put_space(struct dlm_space *sp)
David Teiglande7fd4172006-01-18 09:30:29 +0000775{
776 config_item_put(&sp->group.cg_item);
777}
778
David Teigland51409342008-07-31 09:31:53 -0500779static struct dlm_comm *get_comm(int nodeid, struct sockaddr_storage *addr)
David Teiglande7fd4172006-01-18 09:30:29 +0000780{
781 struct config_item *i;
David Teigland51409342008-07-31 09:31:53 -0500782 struct dlm_comm *cm = NULL;
David Teiglande7fd4172006-01-18 09:30:29 +0000783 int found = 0;
784
785 if (!comm_list)
786 return NULL;
787
Joel Beckere6bd07a2007-07-06 23:33:17 -0700788 mutex_lock(&clusters_root.subsys.su_mutex);
David Teiglande7fd4172006-01-18 09:30:29 +0000789
790 list_for_each_entry(i, &comm_list->cg_children, ci_entry) {
791 cm = to_comm(i);
792
793 if (nodeid) {
794 if (cm->nodeid != nodeid)
795 continue;
796 found = 1;
Satyam Sharma3168b072007-05-08 09:18:58 +0100797 config_item_get(i);
David Teiglande7fd4172006-01-18 09:30:29 +0000798 break;
799 } else {
800 if (!cm->addr_count ||
801 memcmp(cm->addr[0], addr, sizeof(*addr)))
802 continue;
803 found = 1;
Satyam Sharma3168b072007-05-08 09:18:58 +0100804 config_item_get(i);
David Teiglande7fd4172006-01-18 09:30:29 +0000805 break;
806 }
807 }
Joel Beckere6bd07a2007-07-06 23:33:17 -0700808 mutex_unlock(&clusters_root.subsys.su_mutex);
David Teiglande7fd4172006-01-18 09:30:29 +0000809
Satyam Sharma3168b072007-05-08 09:18:58 +0100810 if (!found)
David Teiglande7fd4172006-01-18 09:30:29 +0000811 cm = NULL;
812 return cm;
813}
814
David Teigland51409342008-07-31 09:31:53 -0500815static void put_comm(struct dlm_comm *cm)
David Teiglande7fd4172006-01-18 09:30:29 +0000816{
817 config_item_put(&cm->item);
818}
819
820/* caller must free mem */
David Teiglandd44e0fc2008-03-18 14:22:11 -0500821int dlm_nodeid_list(char *lsname, int **ids_out, int *ids_count_out,
822 int **new_out, int *new_count_out)
David Teiglande7fd4172006-01-18 09:30:29 +0000823{
David Teigland51409342008-07-31 09:31:53 -0500824 struct dlm_space *sp;
825 struct dlm_node *nd;
David Teiglandd44e0fc2008-03-18 14:22:11 -0500826 int i = 0, rv = 0, ids_count = 0, new_count = 0;
827 int *ids, *new;
David Teiglande7fd4172006-01-18 09:30:29 +0000828
829 sp = get_space(lsname);
830 if (!sp)
831 return -EEXIST;
832
David Teigland90135922006-01-20 08:47:07 +0000833 mutex_lock(&sp->members_lock);
David Teiglande7fd4172006-01-18 09:30:29 +0000834 if (!sp->members_count) {
David Teiglandd44e0fc2008-03-18 14:22:11 -0500835 rv = -EINVAL;
836 printk(KERN_ERR "dlm: zero members_count\n");
David Teiglande7fd4172006-01-18 09:30:29 +0000837 goto out;
838 }
839
David Teiglandd44e0fc2008-03-18 14:22:11 -0500840 ids_count = sp->members_count;
841
842 ids = kcalloc(ids_count, sizeof(int), GFP_KERNEL);
David Teiglande7fd4172006-01-18 09:30:29 +0000843 if (!ids) {
844 rv = -ENOMEM;
845 goto out;
846 }
847
David Teiglandd44e0fc2008-03-18 14:22:11 -0500848 list_for_each_entry(nd, &sp->members, list) {
David Teiglande7fd4172006-01-18 09:30:29 +0000849 ids[i++] = nd->nodeid;
David Teiglandd44e0fc2008-03-18 14:22:11 -0500850 if (nd->new)
851 new_count++;
852 }
David Teiglande7fd4172006-01-18 09:30:29 +0000853
David Teiglandd44e0fc2008-03-18 14:22:11 -0500854 if (ids_count != i)
855 printk(KERN_ERR "dlm: bad nodeid count %d %d\n", ids_count, i);
David Teiglande7fd4172006-01-18 09:30:29 +0000856
David Teiglandd44e0fc2008-03-18 14:22:11 -0500857 if (!new_count)
858 goto out_ids;
859
860 new = kcalloc(new_count, sizeof(int), GFP_KERNEL);
861 if (!new) {
862 kfree(ids);
863 rv = -ENOMEM;
864 goto out;
865 }
866
867 i = 0;
868 list_for_each_entry(nd, &sp->members, list) {
869 if (nd->new) {
870 new[i++] = nd->nodeid;
871 nd->new = 0;
872 }
873 }
874 *new_count_out = new_count;
875 *new_out = new;
876
877 out_ids:
878 *ids_count_out = ids_count;
David Teiglande7fd4172006-01-18 09:30:29 +0000879 *ids_out = ids;
880 out:
David Teigland90135922006-01-20 08:47:07 +0000881 mutex_unlock(&sp->members_lock);
David Teiglande7fd4172006-01-18 09:30:29 +0000882 put_space(sp);
883 return rv;
884}
885
886int dlm_node_weight(char *lsname, int nodeid)
887{
David Teigland51409342008-07-31 09:31:53 -0500888 struct dlm_space *sp;
889 struct dlm_node *nd;
David Teiglande7fd4172006-01-18 09:30:29 +0000890 int w = -EEXIST;
891
892 sp = get_space(lsname);
893 if (!sp)
894 goto out;
895
David Teigland90135922006-01-20 08:47:07 +0000896 mutex_lock(&sp->members_lock);
David Teiglande7fd4172006-01-18 09:30:29 +0000897 list_for_each_entry(nd, &sp->members, list) {
898 if (nd->nodeid != nodeid)
899 continue;
900 w = nd->weight;
901 break;
902 }
David Teigland90135922006-01-20 08:47:07 +0000903 mutex_unlock(&sp->members_lock);
David Teiglande7fd4172006-01-18 09:30:29 +0000904 put_space(sp);
905 out:
906 return w;
907}
908
909int dlm_nodeid_to_addr(int nodeid, struct sockaddr_storage *addr)
910{
David Teigland51409342008-07-31 09:31:53 -0500911 struct dlm_comm *cm = get_comm(nodeid, NULL);
David Teiglande7fd4172006-01-18 09:30:29 +0000912 if (!cm)
913 return -EEXIST;
914 if (!cm->addr_count)
915 return -ENOENT;
916 memcpy(addr, cm->addr[0], sizeof(*addr));
917 put_comm(cm);
918 return 0;
919}
920
921int dlm_addr_to_nodeid(struct sockaddr_storage *addr, int *nodeid)
922{
David Teigland51409342008-07-31 09:31:53 -0500923 struct dlm_comm *cm = get_comm(0, addr);
David Teiglande7fd4172006-01-18 09:30:29 +0000924 if (!cm)
925 return -EEXIST;
926 *nodeid = cm->nodeid;
927 put_comm(cm);
928 return 0;
929}
930
931int dlm_our_nodeid(void)
932{
933 return local_comm ? local_comm->nodeid : 0;
934}
935
936/* num 0 is first addr, num 1 is second addr */
937int dlm_our_addr(struct sockaddr_storage *addr, int num)
938{
939 if (!local_comm)
940 return -1;
941 if (num + 1 > local_comm->addr_count)
942 return -1;
943 memcpy(addr, local_comm->addr[num], sizeof(*addr));
944 return 0;
945}
946
947/* Config file defaults */
948#define DEFAULT_TCP_PORT 21064
949#define DEFAULT_BUFFER_SIZE 4096
950#define DEFAULT_RSBTBL_SIZE 256
951#define DEFAULT_LKBTBL_SIZE 1024
952#define DEFAULT_DIRTBL_SIZE 512
953#define DEFAULT_RECOVER_TIMER 5
954#define DEFAULT_TOSS_SECS 10
955#define DEFAULT_SCAN_SECS 5
David Teigland99fc6482007-01-09 09:44:01 -0600956#define DEFAULT_LOG_DEBUG 0
Patrick Caulfield6ed7257b2007-04-17 15:39:57 +0100957#define DEFAULT_PROTOCOL 0
David Teigland3ae1acf2007-05-18 08:59:31 -0500958#define DEFAULT_TIMEWARN_CS 500 /* 5 sec = 500 centiseconds */
David Teiglande7fd4172006-01-18 09:30:29 +0000959
960struct dlm_config_info dlm_config = {
David Teigland68c817a2007-01-09 09:41:48 -0600961 .ci_tcp_port = DEFAULT_TCP_PORT,
962 .ci_buffer_size = DEFAULT_BUFFER_SIZE,
963 .ci_rsbtbl_size = DEFAULT_RSBTBL_SIZE,
964 .ci_lkbtbl_size = DEFAULT_LKBTBL_SIZE,
965 .ci_dirtbl_size = DEFAULT_DIRTBL_SIZE,
966 .ci_recover_timer = DEFAULT_RECOVER_TIMER,
967 .ci_toss_secs = DEFAULT_TOSS_SECS,
David Teigland99fc6482007-01-09 09:44:01 -0600968 .ci_scan_secs = DEFAULT_SCAN_SECS,
Patrick Caulfield6ed7257b2007-04-17 15:39:57 +0100969 .ci_log_debug = DEFAULT_LOG_DEBUG,
David Teigland3ae1acf2007-05-18 08:59:31 -0500970 .ci_protocol = DEFAULT_PROTOCOL,
971 .ci_timewarn_cs = DEFAULT_TIMEWARN_CS
David Teiglande7fd4172006-01-18 09:30:29 +0000972};
973