Skip to contentSkip to conversation

dlm: configuration

PATCH In review David Teigland 1 participant 1 message May 16, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 5/8 dlm: configuration

Per-lockspace configuration happens through files under:
/sys/kernel/dlm/<lockspace_name>/. This includes telling each lockspace which nodes are using the lockspace and suspending locking in a lockspace.

Lockspace-independent configuration involves telling the dlm communication layer the IP address of each node ID that's being used. These addresses are set using an ioctl on a misc device.

---

 drivers/dlm/config.c       |   47 ++++++
 drivers/dlm/config.h       |   34 ++++
 drivers/dlm/member_sysfs.c |  322 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/dlm/member_sysfs.h |   21 ++
 drivers/dlm/node_ioctl.c   |  126 +++++++++++++++++
 include/linux/dlm_node.h   |   44 ++++++
 6 files changed, 594 insertions(+)
include/linux/dlm_node.h +44 -0
@@ -0,0 +1,44 @@
+/******************************************************************************
+*******************************************************************************
+**
+**  Copyright (C) 2005 Red Hat, Inc.  All rights reserved.
+**
+**  This copyrighted material is made available to anyone wishing to use,
+**  modify, copy, or redistribute it subject to the terms and conditions
+**  of the GNU General Public License v.2.
+**
+*******************************************************************************
+******************************************************************************/
+
+#ifndef __DLM_NODE_DOT_H__
+#define __DLM_NODE_DOT_H__
+
+#define DLM_ADDR_LEN			256
+#define DLM_MAX_ADDR_COUNT		3
+#define DLM_NODE_MISC_NAME		"dlm-node"
+
+#define DLM_NODE_VERSION_MAJOR		1
+#define DLM_NODE_VERSION_MINOR		0
+#define DLM_NODE_VERSION_PATCH		0
+
+struct dlm_node_ioctl {
+	__u32	version[3];
+	int	nodeid;
+	int	weight;
+	char	addr[DLM_ADDR_LEN];
+};
+
+enum {
+	DLM_NODE_VERSION_CMD = 0,
+	DLM_SET_NODE_CMD,
+	DLM_SET_LOCAL_CMD,
+};
+
+#define DLM_IOCTL			0xd1
+
+#define DLM_NODE_VERSION _IOWR(DLM_IOCTL, DLM_NODE_VERSION_CMD, struct dlm_node_ioctl)
+#define DLM_SET_NODE     _IOWR(DLM_IOCTL, DLM_SET_NODE_CMD, struct dlm_node_ioctl)
+#define DLM_SET_LOCAL    _IOWR(DLM_IOCTL, DLM_SET_LOCAL_CMD, struct dlm_node_ioctl)
+
+#endif
+
drivers/dlm/config.c +47 -0

47 lines not on this page · raw message

drivers/dlm/config.h +34 -0
@@ -0,0 +1,34 @@
+/******************************************************************************
+*******************************************************************************
+**
+**  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
+**  Copyright (C) 2004-2005 Red Hat, Inc.  All rights reserved.
+**
+**  This copyrighted material is made available to anyone wishing to use,
+**  modify, copy, or redistribute it subject to the terms and conditions
+**  of the GNU General Public License v.2.
+**
+*******************************************************************************
+******************************************************************************/
+
+#ifndef __CONFIG_DOT_H__
+#define __CONFIG_DOT_H__
+
+struct dlm_config_info {
+	int tcp_port;
+	int buffer_size;
+	int rsbtbl_size;
+	int lkbtbl_size;
+	int dirtbl_size;
+	int recover_timer;
+	int toss_secs;
+	int scan_secs;
+};
+
+extern struct dlm_config_info dlm_config;
+
+extern int dlm_config_init(void);
+extern void dlm_config_exit(void);
+
+#endif				/* __CONFIG_DOT_H__ */
+
drivers/dlm/member_sysfs.c +322 -0

322 lines not on this page · raw message

drivers/dlm/member_sysfs.h +21 -0
@@ -0,0 +1,21 @@
+/******************************************************************************
+*******************************************************************************
+**
+**  Copyright (C) 2005 Red Hat, Inc.  All rights reserved.
+**
+**  This copyrighted material is made available to anyone wishing to use,
+**  modify, copy, or redistribute it subject to the terms and conditions
+**  of the GNU General Public License v.2.
+**
+*******************************************************************************
+******************************************************************************/
+
+#ifndef __MEMBER_SYSFS_DOT_H__
+#define __MEMBER_SYSFS_DOT_H__
+
+int dlm_member_sysfs_init(void);
+void dlm_member_sysfs_exit(void);
+int dlm_kobject_setup(struct dlm_ls *ls);
+
+#endif                          /* __MEMBER_SYSFS_DOT_H__ */
+
drivers/dlm/node_ioctl.c +126 -0

126 lines not on this page · raw message