dlm: master - dlm: clear out old stuff and build system

David Teigland teigland at fedoraproject.org
Fri Sep 30 21:57:17 UTC 2011


Gitweb:        http://git.fedorahosted.org/git/dlm.git?p=dlm.git;a=commitdiff;h=2b5e4f87ca394113fd54395d5b5b3ab1e410dbb2
Commit:        2b5e4f87ca394113fd54395d5b5b3ab1e410dbb2
Parent:        591a71f29677257ae49ce6d10a4bd1da19d73233
Author:        David Teigland <teigland at redhat.com>
AuthorDate:    Fri Sep 30 13:19:43 2011 -0500
Committer:     David Teigland <teigland at redhat.com>
CommitterDate: Fri Sep 30 13:19:43 2011 -0500

dlm: clear out old stuff and build system

Signed-off-by: David Teigland <teigland at redhat.com>
---
 Makefile.am                           |   28 -
 autogen.sh                            |    4 -
 configure.ac                          |  270 ------
 dlm/Makefile.am                       |    3 -
 dlm/doc/Makefile.am                   |    6 -
 dlm/doc/dlm_tool.txt                  |  167 ----
 dlm/doc/example.c                     |   52 --
 dlm/doc/libdlm.txt                    |  533 ------------
 dlm/doc/user-dlm-overview.txt         |  325 --------
 dlm/libdlm/Makefile.am                |   28 -
 dlm/libdlm/libdlm.pc.in               |   11 -
 dlm/libdlm/libdlm_lt.pc.in            |   11 -
 dlm/libdlmcontrol/Makefile.am         |   17 -
 dlm/libdlmcontrol/libdlmcontrol.pc.in |   11 -
 dlm/man/Makefile.am                   |   23 -
 dlm/tests/Makefile.am                 |    3 -
 dlm/tests/usertest/Makefile.am        |   18 -
 dlm/tests/usertest/alternate-lvb.c    |  167 ----
 dlm/tests/usertest/asttest.c          |  283 -------
 dlm/tests/usertest/dlmtest.c          |  291 -------
 dlm/tests/usertest/dlmtest2.c         | 1469 ---------------------------------
 dlm/tests/usertest/flood.c            |  170 ----
 dlm/tests/usertest/joinleave.c        |   64 --
 dlm/tests/usertest/lstest.c           |  328 --------
 dlm/tests/usertest/lvb.c              |  246 ------
 dlm/tests/usertest/pingtest.c         |  345 --------
 dlm/tests/usertest/sublocks.c         |  180 ----
 dlm/tests/usertest/threads.c          |  311 -------
 dlm/tool/Makefile.am                  |   12 -
 doc/COPYING.applications              |  339 --------
 doc/COPYING.libraries                 |  510 ------------
 doc/COPYRIGHT                         |   42 -
 doc/Makefile.am                       |   10 -
 doc/README.licence                    |   33 -
 doc/gfs2.txt                          |   45 -
 doc/journaling.txt                    |  155 ----
 doc/min-gfs.txt                       |  159 ----
 doc/usage.txt                         |  177 ----
 group/Makefile.am                     |    3 -
 group/dlm_controld/Makefile.am        |   33 -
 group/include/Makefile.am             |    3 -
 group/man/Makefile.am                 |    3 -
 42 files changed, 0 insertions(+), 6888 deletions(-)

diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index 5bbbda4..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-EXTRA_DIST		= autogen.sh
-
-AUTOMAKE_OPTIONS	= foreign
-
-MAINTAINERCLEANFILES	= Makefile.in aclocal.m4 configure depcomp \
-			  config.guess config.sub missing install-sh \
-			  autoheader automake autoconf libtool libtoolize \
-			  ltmain.sh compile make/clusterautoconfig.h.in \
-			  make/clusterautoconfig.h.in~
-
-noinst_HEADERS		= make/copyright.cf
-
-ACLOCAL_AMFLAGS		= -I m4
-
-SUBDIRS			= dlm group doc
-
-install-exec-local:
-			$(INSTALL) -d $(DESTDIR)/$(LOGDIR)
-			$(INSTALL) -d $(DESTDIR)/$(CLUSTERVARRUN)
-			$(INSTALL) -d $(DESTDIR)/$(CLUSTERVARLIB)
-
-uninstall-local:
-			rmdir $(DESTDIR)/$(LOGDIR) || :;
-			rmdir $(DESTDIR)/$(CLUSTERVARRUN) || :;
-			rmdir $(DESTDIR)/$(CLUSTERVARLIB) || :;
-
-maintainer-clean-local:
-	rm -rf m4
diff --git a/autogen.sh b/autogen.sh
deleted file mode 100755
index 3c5e1d9..0000000
--- a/autogen.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# Run this to generate all the initial makefiles, etc.
-mkdir -p m4
-autoreconf -i -v && echo Now run ./configure and make
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 170074a..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,270 +0,0 @@
-
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ([2.63])
-AC_INIT([dlm], [master], [linux-cluster at redhat.com])
-AM_INIT_AUTOMAKE([-Wno-portability])
-LT_PREREQ([2.2.6])
-LT_INIT
-
-AC_CONFIG_MACRO_DIR([m4])
-AC_CONFIG_SRCDIR([dlm/libdlm/libdlm.c])
-AC_CONFIG_HEADERS([make/clusterautoconfig.h])
-
-AC_CANONICAL_HOST
-AC_PROG_LIBTOOL
-
-AC_LANG([C])
-
-# Sanitize path
-
-if test "$prefix" = "NONE"; then
-	prefix="/usr"
-	if test "$localstatedir" = "\${prefix}/var"; then
-		localstatedir="/var"
-	fi
-	if test "$sysconfdir" = "\${prefix}/etc"; then
-		sysconfdir="/etc"
-	fi
-	if test "$libdir" = "\${exec_prefix}/lib"; then
-		if test -e /usr/lib64; then
-			libdir="/usr/lib64"
-		else
-			libdir="/usr/lib"
-		fi
-	fi
-fi
-
-case $exec_prefix in
-  NONE)   exec_prefix=$prefix;;
-  prefix) exec_prefix=$prefix;;
-esac
-
-# Checks for programs.
-
-# check stolen from gnulib/m4/gnu-make.m4
-if ! ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then
-	AC_MSG_ERROR([you don't seem to have GNU make; it is required])
-fi
-
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_PROG_LN_S
-AC_PROG_INSTALL
-AC_PROG_MAKE_SET
-AC_PROG_CXX
-AC_PROG_RANLIB
-
-## local helper functions
-
-# this function checks if CC support options passed as
-# args. Global CFLAGS are ignored during this test.
-cc_supports_flag() {
-	local CFLAGS="$@"
-	AC_MSG_CHECKING([whether $CC supports "$@"])
-	AC_COMPILE_IFELSE([int main(){return 0;}] ,
-			  [RC=0; AC_MSG_RESULT([yes])],
-			  [RC=1; AC_MSG_RESULT([no])])
-	return $RC
-}
-
-# this function tests if a library has a certain function
-# by using AC_CHECK_LIB but restores the original LIBS global
-# envvar. This is required to avoid libtool to link everything
-# with everything.
-check_lib_no_libs() {
-	AC_CHECK_LIB([$1], [$2],,
-		     [AC_MSG_ERROR([Unable to find $1 library])])
-	LIBS=$ac_check_lib_save_LIBS
-}
-
-# check kernel headers path
-uname="$(uname -r)"
-if test -d "/lib/modules/$uname/source" -o -L "/lib/modules/$uname/source"; then
-	DEFAULT_KERNEL_DIR="/lib/modules/$uname/source"
-elif test -d "/lib/modules/$uname/build" -o -L "/lib/modules/$uname -r/build"; then
-	DEFAULT_KERNEL_DIR="/lib/modules/$uname/build"
-else
-	DEFAULT_KERNEL_DIR="/usr/src/linux"
-fi
-
-# local options
-AC_ARG_ENABLE([debug],
-	[  --enable-debug          enable debug build. ],
-	[ default="no" ])
-
-AC_ARG_WITH([syslogfacility],
-	[  --syslogfacility=FACILITY
-                          cluster default syslog facility. ],
-	[ SYSLOGFACILITY="$withval" ],
-	[ SYSLOGFACILITY="LOG_LOCAL4" ])
-
-AC_ARG_WITH([sysloglevel],
-	[  --sysloglevel=LEVEL
-                          cluster default syslog level. ],
-	[ SYSLOGLEVEL="$withval" ],
-	[ SYSLOGLEVEL="LOG_INFO" ])
-
-AC_ARG_WITH([kernel],
-	[  --with-kernel=path      path to kernel source. ],
-	[ KERNEL_DIR="$withval" ],
-	[ KERNEL_DIR="$DEFAULT_KERNEL_DIR" ])
-
-KERNEL_CPPFLAGS="-I$KERNEL_DIR/include"
-
-PKG_CHECK_MODULES([corosync],[corosync])
-PKG_CHECK_MODULES([cpg],[libcpg])
-PKG_CHECK_MODULES([logt],[liblogthread])
-PKG_CHECK_MODULES([ccs],[libccs])
-PKG_CHECK_MODULES([cfg],[libcfg])
-PKG_CHECK_MODULES([confdb],[libconfdb])
-PKG_CHECK_MODULES([quorum],[libquorum])
-PKG_CHECK_MODULES([fenced],[libfenced])
-
-# external libs (no pkgconfig)
-check_lib_no_libs pthread pthread_mutex_lock
-
-# Checks for header files.
-
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h])
-
-BACKUP_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$KERNEL_CPPFLAGS"
-
-# check kernel headers
-AC_CHECK_HEADERS([linux/major.h linux/types.h linux/dlmconstants.h])
-AC_CHECK_HEADERS([linux/dlm.h linux/dlm_device.h])
-# 2.6.26 adds dlm_plock.h that's our checking barrier, instead
-# of implementing some insane kernel version checks
-# At least on 2.6.27.21-170.2.56.fc10.x86_64, one must include
-# <linux/types.h> to avoid syntax errors regarding __u32.
-AC_CHECK_HEADERS([linux/dlm_plock.h],,
-		 [AC_MSG_ERROR([Unable to find dlm kernel headers.
-Make sure to install kernel headers 2.6.26 (or higher) or use --with-kernel=path
-configure option to point to the kernel source.])],
-  [#include <linux/types.h>])
-
-
-CPPFLAGS="$BACKUP_CPPFLAGS"
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_C_INLINE
-AC_TYPE_INT8_T
-AC_TYPE_MODE_T
-AC_TYPE_SIZE_T
-AC_CHECK_MEMBERS([struct stat.st_rdev])
-AC_TYPE_UINT16_T
-AC_TYPE_UINT32_T
-AC_TYPE_UINT64_T
-AC_TYPE_UINT8_T
-
-# Checks for library functions.
-AC_FUNC_ERROR_AT_LINE
-AC_FUNC_FORK
-AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
-AC_FUNC_MALLOC
-AC_HEADER_MAJOR
-AC_FUNC_REALLOC
-AC_CHECK_FUNCS([ftruncate gettimeofday memset mkdir rmdir socket strchr strdup strerror strncasecmp strstr])
-
-## random vars
-
-LOGDIR=${localstatedir}/log/cluster
-CLUSTERVARRUN=${localstatedir}/run/cluster
-CLUSTERVARLIB=${localstatedir}/lib/cluster
-
-## do subst
-
-AC_SUBST([LOGDIR])
-AC_DEFINE_UNQUOTED([LOGDIR], "$(eval echo ${LOGDIR})",
-		   [Default logging directory])
-
-AC_SUBST([CLUSTERVARRUN])
-AC_DEFINE_UNQUOTED([CLUSTERVARRUN], "$(eval echo ${CLUSTERVARRUN})",
-		   [Default cluster var/run directory])
-
-AC_SUBST([CLUSTERVARLIB])
-
-AC_DEFINE_UNQUOTED([SYSLOGFACILITY], $(eval echo ${SYSLOGFACILITY}),
-		   [Default syslog facility])
-
-AC_DEFINE_UNQUOTED([SYSLOGLEVEL], $(eval echo ${SYSLOGLEVEL}),
-		   [Default syslog level])
-
-## *FLAGS handling
-
-ENV_CFLAGS="$CFLAGS"
-ENV_CPPFLAGS="$CPPFLAGS"
-ENV_LDFLAGS="$LDFLAGS"
-
-# debug build stuff
-if test "x${enable_debug}" = xyes; then
-	AC_DEFINE_UNQUOTED([DEBUG], [1], [Compiling Debugging code])
-	OPT_CFLAGS="-O0"
-else
-	OPT_CFLAGS="-O2"
-fi
-
-# gdb flags
-if test "x${GCC}" = xyes; then
-	GDB_FLAGS="-ggdb3"
-else
-	GDB_FLAGS="-g"
-fi
-
-# extra warnings
-EXTRA_WARNINGS=""
-
-WARNLIST="
-	all
-	shadow
-	missing-prototypes
-	missing-declarations
-	strict-prototypes
-	declaration-after-statement
-	pointer-arith
-	write-strings
-	cast-align
-	bad-function-cast
-	missing-format-attribute
-	format=2
-	format-security
-	format-nonliteral
-	no-long-long
-	unsigned-char
-	gnu89-inline
-	no-strict-aliasing
-	"
-
-for j in $WARNLIST; do
-	if cc_supports_flag -W$j; then
-		EXTRA_WARNINGS="$EXTRA_WARNINGS -W$j";
-	fi
-done
-
-CFLAGS="$ENV_CFLAGS $OPT_CFLAGS $GDB_FLAGS \
-	$EXTRA_WARNINGS $WERROR_CFLAGS"
-CPPFLAGS="$KERNEL_CPPFLAGS -I\$(top_builddir)/make -I\$(top_srcdir)/make \
-	  -I. $ENV_CPPFLAGS"
-LDFLAGS="$ENV_LDFLAGS"
-
-AC_CONFIG_FILES([Makefile
-		 dlm/Makefile
-		 dlm/libdlm/Makefile
-		 dlm/libdlm/libdlm.pc
-		 dlm/libdlm/libdlm_lt.pc
-		 dlm/libdlmcontrol/Makefile
-		 dlm/libdlmcontrol/libdlmcontrol.pc
-		 dlm/tool/Makefile
-		 dlm/tests/Makefile
-		 dlm/tests/usertest/Makefile
-		 dlm/man/Makefile
-		 dlm/doc/Makefile
-		 doc/Makefile
-		 group/Makefile
-		 group/dlm_controld/Makefile
-		 group/include/Makefile
-		 group/man/Makefile
-		 ])
-
-AC_OUTPUT
diff --git a/dlm/Makefile.am b/dlm/Makefile.am
deleted file mode 100644
index 454f628..0000000
--- a/dlm/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-MAINTAINERCLEANFILES	= Makefile.in
-
-SUBDIRS			= libdlm libdlmcontrol tool man doc tests
diff --git a/dlm/doc/Makefile.am b/dlm/doc/Makefile.am
deleted file mode 100644
index 40a1c79..0000000
--- a/dlm/doc/Makefile.am
+++ /dev/null
@@ -1,6 +0,0 @@
-MAINTAINERCLEANFILES	= Makefile.in
-
-dist_doc_DATA		= dlm_tool.txt \
-			  example.c \
-			  libdlm.txt \
-			  user-dlm-overview.txt
diff --git a/dlm/doc/dlm_tool.txt b/dlm/doc/dlm_tool.txt
deleted file mode 100644
index d66cdb0..0000000
--- a/dlm/doc/dlm_tool.txt
+++ /dev/null
@@ -1,167 +0,0 @@
-
-The dlm is configured and controlled from user space through sysfs and a
-couple of ioctl's.  A command line program, dlm_tool, can be used to do
-everything manually.
-
-Here are the dlm_tool config/control actions that will be used:
-
-set_local  <nodeid> <ipaddr> [<weight>]
-set_node   <nodeid> <ipaddr> [<weight>]
-stop       <ls_name>
-terminate  <ls_name>
-start      <ls_name> <event_nr> <type> <nodeid>...
-get_done   <ls_name>
-finish     <ls_name> <event_nr>
-set_id     <ls_name> <id>
-
-For testing and illustration, some actions have been added to dlm_tool to use
-the libdlm API.
-
-create     <ls_name>
-release    <ls_name>
-lock       <ls_name> <res_name> <mode> [<flag>,...]
-unlock     <ls_name> <lkid>            [<flag>,...]
-convert    <ls_name> <lkid> <mode>     [<flag>,...]
-
-So, dlm_tool is standing in for what would usually be two different entities.
-The first set of config/control actions would usually be performed by a system
-daemon associated with a cluster membership manager.  The second set of libdlm
-actions would usually be performed by an application that wants to use the dlm
-for synchronization.
-
-
-Example
-
-1. There are three machines that we want to use the dlm:
-
-nodea -- 10.0.0.1 
-nodeb -- 10.0.0.2
-nodec -- 10.0.0.3
-
-
-2. We'll pick arbitrary integer node ID's for these machines:
-
-nodea -- 1
-nodeb -- 2
-nodec -- 3
-
-
-3. On each node we first need to tell the dlm what the local IP address
-and nodeid are:
-
-nodea> dlm_tool set_local 1 10.0.0.1
-nodeb> dlm_tool set_local 2 10.0.0.2
-nodec> dlm_tool set_local 3 10.0.0.3
-
-
-4. On all nodes we need to set up the nodeid to IP address mappings:
-
-all> dlm_tool set_node 1 10.0.0.1
-all> dlm_tool set_node 2 10.0.0.2
-all> dlm_tool set_node 3 10.0.0.3
-
-
-5. All dlm locking happens within a lockspace; we need to create a test
-lockspace for all the nodes to use.  This step would usually be an application
-that wants to use the dlm and creates a lockspace to use.
-
-all> dlm_tool create test
-
-
-6. The lockspace needs to be "started" on all the nodes.  The <event_nr>
-should begin at 1 and be incremented for each consecutive start that's done on
-the dlm.  The <type> field isn't used by the dlm and can be 0.  Finally, a
-list of nodeid's using the lockspace is given.
-
-all> dlm_tool start test 1 0 1 2 3
-
-
-7. The dlm will now start up on all three nodes.  Whenever it starts it needs
-to do recovery.  Once recovery is done, the event_nr used for the start (1
-above) will be shown as the dlm_tool get_done output.  You need to wait for
-this on all nodes (i.e. for all nodes to complete recovery) before moving on
-to the next step.
-
-all> dlm_tool get_done test
-done event_nr 1
-
-
-8. The lockspace finally needs to know that recovery is finished on all nodes.
-The event_nr used for the start is used here.
-
-all> dlm_tool finish test 1
-
-
-9. The lockspace can now be used by the application for locking, or using
-dlm_tool using the libdlm actions above.
-
-all> dlm_tool lock/unlock/convert ...
-
-
-10. Say that nodea fails.  Nodeb and nodec need to remove nodea from the
-lockspace and do recovery.  The first step is to suspend the dlm operation on
-the remaining nodes:
-
-nodeb,nodec> dlm_tool stop test
-
-
-11. The lockspace then needs to be started again with the new set of lockspace
-members and an incremented event_nr.
-
-nodeb,nodec> dlm_tool start test 2 0 2 3
-
-
-12. We wait for recovery to complete on nodeb and nodec.
-
-nodeb,nodec> dlm_tool get_done test
-done event_nr 2
-
-
-13. Tell the lockspace that recovery is finished on both nodes.
-
-nodeb,nodec> dlm_tool finish test 2
-
-
-14. Nodea comes back and wants to use the dlm again.
-
-nodea> dlm_tool create test
-
-
-15. To add nodea back into the lockspace, first suspend lockspace operations
-on nodeb and nodec.
-
-nodeb,nodec> dlm_tool stop test
-
-
-16.  Start the lockspace on all the nodes with an incremented event_nr
-(event_nr can go back to 1 again for nodea).
-
-nodeb,nodec> dlm_tool start test 3 0 1 2 3
-nodea>       dlm_tool start test 1 0 1 2 3
-
-
-17. Wait for all nodes to complete recovery.
-
-nodeb,nodec> dlm_tool get_done test
-done event_nr 3
-
-nodea> dlm_tool get_done test
-done event_nr 1
-
-
-18. Tell the lockspace that recovery is finished everywhere.
-
-nodeb,nodec> dlm_tool finish test 3
-nodea>       dlm_tool finish test 1
-
-
-
-Notes:
-
-- When you use more than one lockspace on the nodes, you need to use
-  dlm_tool set_id on all nodes to assign each lockspace a unique
-  integer id.  This is done between the create and the first start.
-
-- A node can leave a lockspace using dlm_tool release (the opposite of
-  dlm_tool create).
-
diff --git a/dlm/doc/example.c b/dlm/doc/example.c
deleted file mode 100644
index 9f3ea11..0000000
--- a/dlm/doc/example.c
+++ /dev/null
@@ -1,52 +0,0 @@
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdint.h>
-#include <errno.h>
-#include <string.h>
-#include <stdio.h>
-#include <signal.h>
-#include <libdlm.h>
-
-/*
- * Simple libdlm locking demo
- *
- * Daniel Phillips, phillips at redhat.com
- *
- */
-
-#define error(string, args...) do { printf(string, ##args); exit(1); } while (0)
-
-void my_ast(void *arg)
-{
-	printf("ast got arg %p\n", arg);
-}
-
-int main(void)
-{
-	int fd, child;
-	struct dlm_lksb lksb;
-
-	if ((fd = dlm_get_fd()) < 0)
-		error("dlm error %i, %s\n", errno, strerror(errno));
-
-	switch (child = fork()) {
-	case -1:
-		error("fork error %i, %s\n", errno, strerror(errno));
-	case 0:
-		while (1)
-			dlm_dispatch(fd);
-	}
-
-	if (dlm_lock(LKM_PWMODE, &lksb, LKF_NOQUEUE, "foo", 3,
-		     0, my_ast, (void *)&fd, NULL, NULL) < 0)
-		error("dlm error %i, %s\n", errno, strerror(errno));
-	sleep(1);
-
-	if (dlm_unlock(lksb.sb_lkid, 0, &lksb, NULL) < 0)
-		error("dlm error %i, %s\n", errno, strerror(errno));
-	sleep(1);
-
-	kill(child, SIGTERM);
-	return 0;
-}
-
diff --git a/dlm/doc/libdlm.txt b/dlm/doc/libdlm.txt
deleted file mode 100644
index 18d44f9..0000000
--- a/dlm/doc/libdlm.txt
+++ /dev/null
@@ -1,533 +0,0 @@
-User-space interface to DLM
----------------------------
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdint.h>
-#include <libdlm.h>
-
-cc -D_REENTRANT prog.c  -ldlm -lpthread
-
-cc prog.c  -ldlm_lt
-
-
-There are basically two interfaces to libdlm. The first is the "dead simple"
-one that has limited functionality and assumes that the application is linked
-with pthreads. The second is the full-featured DLM interface that looks
-identical to the kernel interface.
-
-See CVS dlm/tests/usertest for examples of use of both these APIs.
-
-The simple one
---------------
-This provides two API calls, lock_resource() and unlock_resource(). Both of
-these calls block until the lock operation has completed - using a worker
-thread to deal with the callbacks that come from the kernel.
-
-int lock_resource(const char *resource, int mode, int flags, int *lockid);
-
-  This function locks a named (NUL-terminated) resource and returns the
-  lockid if successful. The mode may be any of
-
-    LKM_NLMODE LKM_CRMODE LKM_CWMODE LKM_PRMODE LKM_PWMODE LKM_EXMODE
-
-  Flags may be any combination of
-
-    LKF_NOQUEUE - Don't wait if the lock cannot be granted immediately,
-                  will return EAGAIN if this is so.
-
-    LKF_CONVERT - Convert lock to new mode. *lockid must be valid,
-                  resource name is ignored.
-
-    LKF_QUECVT  - Add conversion to the back of the convert queue - only
-                  valid for some convert operations
-
-    LKF_PERSISTENT - Don't automatically unlock this lock when the process
-                     exits (must be root).
-
-
-int unlock_resource(int lockid);
-
-  Unlocks the resource.
-
-
-
-The complicated one
--------------------
-This interface is identical to the kernel interface with the exception of
-the lockspace argument. All userland locks sit in the same lockspace by default.
-
-libdlm can be used in pthread or non-pthread applications. For pthread
-applications simply call the following function before doing any lock
-operations. If you're using pthreads, remember to define _REENTRANT at the
-top of the program or using -D_REENTRANT on the compile line.
-
-int dlm_pthread_init()
-
-  Creates a thread to receive all lock ASTs. The AST callback function
-  for lock operations will be called in the context of this thread.
-  If there is a potential for local resource access conflicts you must
-  provide your own pthread-based locking in the AST routine.
-
-
-int dlm_pthread_cleanup()
-
-  Cleans up the default lockspace threads after use. Normally you 
-  don't need to call this, but if the locking code is in a 
-  dynamically loadable shared library this will probably be necessary.
-
-
-For non-pthread based applications the DLM provides a file descriptor
-that the program can feed into poll/select. If activity is detected
-on that FD then a dispatch function should be called:
-
-int dlm_get_fd()
-
-  Returns a file-descriptor for the DLM suitable for passing in to
-  poll() or select().
-
-int dlm_dispatch(int fd)
-
-  Reads from the DLM and calls any AST routines that may be needed.
-  This routine runs in the context of the caller so no extra locking
-  is needed to protect local resources.
-
-
-int dlm_lock(uint32_t mode,
-	     struct dlm_lksb *lksb,
-	     uint32_t flags,
-	     const void *name,
-	     unsigned int namelen,
-	     uint32_t parent,
-	     void (*astaddr) (void *astarg),
-	     void *astarg,
-	     void (*bastaddr) (void *astarg),
-	     struct dlm_range *range);
-	      
-
-mode		lock mode:
-                LKM_NLMODE 	NULL Lock
-		LKM_CRMODE    	Concurrent read
-		LKM_CWMODE    	Concurrent write
-		LKM_PRMODE    	Protected read
-		LKM_PWMODE    	Protected write
-		LKM_EXMODE    	Exclusive
-
-flags		LKF_NOQUEUE	Don't queue the lock. If it cannot be
-				granted return -EAGAIN
-		LKF_CONVERT	Convert an existing lock
-		LKF_VALBLK	Lock has a value block
-		LKF_QUECVT	Put conversion to the back of the queue
-		LKF_EXPEDITE    Grant a NL lock immediately regardless of
-				other locks on the conversion queue
-		LKF_PERSISTENT  Specifies a lock that will
-                                not be unlocked when the process exits.
-
-lksb		Lock status block.
-		This structure contains the returned lock ID, the actual
-		status of the lock operation (all lock ops are asynchronous)
-		and the value block if LKF_VALBLK is set.
-
-name		Name of the lock. Can be binary, max 64 bytes. Ignored for lock
-		conversions.
-
-namelen		Length of the above name. Ignored for lock conversions.
-
-parent		ID of parent lock or NULL if this is a top-level lock
-
-ast		Address of AST routine to be called when the lock operation
-		completes. The final completion status of the lock will be
-		in the lksb. the AST routine must not be NULL.
-		
-astargs		Argument to pass to the AST routine (most people pass the lksb
-		in here but it can be anything you like.)
-		
-bast		Blocking AST routine. address of a function to call if this 
-		lock is blocking another. The function will be called with
-		astargs. 
-
-range		an optional structure of two uint64_t that indicate the range
-		of the lock. Locks with overlapping ranges will be granted only
-		if the lock modes are compatible. locks with non-overlapping
-		ranges (on the same resource) do not conflict. A lock with no
-		range is assumed to have a range emcompassing the largest
-		possible range. ie. 0-0xFFFFFFFFFFFFFFFF.  Note that is is more
-		efficient to specify no range than to specify the full range
-		above.
-
-
-dlm_lock operations are asynchronous. If the call to dlm_lock returns an error
-then the operation has failed and the AST routine will not be called. If
-dlm_lock returns 0 it is still possible that the lock operation will fail. The
-AST routine will be called when the locking is complete or has failed and the
-status is returned in the lksb.
-
-For conversion operations the name and namelen are ignored and the lock ID in
-the LKSB is used to identify the lock.  
-
-If a lock value block is specified then in general, a grant or a conversion to 
-an equal-level or higher-level lock mode reads the lock value from the resource 
-into the caller's lock value block. When a lock conversion from EX or PW
-to an equal-level or lower-level lock mode occurs, the contents of 
-the caller's lock value block are written into the resource.
-
-If the AST routines or parameter are passed to a conversion operation then they
-will overwrite those values that were passed to a previous dlm_lock call.
-
-int dlm_lock_wait(uint32_t mode,
-		  struct dlm_lksb *lksb,
-		  uint32_t flags,
-		  const void *name,
-		  unsigned int namelen,
-		  uint32_t parent,
-		  void *bastarg,
-		  void (*bastaddr) (void *bastarg),
-		  struct dlm_range *range);
-	      
-
-As above except that the call will block until the lock is
-granted or has failed. The return from the function is
-the final status of the lock request (ie that was returned
-in the lksb after the AST routine was called).
-
-
-
-int dlm_unlock(uint32_t lkid, 
-               uint32_t flags, 
-               struct dlm_lksb *lksb, 
-               void *astarg)
-
-lkid		Lock ID as returned in the lksb
-
-flags		flags affecting the unlock operation:
-		LKF_CANCEL	CANCEL a pending lock or conversion. 
-				This returns the lock to it's
-				previously granted mode (in case of a
-				conversion) or unlocks it (in case of a
-				waiting lock).
-					
-		LKF_IVVALBLK	Invalidate value block
-
-lksb		LKSB to return status and value block information. 
-
-astarg 		New parameter to be passed to the completion AST.
-		The completion AST routine is the
-		last completion AST routine specified in a dlm_lock call.
-		If dlm_lock_wait() was the last routine to issue a lock, 
-		dlm_unlock_wait() must be used to release the lock. If dlm_lock()
-		was the last routine to issue a lock then either dlm_unlock()
-		or dlm_unlock_wait() may be called.
-		
-Unlocks are also asynchronous. The AST routine is called when the resource is
-successfully unlocked (see below).
-
-
-Extra status returns to the completion AST (apart from those already
-defined in errno.h)
-
-ECANCEL
-  A lock conversion was successfully cancelled
-  
-EUNLOCK
-  An Unlock operation completed successfully
-
-EDEADLOCK
-  The lock operation is causing a deadlock and has been cancelled. If this
-  was a conversion then the lock is reverted to its previously granted state.
-  If it was a new lock then it has not been granted. 
-  (NB Only conversion deadlocks are currently detected)
-  
-int dlm_unlock_wait(uint32_t lkid, 
-                    uint32 flags, 
-                    struct dlm_lksb *lksb)
-
-As above but returns when the unlock operation is complete either because it
-finished or because an error was detected. In the case where
-the unlock operation was succesful no error is returned.
-
-The return value of the function call is the status of issuing
-the unlock operation. The status of the unlock operation itself
-is in the lock status block. Both of these must be checked to
-verify that the unlock has completed succesfully.
-
-Lock Query Operations
----------------------
-int dlm_query(struct dlm_lksb *lksb,
-              int query,
-	      struct dlm_queryinfo *qinfo,
-	      void (*ast_routine(void *astarg)),
-	      void *astarg);
-
-The operation is asynchronous, the ultimate status and data will be returned into the
-dlm_query_info structure which should be checked when the ast_routine is
-called. The lksb must contain a valid lock ID in sb_lkid which is used to 
-identify the resource to be queried, status will be returned in sb_status;
-As with the locking calls an AST woutine will be called when the query completes
-if the call itself returns 0.
-
-int dlm_query_wait(struct dlm_lksb *lksb,
-                   int query,
-	           struct dlm_queryinfo *qinfo)
-
-Same as dlm_query() except that it waits for the operation to complete.
-When the operation is complete the status of will be in the lksb. Both
-the return value from the function call and the condition code in the
-lksb must be evaluated.
-
-If the provided lock list is too short to hold all the locks, then sb_status
-in the lksb will contain -E2BIG but the list will be filled in as far as possible.
-Either gqi_lockinfo or gqi_resinfo may be NULL if that information is not required.
-
-/* Structures passed into and out of the query */
-
-struct gdlm_lockinfo
-{
-    int   lki_lkid;          /* Lock ID on originating node */
-    int   lki_parent;
-    int   lki_node;          /* Originating node (not master) */
-    int   lki_ownpid;        /* Owner pid on the originating node */
-    uint8 lki_state;         /* Queue the lock is on */
-    int8  lki_grmode         /* Granted mode */
-    int8  lki_rqmode;        /* Requested mode */
-    struct dlm_range lki_grrange /* Granted range, if applicable */
-    struct dlm_range lki_rqrange /* Requested range, if applicable */
-};
-
-struct gdlm_resinfo
-{
-    int	 rsi_length;
-    int  rsi_grantcount; /* No. of nodes on grant queue */
-    int  rsi_convcount;  /* No. of nodes on convert queue */
-    int  rsi_waitcount;  /* No. of nodes on wait queue */
-    int  rsi_masternode; /* Master for this resource */
-    char rsi_name[DLM_RESNAME_MAXLEN]; /* Resource name */
-    char rsi_valblk[DLM_LVB_LEN];      /* Master's LVB contents, if applicable */
-};
-
-struct dlm_queryinfo
-{
-    struct dlm_resinfo  *gqi_resinfo;   /* Points to a single resinfo struct */
-    struct dlm_lockinfo *gqi_lockinfo;  /* This points to an array of structs */
-    int                   gqi_locksize;  /* input */
-    int                   gqi_lockcount; /* output */
-};
-
-The query is made up of several blocks of bits as follows:
-
-                   9  8        6  5     3           0
-+----------------+---+-------+---+-------+-----------+
-|    reserved    | Q | query | F | queue | lock mode |
-+----------------+---+-------+---+-------+-----------+
-
-lock mode is a normal DLM lock mode or DLM_LOCK_THIS
-to use the mode of the lock in sb_lkid.
-
-queue is a bitmap of
- DLM_QUERY_QUEUE_WAIT
- DLM_QUERY_QUEUE_CONVERT
- DLM_QUERY_QUEUE_GRANT
-
-or one of the two shorthands:
- DLM_QUERY_QUEUE_GRANTED (for WAIT+GRANT)
- DLM_QUERY_QUEUE_ALL     (for all queues)
-
- F is a flag DLM_QUERY_LOCAL
-which specifies that a remote access should not
-happen. Only lock information that can
-be gleaned from the local node will be returned so
-be aware that it may not be complete.
-
-The query is one of the following:
- DLM_QUERY_LOCKS_HIGHER
- DLM_QUERY_LOCKS_LOWER
- DLM_QUERY_LOCKS_EQUAL
- DLM_QUERY_LOCKS_BLOCKING
- DLM_QUERY_LOCKS_NOTBLOCK
- DLM_QUERY_LOCKS_ALL
-
-which specifies which locks to look for by mode,
-either the lockmode is lower, equal or higher
-to the mode at the bottom of the query. 
-DLM_QUERY_ALL will return all locks on the
-resource.
-
-DLM_QUERY_LOCKS_BLOCKING returns only locks
-that are blocking the current lock. The lock
-must not be waiting for grant or conversion
-for this to be a valid query, the other flags
-are ignored.
-
-DLM_QUERY_LOCKS_NOTBLOCKING returns only locks
-that are granted but NOT blocking the current lock.
-
-Q specifies which lock queue to compare. By default
-the granted queue is used. If the flags 
-DLM_QUERY_RQMODE is set then the requested mode
-will be used instead.
-
-
-The "normal" way to call dlm_query is to put the
-address of the dlm_queryinfo struct into 
-lksb.sb_lvbptr and pass the lksb as the AST param,
-that way all the information is available to you
-in the AST routine.
-
-Lockspace Operations
---------------------
-The DLM allows locks to be partitioned into "lockspaces", and these can be
-manipulated by userspace calls. It is possible (though not recommended) for
-an application to have multiple lockspaces open at one time. 
-
-All the above calls work on the "default" lockspace, which should be
-fine for most users. The calls below allow you to isolate your
-application from all others running in the cluster. Remember, lockspaces
-are a cluster-wide resource, so if you create a lockspace called "myls" it 
-will share locks with a lockspace called "myls" on all nodes.
-
-
-dlm_lshandle_t dlm_create_lockspace(const char *name, mode_t mode);
-
-  This creates a lockspace called <name> and the mode of the file 
-  user to access it wil be <mode> (subject to umask as usual). 
-  The lockspace must not already exist on this node, if it does -1
-  will be returned and errno will be set to EEXIST. If you really
-  want to use this lockspace you can then user dlm_open_lockspace()
-  below. The name is the name of a misc device that will be created
-  in /dev/misc.
-
-  On success a handle to the lockspace is returned, which can be used 
-  to pass into subsequent dlm_ls_lock/unlock calls. Make no assumptions
-  as to the content of this handle as it's content may change in future.
-
-  The caller must have CAP_SYSADMIN privileges to do this operation.
-
-
-int dlm_release_lockspace(const char *name, dlm_lshandle_t lockspace, int force)
-
-  Deletes a lockspace. If the lockspace still has active locks then -1 will be
-  returned and errno set to EBUSY. Both the lockspace handle /and/ the name
-  must be specified. This call also closes the lockspace and stops the thread
-  associated with the lockspace, if any.
-
-  Note that other nodes in the cluster may still have locks open on this 
-  lockspace.
-  This call only removes the lockspace from the current node.
-
-  If the force flag is set then the lockspace will be removed even if another
-  user on this node has active locks in it. Existing users will NOT
-  be notified if you do this, so be careful.
-
-
-dlm_lshandle_t dlm_open_lockspace(const char *name)
-
-  Opens an already existing lockspace and returns a handle to it.
-
-
-int dlm_close_lockspace(dlm_lshandle_t lockspace)
-
-  Close the lockspace. Any locks held by this process will be freed.
-  If a thread is associated with this lockspace then it will be stopped.
-
-
-int dlm_ls_get_fd(dlm_lshandle_t lockspace)
-
-  Returns the file descriptor associated with the lockspace so that the
-  user call use it as input to poll/select.
-
-
-int dlm_ls_pthread_init(dlm_lshandle_t lockspace)
-
-  Initialise threaded environment for this lockspace, similar
-  to dlm_pthread_init() above.
-
-
-int dlm_ls_lock(dlm_lshandle_t lockspace,
-		int mode,
-		struct dlm_lksb *lksb,
-		uint32_t flags,
-		void *name,
-		unsigned int namelen,
-		uint32_t parent,
-		void (*ast) (void *astarg),
-		void *astarg,
-		void (*bast) (void *astarg),
-		struct dlm_range *range)
-
-  Same as dlm_lock() above but takes a lockspace argument.
-
-int dlm_ls_lock_wait(dlm_lshandle_t lockspace,
-		     int mode,
-		     struct dlm_lksb *lksb,
-		     uint32_t flags,
-		     void *name,
-		     unsigned int namelen,
-		     uint32_t parent,
-		     void *bastarg,
-		     void (*bast) (void *bastarg),
-		     struct dlm_range *range)
-
-  Same as dlm_lock_wait() above but takes a lockspace argument.
-
-
-int dlm_ls_unlock(dlm_lshandle_t lockspace,
-		  uint32_t lkid, 
-                  uint32_t flags, 
-                  struct dlm_lksb *lksb, 
-                  void *astarg)
-
-
-  Same as dlm_unlock above but takes a lockspace argument.
-
-int dlm_ls_unlock_wait(dlm_lshandle_t lockspace,
-		       uint32_t lkid, 
-                       uint32_t flags, 
-                       struct dlm_lksb *lksb)
-
-
-  Same as dlm_unlock_wait above but takes a lockspace argument.
-
-
-int dlm_ls_query(dlm_lshandle_t lockspace,
-                 struct dlm_lksb *lksb,
-                 int query,
-	         struct dlm_queryinfo *qinfo,
-	         void (*ast_routine(void *astarg)),
-	         void *astarg);
-
-  Same as dlm_query above but takes a lockspace argument.
-
-int dlm_ls_query_wait(dlm_lshandle_t lockspace,
-                      struct dlm_lksb *lksb,
-                      int query,
-	              struct dlm_queryinfo *qinfo)
-
-  Same as dlm_query_wait above but takes a lockspace argument.
-
-
-One further point about lockspace operations is that there is no locking
-on the creating/destruction of lockspaces in the library so it is up to the
-application to only call dlm_*_lockspace when it is sure that
-no other locking operations are likely to be happening within that process.
-
-Libraries
----------
-There are two DLM libraries, one that uses pthreads (libdlm) to deliver ASTs
-and a light one one that doesn't (libdlm_lt). 
-
-The "light" library contains only the following calls.
-
-- dlm_lock
-- dlm_unlock
-- dlm_query
-- dlm_get_fd
-- dlm_dispatch
-- dlm_ls_lock
-- dlm_ls_unlock
-- dlm_ls_query
-- dlm_ls_get_fd
-- dlm_create_lockspace
-- dlm_open_lockspace
-- dlm_release_lockspace
-- dlm_close_lockspace
-
-Note that libdlm (the pthreads one) also contains the non-threaded calls
-so you can choose at runtime if you need to.
diff --git a/dlm/doc/user-dlm-overview.txt b/dlm/doc/user-dlm-overview.txt
deleted file mode 100644
index bda3aea..0000000
--- a/dlm/doc/user-dlm-overview.txt
+++ /dev/null
@@ -1,325 +0,0 @@
-
-There are five ways to request a dlm lock (and five corresponding ways to
-unlock).
-
-- lock_resource
-- dlm_lock
-- dlm_ls_lock
-- dlm_lock_wait
-- dlm_ls_lock_wait
-
-- unlock_resource
-- dlm_unlock
-- dlm_ls_unlock
-- dlm_unlock_wait
-- dlm_ls_unlock_wait
-
-There is also a set of "administrative" functions that are used along with
-some of the lock/unlock requests.  Which are used depends on which locking
-method is used or whether the application is threaded.
-
-- dlm_pthread_init
-- dlm_ls_pthread_init
-- dlm_pthread_cleanup
-- dlm_get_fd
-- dlm_ls_get_fd
-- dlm_dispatch
-- dlm_create_lockspace
-- dlm_open_lockspace
-- dlm_release_lockspace
-- dlm_close_lockspace
-
-
-Overview of lock request methods
---------------------------------
-
-- synchronous, default lockspace
-  use dlm_pthread_init/dlm_pthread_cleanup if app is threaded
-  use dlm_get_fd/dlm_dispatch if app is not threaded
-  use unlock_resource to unlock
-
-int lock_resource(
-        const char *resource,
-        uint32_t mode,
-        uint32_t flags,
-        uint32_t *lkid);
-
-
-- asynchronous, default lockspace
-  use dlm_pthread_init/dlm_pthread_cleanup if app is threaded
-  use dlm_get_fd/dlm_dispatch if app is not threaded
-  use dlm_unlock/dlm_unlock_wait to unlock
-
-int dlm_lock(
-        uint32_t mode,
-        struct dlm_lksb *lksb,
-        uint32_t flags,
-        void *name,
-        unsigned int namelen,
-        uint32_t parent,
-        void (*ast) (void *astarg),
-        void *astarg,
-        void (*bast) (void *astarg),
-        struct dlm_range *range);
-
-
-- synchronous, default lockspace
-  use dlm_pthread_init/dlm_pthread_cleanup if app is threaded
-  use dlm_get_fd/dlm_dispatch if app is not threaded
-  use dlm_unlock/dlm_unlock_wait to unlock
-
-int dlm_lock_wait(
-        uint32_t mode,
-        struct dlm_lksb *lksb,
-        uint32_t flags,
-        void *name,
-        unsigned int namelen,
-        uint32_t parent,
-        void *bastarg,
-        void (*bast) (void *bastarg),
-        struct dlm_range *range);
-
-
-- asynchronous, any lockspace
-  use dlm_ls_pthread_init/dlm_pthread_cleanup if app is threaded
-  use dlm_ls_get_fd/dlm_dispatch if app is not threaded
-  use dlm_create_lockspace/dlm_open_lockspace to start
-  use dlm_release_lockspace/dlm_close_lockspace to finish
-  use dlm_ls_unlock/dlm_ls_unlock_wait to unlock
-
-int dlm_ls_lock(
-        dlm_lshandle_t lockspace,
-        uint32_t mode,
-        struct dlm_lksb *lksb,
-        uint32_t flags,
-        void *name,
-        unsigned int namelen,
-        uint32_t parent,
-        void (*ast) (void *astarg),
-        void *astarg,
-        void (*bast) (void *astarg),
-        struct dlm_range *range);
-
-
-- synchronous, any lockspace
-  use dlm_ls_pthread_init/dlm_pthread_cleanup if app is threaded
-  use dlm_ls_get_fd/dlm_dispatch if app is not threaded
-  use dlm_create_lockspace/dlm_open_lockspace to start
-  use dlm_release_lockspace/dlm_close_lockspace to finish
-  use dlm_ls_unlock/dlm_ls_unlock_wait to unlock
-
-int dlm_ls_lock_wait(
-        dlm_lshandle_t lockspace,
-        uint32_t mode,
-        struct dlm_lksb *lksb,
-        uint32_t flags,
-        void *name,
-        unsigned int namelen,
-        uint32_t parent,
-        void *bastarg,
-        void (*bast) (void *bastarg),
-        struct dlm_range *range);
-
-
-
-Corresponding unlock requests 
------------------------------
-
-int unlock_resource(
-	uint32_t lkid);
-
-int dlm_unlock(
-	uint32_t lkid,
-	uint32_t flags,
-	struct dlm_lksb *lksb,
-	void *astarg);
-
-int dlm_unlock_wait(
-	uint32_t lkid,
-	uint32_t flags,
-	struct dlm_lksb *lksb);
-
-int dlm_ls_unlock(
-	dlm_lshandle_t lockspace,
-	uint32_t lkid,
-	uint32_t flags,
-	struct dlm_lksb *lksb,
-	void *astarg);
-
-int dlm_ls_unlock_wait(
-	dlm_lshandle_t lockspace,
-	uint32_t lkid,
-	uint32_t flags,
-	struct dlm_lksb *lksb);
-
-
-
-Common to all of the above
---------------------------
-
-#define DLM_RESNAME_MAXLEN (64)
-#define DLM_LVB_LEN        (32)
-
-#define LKM_NLMODE         0               /* null lock */
-#define LKM_CRMODE         1               /* concurrent read */
-#define LKM_CWMODE         2               /* concurrent write */
-#define LKM_PRMODE         3               /* protected read */
-#define LKM_PWMODE         4               /* protected write */
-#define LKM_EXMODE         5               /* exclusive */
-
-#define LKF_NOQUEUE        (0x00000001)
-#define LKF_CANCEL         (0x00000002)
-#define LKF_CONVERT        (0x00000004)
-#define LKF_VALBLK         (0x00000008)
-#define LKF_QUECVT         (0x00000010)
-#define LKF_IVVALBLK       (0x00000020)
-#define LKF_CONVDEADLK     (0x00000040)
-#define LKF_PERSISTENT     (0x00000080)
-#define LKF_NODLCKWT       (0x00000100)
-#define LKF_NODLCKBLK      (0x00000200)
-#define LKF_EXPEDITE       (0x00000400)
-#define LKF_NOQUEUEBAST    (0x00000800)
-#define LKF_HEADQUE        (0x00001000)
-#define LKF_NOORDER        (0x00002000)
-
-#define ECANCEL            (0x10001)
-#define EUNLOCK            (0x10002)
-#define EINPROG            (0x10003)
-
-struct dlm_lksb {
-	int sb_status;
-	uint32_t sb_lkid;
-	char sb_flags;
-	char *sb_lvbptr;
-};
-
-struct dlm_range {
-	uint64_t ra_start;
-	uint64_t ra_end;
-};
-
-
-
-
-Overview of administrative functions
-------------------------------------
-
-- dlm_pthread_init
-- dlm_ls_pthread_init
-- dlm_pthread_cleanup
-- dlm_get_fd
-- dlm_ls_get_fd
-- dlm_dispatch
-- dlm_create_lockspace
-- dlm_open_lockspace
-- dlm_release_lockspace
-- dlm_close_lockspace
-
-
-typedef void * dlm_lshandle_t;
-
-dlm_lshandle_t dlm_create_lockspace(const char *name, mode_t mode);
-
-int dlm_release_lockspace(const char *name, dlm_lshandle_t ls, int force);
-
-dlm_lshandle_t dlm_open_lockspace(const char *name);
-
-int dlm_close_lockspace(dlm_lshandle_t ls);
-
-int dlm_pthread_init();
-
-int dlm_ls_pthread_init(dlm_lshandle_t lockspace);
-
-int dlm_pthread_cleanup();
-
-int dlm_get_fd();
-
-int dlm_ls_get_fd(dlm_lshandle_t ls);
-
-int dlm_dispatch(int fd);
-
-
-
-Query functions
----------------
-
-Query functions follow the same pattern as the lock and unlock functions.
-
-int dlm_query(
-	struct dlm_lksb *lksb,
-	int query,
-	struct dlm_queryinfo *qinfo,
-	void (*astaddr) (void *astarg),
-	void *astarg);
-
-int dlm_query_wait(
-	struct dlm_lksb *lksb,
-	int query,
-	struct dlm_queryinfo *qinfo);
-
-int dlm_ls_query(
-	dlm_lshandle_t lockspace,
-	struct dlm_lksb *lksb,
-	int query,
-	struct dlm_queryinfo *qinfo,
-	void (*astaddr) (void *astarg),
-	void *astarg);
-
-int dlm_ls_query_wait(
-	dlm_lshandle_t lockspace,
-	struct dlm_lksb *lksb,
-	int query,
-	struct dlm_queryinfo *qinfo);
-
-#define DLM_LOCK_THIS            0x0007
-#define DLM_QUERY_MODE_MASK      0x0007
-
-#define DLM_QUERY_QUEUE_WAIT     0x0008
-#define DLM_QUERY_QUEUE_CONVERT  0x0010
-#define DLM_QUERY_QUEUE_GRANT    0x0020
-#define DLM_QUERY_QUEUE_GRANTED  0x0030
-#define DLM_QUERY_QUEUE_ALL      0x0038
-
-#define DLM_QUERY_LOCKS_HIGHER   0x0100
-#define DLM_QUERY_LOCKS_LOWER    0x0200
-#define DLM_QUERY_LOCKS_EQUAL    0x0300
-#define DLM_QUERY_LOCKS_BLOCKING 0x0400
-#define DLM_QUERY_LOCKS_NOTBLOCK 0x0500
-#define DLM_QUERY_LOCKS_ALL      0x0600
-#define DLM_QUERY_MASK           0x0F00
-
-#define DLM_QUERY_GRMODE         0x0000
-#define DLM_QUERY_RQMODE         0x1000
-
-struct dlm_lockinfo {
-        int lki_lkid;
-        int lki_mstlkid;
-        int lki_parent;
-        int lki_node;
-        int lki_ownpid;
-        uint8_t lki_state;
-        uint8_t lki_grmode;
-        uint8_t lki_rqmode;
-        struct dlm_range lki_grrange;
-        struct dlm_range lki_rqrange;
-};
-
-struct dlm_resinfo {
-        int rsi_length;
-        int rsi_grantcount;
-        int rsi_convcount;
-        int rsi_waitcount;
-        int rsi_masternode;
-        char rsi_name[DLM_RESNAME_MAXLEN];
-        char rsi_valblk[DLM_LVB_LEN];
-};
-
-struct dlm_queryinfo {
-        struct dlm_resinfo *gqi_resinfo;
-        struct dlm_lockinfo *gqi_lockinfo;
-        int gqi_locksize;
-        int gqi_lockcount;
-};
-
-
-
diff --git a/dlm/libdlm/Makefile.am b/dlm/libdlm/Makefile.am
deleted file mode 100644
index 7236ee9..0000000
--- a/dlm/libdlm/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-MAINTAINERCLEANFILES	= Makefile.in
-
-libversion		= 3:0:0
-
-include_HEADERS		= libdlm.h
-
-noinst_HEADERS		= libdlm_internal.h
-
-pkgconfigdir		= $(libdir)/pkgconfig
-
-pkgconfig_DATA		= libdlm.pc libdlm_lt.pc
-
-udevrulesdir		= $(sysconfdir)/udev/rules.d
-
-udevrules_DATA		= $(srcdir)/51-dlm.rules
-
-lib_LTLIBRARIES		= libdlm.la libdlm_lt.la
-
-libdlm_la_SOURCES	= libdlm.c
-
-libdlm_lt_la_SOURCES	= libdlm.c
-
-libdlm_la_CPPFLAGS	= -D_REENTRANT
-
-libdlm_la_LDFLAGS	= -lpthread \
-			  -version-info $(libversion)
-
-libdlm_lt_la_LDFLAGS	= -version-info $(libversion)
diff --git a/dlm/libdlm/libdlm.pc.in b/dlm/libdlm/libdlm.pc.in
deleted file mode 100644
index 917b261..0000000
--- a/dlm/libdlm/libdlm.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=${prefix}
-libdir=@libdir@
-includedir=${prefix}/include
-
-Name: libdlm
-Version: @VERSION@
-Description: Cluster Distributed Lock Manager library
-Requires:
-Libs: -L${libdir} -ldlm -lpthread
-Cflags: -I${includedir}
diff --git a/dlm/libdlm/libdlm_lt.pc.in b/dlm/libdlm/libdlm_lt.pc.in
deleted file mode 100644
index 502cb00..0000000
--- a/dlm/libdlm/libdlm_lt.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=${prefix}
-libdir=@libdir@
-includedir=${prefix}/include
-
-Name: libdlm_lt
-Version: @VERSION@
-Description: Cluster Distributed Lock Manager non-threaded library
-Requires:
-Libs: -L${libdir} -ldlm_lt
-Cflags: -I${includedir}
diff --git a/dlm/libdlmcontrol/Makefile.am b/dlm/libdlmcontrol/Makefile.am
deleted file mode 100644
index 3e3f48f..0000000
--- a/dlm/libdlmcontrol/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-MAINTAINERCLEANFILES	= Makefile.in
-
-libversion		= 3:0:0
-
-include_HEADERS		= libdlmcontrol.h
-
-pkgconfigdir		= $(libdir)/pkgconfig
-
-pkgconfig_DATA		= libdlmcontrol.pc
-
-lib_LTLIBRARIES		= libdlmcontrol.la
-
-libdlmcontrol_la_SOURCES  = main.c
-
-libdlmcontrol_la_CPPFLAGS = -I${top_srcdir}/group/dlm_controld
-
-libdlmcontrol_la_LDFLAGS  = -version-info $(libversion)
diff --git a/dlm/libdlmcontrol/libdlmcontrol.pc.in b/dlm/libdlmcontrol/libdlmcontrol.pc.in
deleted file mode 100644
index 4273ee4..0000000
--- a/dlm/libdlmcontrol/libdlmcontrol.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=${prefix}
-libdir=@libdir@
-includedir=${prefix}/include
-
-Name: libdlmcontrol
-Version: @VERSION@
-Description: DLM control library
-Requires:
-Libs: -L${libdir} -ldlmcontrol
-Cflags: -I${includedir}
diff --git a/dlm/man/Makefile.am b/dlm/man/Makefile.am
deleted file mode 100644
index 8502496..0000000
--- a/dlm/man/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-MAINTAINERCLEANFILES	= Makefile.in
-
-dist_man_MANS		= dlm_cleanup.3 \
-			  dlm_close_lockspace.3 \
-			  dlm_create_lockspace.3 \
-			  dlm_dispatch.3 \
-			  dlm_get_fd.3 \
-			  dlm_lock.3 \
-			  dlm_lock_wait.3 \
-			  dlm_ls_lock.3 \
-			  dlm_ls_lockx.3 \
-			  dlm_ls_lock_wait.3 \
-			  dlm_ls_pthread_init.3 \
-			  dlm_ls_unlock.3 \
-			  dlm_ls_unlock_wait.3 \
-			  dlm_new_lockspace.3 \
-			  dlm_open_lockspace.3 \
-			  dlm_pthread_init.3 \
-			  dlm_release_lockspace.3 \
-			  dlm_unlock.3 \
-			  dlm_unlock_wait.3 \
-			  libdlm.3 \
-			  dlm_tool.8
diff --git a/dlm/tests/Makefile.am b/dlm/tests/Makefile.am
deleted file mode 100644
index 78fd9bb..0000000
--- a/dlm/tests/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-MAINTAINERCLEANFILES	= Makefile.in
-
-SUBDIRS			= usertest
diff --git a/dlm/tests/usertest/Makefile.am b/dlm/tests/usertest/Makefile.am
deleted file mode 100644
index 5b30f1c..0000000
--- a/dlm/tests/usertest/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-MAINTAINERCLEANFILES	= Makefile.in
-
-noinst_PROGRAMS		= dlmtest asttest lstest pingtest lvb \
-			  dlmtest2 flood alternate-lvb joinleave threads
-
-AM_CPPFLAGS		= -D_REENTRANT \
-			  -I$(top_srcdir)/dlm/libdlm
-
-dlmtest_LDADD		= $(top_builddir)/dlm/libdlm/libdlm.la
-asttest_LDADD		= $(top_builddir)/dlm/libdlm/libdlm.la
-lstest_LDADD		= $(top_builddir)/dlm/libdlm/libdlm.la
-pingtest_LDADD		= $(top_builddir)/dlm/libdlm/libdlm.la
-lvb_LDADD		= $(top_builddir)/dlm/libdlm/libdlm.la
-dlmtest2_LDADD		= $(top_builddir)/dlm/libdlm/libdlm.la
-flood_LDADD		= $(top_builddir)/dlm/libdlm/libdlm.la
-alternate_lvb_LDADD	= $(top_builddir)/dlm/libdlm/libdlm.la
-joinleave_LDADD		= $(top_builddir)/dlm/libdlm/libdlm.la
-threads_LDADD		= $(top_builddir)/dlm/libdlm/libdlm.la
diff --git a/dlm/tests/usertest/alternate-lvb.c b/dlm/tests/usertest/alternate-lvb.c
deleted file mode 100644
index 6e4df0b..0000000
--- a/dlm/tests/usertest/alternate-lvb.c
+++ /dev/null
@@ -1,167 +0,0 @@
-#include "clusterautoconfig.h"
-
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <stddef.h>
-#include <string.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <time.h>
-#include <sys/time.h>
-#include <syslog.h>
-#include <asm/types.h>
-#include <sys/socket.h>
-#include <sys/poll.h>
-#include <sys/un.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/errno.h>
-
-#include "libdlm.h"
-
-#define die(fmt, args...) \
-do \
-{ \
-  fprintf(stderr, "%s: ", prog_name); \
-  fprintf(stderr, fmt, ##args); \
-  exit(EXIT_FAILURE); \
-} \
-while (0)
-
-static char *prog_name;
-static dlm_lshandle_t *dh;
-static int verbose;
-
-static struct dlm_lksb lksb;
-static char lvb[32];
-
-int main(int argc, char *argv[])
-{
-	unsigned long long offset;
-	unsigned long long num, last_num = 0;
-	unsigned int id, clients, sleeptime = 0;
-	unsigned long long skip = 0;
-	char *name;
-	int rv;
-
-	prog_name = argv[0];
-	verbose = 0;
-
-	if (argc < 5)
-		die("name offset id clients [sleep]\n");
-
-	name = argv[1];
-	offset = atoll(argv[2]);
-	id = atoi(argv[3]);
-	clients = atoi(argv[4]);
-
-	if (argc > 5)
-		sleeptime = atoi(argv[5]);
-
-	printf("Joining \"alternate\" lockspace...\n");
-
-	dh = dlm_create_lockspace("alternate", 0600);
-	if (!dh) {
-		printf("dlm_create_lockspace error %p %d\n",dh, errno);
-		return -ENOTCONN;
-	}
-
-	rv = dlm_ls_pthread_init(dh);
-	if (rv < 0) {
-		printf("dlm_ls_pthread_init error %d %d\n", rv, errno);
-		dlm_release_lockspace("alternate", dh, 1);
-		return rv;
-	}
-
-	memset(&lksb, 0, sizeof(lksb));
-	memset(&lvb, 0, sizeof(lvb));
-	lksb.sb_lvbptr = lvb;
-
-	if (verbose)
-		printf("request NL\n");
-
-	rv = dlm_ls_lock_wait(dh, LKM_NLMODE, &lksb, LKF_VALBLK,
-			      name, strlen(name), 0, NULL, NULL, NULL);
-
-	while (1) {
-		if (verbose)
-			printf("convert NL->PR\n");
-
-		rv = dlm_ls_lock_wait(dh, LKM_PRMODE, &lksb,
-				      LKF_VALBLK | LKF_CONVERT,
-			      	      name, strlen(name),
-				      0, NULL, NULL, NULL);
-		if (rv)
-			printf("lock1 error: %d %d\n", rv, lksb.sb_status);
-
-		memcpy(&num, &lvb, sizeof(num));
-
-		if (verbose)
-			printf("read lvb %llu\n", num);
-
-		/* it's our turn */
-		if (num % clients == id) {
-			if (last_num && last_num + clients != num + 1)
-				die("bad: num %llu last_num %llu\n",
-				    num, last_num);
-
-			if (verbose)
-				printf("convert PR->EX\n");
-
-			rv = dlm_ls_lock_wait(dh, LKM_EXMODE, &lksb,
-				      	      LKF_VALBLK | LKF_CONVERT,
-					      name, strlen(name),
-					      0, NULL, NULL, NULL);
-			if (rv)
-				printf("lock2 error: %d %d\n", rv,
-					lksb.sb_status);
-
-			memcpy(&num, &lvb, sizeof(num));
-			if (num % clients != id)
-				die("bad2: num %llu\n", num);
-
-			num++;
-
-			memcpy(&lvb, &num, sizeof(num));
-			printf("%llu %llu\n", num, skip);
-
-			if (verbose)
-				printf("convert EX->NL\n");
-
-			rv = dlm_ls_lock_wait(dh, LKM_NLMODE, &lksb,
-				      	      LKF_VALBLK | LKF_CONVERT,
-					      name, strlen(name),
-					      0, NULL, NULL, NULL);
-			if (rv)
-				printf("lock3 error: %d %d\n", rv,
-					lksb.sb_status);
-
-			last_num = num;
-			skip = 0;
-		} else {
-			skip++;
-
-			if (verbose)
-				printf("convert PR->NL, skip %llu\n", skip);
-
-			rv = dlm_ls_lock_wait(dh, LKM_NLMODE, &lksb,
-				      	      LKF_VALBLK | LKF_CONVERT,
-					      name, strlen(name),
-					      0, NULL, NULL, NULL);
-			if (rv)
-				printf("lock4 error: %d %d\n", rv,
-					lksb.sb_status);
-		}
-
-		if (sleeptime)
-			usleep(sleeptime);
-	}
-
-	dlm_ls_unlock_wait(dh, lksb.sb_lkid, 0, &lksb);
-	dlm_release_lockspace("alternate", dh, 1);
-
-	exit(EXIT_SUCCESS);
-}
-
diff --git a/dlm/tests/usertest/asttest.c b/dlm/tests/usertest/asttest.c
deleted file mode 100644
index 4b07f6d..0000000
--- a/dlm/tests/usertest/asttest.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/* Test program for userland DLM interface w/ AST */
-/* NOTE: This is not much of a program and it fails in all
-   sorts of ways. But it /does/ illustrate the full dlm_lock
-   call and ASTs. It doesn /not/ show how you should use the
-   FD parts fo the API!
-*/
-
-#include "clusterautoconfig.h"
-
-#ifdef _REENTRANT
-#include <pthread.h>
-#endif
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <sys/poll.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <limits.h>
-#include <unistd.h>
-#include <errno.h>
-#include <getopt.h>
-
-#include "libdlm.h"
-
-static struct dlm_lksb lksb;
-static int use_threads = 0;
-static int quiet = 0;
-
-/* Used by the pthread test */
-static pthread_cond_t  cond;
-static pthread_mutex_t mutex;
-
-/* Used by the poll() test */
-static int ast_called = 0;
-
-static int modetonum(char *modestr)
-{
-    int mode = LKM_EXMODE;
-
-    if (strncasecmp(modestr, "NL", 2) == 0) mode = LKM_NLMODE;
-    if (strncasecmp(modestr, "CR", 2) == 0) mode = LKM_CRMODE;
-    if (strncasecmp(modestr, "CW", 2) == 0) mode = LKM_CWMODE;
-    if (strncasecmp(modestr, "PR", 2) == 0) mode = LKM_PRMODE;
-    if (strncasecmp(modestr, "PW", 2) == 0) mode = LKM_PWMODE;
-    if (strncasecmp(modestr, "EX", 2) == 0) mode = LKM_EXMODE;
-
-    return mode;
-}
-
-static const char *numtomode(int mode)
-{
-    switch (mode)
-    {
-    case LKM_NLMODE: return "NL";
-    case LKM_CRMODE: return "CR";
-    case LKM_CWMODE: return "CW";
-    case LKM_PRMODE: return "PR";
-    case LKM_PWMODE: return "PW";
-    case LKM_EXMODE: return "EX";
-    default: return "??";
-    }
-}
-
-static void usage(char *prog, FILE *file)
-{
-    fprintf(file, "Usage:\n");
-    fprintf(file, "%s [mcnpquhV] <lockname>\n", prog);
-    fprintf(file, "\n");
-    fprintf(file, "   -V         Show version of dlmtest\n");
-    fprintf(file, "   -h         Show this help information\n");
-    fprintf(file, "   -m <mode>  lock mode (default EX)\n");
-    fprintf(file, "   -c <mode>  mode to convert to (default none)\n");
-    fprintf(file, "   -n         don't block\n");
-    fprintf(file, "   -p         Use pthreads\n");
-    fprintf(file, "   -u         Don't unlock\n");
-    fprintf(file, "   -C         Crash after lock\n");
-    fprintf(file, "   -q         Quiet\n");
-    fprintf(file, "   -u         Don't unlock explicitly\n");
-    fprintf(file, "\n");
-
-}
-
-static void ast_routine(void *arg)
-{
-    struct dlm_lksb *alksb = arg;
-
-    if (!quiet)
-	printf("ast called, status = %d, lkid=%x\n", alksb->sb_status, alksb->sb_lkid);
-
-    /* Wake the main thread */
-    if (use_threads)
-    {
-	pthread_mutex_lock(&mutex);
-	pthread_cond_signal(&cond);
-	pthread_mutex_unlock(&mutex);
-    }
-    else
-    {
-	ast_called = 1;
-    }
-}
-
-static void bast_routine(void *arg)
-{
-    struct dlm_lksb *blksb = arg;
-
-    if (!quiet)
-	printf("\nblocking ast called, status = %d, lkid=%x\n", blksb->sb_status, blksb->sb_lkid);
-}
-
-/* Using poll(2) to wait for and dispatch ASTs */
-static int poll_for_ast(void)
-{
-    struct pollfd pfd;
-
-    pfd.fd = dlm_get_fd();
-    pfd.events = POLLIN;
-    while (!ast_called)
-    {
-	if (poll(&pfd, 1, 0) < 0)
-	{
-	    perror("poll");
-	    return -1;
-	}
-	dlm_dispatch(pfd.fd);
-    }
-    ast_called = 0;
-    return 0;
-}
-
-int main(int argc, char *argv[])
-{
-    const char *resource = "LOCK-NAME";
-    int  flags = 0;
-    int  delay = 0;
-    int  status;
-    int  mode = LKM_EXMODE;
-    int  convmode = -1;
-    int  do_unlock = 1;
-    int  do_crash = 0;
-    signed char opt;
-
-    /* Deal with command-line arguments */
-    opterr = 0;
-    optind = 0;
-    while ((opt=getopt(argc,argv,"?m:nqupc:d:CvV")) != EOF)
-    {
-	switch(opt)
-	{
-	case 'h':
-	    usage(argv[0], stdout);
-	    exit(0);
-
-	case '?':
-	    usage(argv[0], stderr);
-	    exit(0);
-
-	case 'm':
-	    mode = modetonum(optarg);
-	    break;
-
-	case 'c':
-	    convmode = modetonum(optarg);
-	    break;
-
-        case 'p':
-            use_threads++;
-            break;
-
-	case 'n':
-	    flags |= LKF_NOQUEUE;
-	    break;
-
-        case 'q':
-            quiet = 1;
-            break;
-
-        case 'u':
-            do_unlock = 0;
-            break;
-
-	case 'C':
-	    do_crash = 1;
-	    break;
-
-	case 'd':
-	    delay = atoi(optarg);	
-	    break;
-
-	case 'V':
-	    printf("\nasttest version 0.1\n\n");
-	    exit(1);
-	    break;
-	}
-    }
-
-    if (argv[optind])
-	resource = argv[optind];
-
-    if (!quiet)
-    fprintf(stderr, "locking %s %s %s...", resource,
-	    numtomode(mode),
-	    (flags&LKF_NOQUEUE?"(NOQUEUE)":""));
-
-    fflush(stderr);
-
-    if (use_threads)
-    {
-	pthread_cond_init(&cond, NULL);
-	pthread_mutex_init(&mutex, NULL);
-	pthread_mutex_lock(&mutex);
-
-	dlm_pthread_init();
-    }
-
-    status = dlm_lock(mode,
-		      &lksb,
-		      flags,
-		      resource,
-		      strlen(resource),
-		      0, // Parent,
-		      ast_routine,
-		      &lksb,
-		      bast_routine,
-		      NULL); // Range
-    if (status == -1)
-    {
-	if (!quiet) fprintf(stderr, "\n");
-	perror("lock");
-
-	return -1;
-    }
-    printf("(lkid=%x)", lksb.sb_lkid);
-
-    if (do_crash)
-	*(int *)0 = 0xdeadbeef;
-
-    /* Wait */
-    if (use_threads)
-	pthread_cond_wait(&cond, &mutex);
-    else
-	poll_for_ast();
-
-    if (delay)
-        sleep(delay);
-
-    if (!quiet)
-    {
-        fprintf(stderr, "unlocking %s...", resource);
-        fflush(stderr);
-    }
-
-    if (do_unlock)
-    {
-	status = dlm_unlock(lksb.sb_lkid,
-			    0, // flags
-			    &lksb,
-			    &lksb); // AST args
-	if (status == -1)
-	{
-	    if (!quiet) fprintf(stderr, "\n");
-	    perror("unlock");
-	    return -1;
-	}
-
-	/* Wait */
-	if (use_threads)
-	    pthread_cond_wait(&cond, &mutex);
-	else
-	    poll_for_ast();
-    }
-
-    return 0;
-}
-
diff --git a/dlm/tests/usertest/dlmtest.c b/dlm/tests/usertest/dlmtest.c
deleted file mode 100644
index 02f8f07..0000000
--- a/dlm/tests/usertest/dlmtest.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/* Test program for userland DLM interface */
-
-#include "clusterautoconfig.h"
-
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <limits.h>
-#include <unistd.h>
-#include <errno.h>
-#include <getopt.h>
-
-#include "libdlm.h"
-
-static int modetonum(char *modestr)
-{
-    int mode = LKM_EXMODE;
-
-    if (strncasecmp(modestr, "NL", 2) == 0) mode = LKM_NLMODE;
-    if (strncasecmp(modestr, "CR", 2) == 0) mode = LKM_CRMODE;
-    if (strncasecmp(modestr, "CW", 2) == 0) mode = LKM_CWMODE;
-    if (strncasecmp(modestr, "PR", 2) == 0) mode = LKM_PRMODE;
-    if (strncasecmp(modestr, "PW", 2) == 0) mode = LKM_PWMODE;
-    if (strncasecmp(modestr, "EX", 2) == 0) mode = LKM_EXMODE;
-
-    return mode;
-}
-
-static const char *numtomode(int mode)
-{
-    switch (mode)
-    {
-    case LKM_NLMODE: return "NL";
-    case LKM_CRMODE: return "CR";
-    case LKM_CWMODE: return "CW";
-    case LKM_PRMODE: return "PR";
-    case LKM_PWMODE: return "PW";
-    case LKM_EXMODE: return "EX";
-    default: return "??";
-    }
-}
-
-static void usage(char *prog, FILE *file)
-{
-    fprintf(file, "Usage:\n");
-    fprintf(file, "%s [hmcnQpequdV] <lockname>\n", prog);
-    fprintf(file, "\n");
-    fprintf(file, "   -V         Show version of dlmtest\n");
-    fprintf(file, "   -h         Show this help information\n");
-    fprintf(file, "   -m <mode>  lock mode (default EX)\n");
-    fprintf(file, "   -c <mode>  mode to convert to (default none)\n");
-    fprintf(file, "   -n         don't block\n");
-    fprintf(file, "   -Q         query the lock\n");
-    fprintf(file, "   -p         Persistent lock\n");
-    fprintf(file, "   -e         Expedite conversion\n");
-    fprintf(file, "   -q         Quiet\n");
-    fprintf(file, "   -u         Don't unlock explicitly\n");
-    fprintf(file, "   -d <secs>  Time to hold the lock for\n");
-    fprintf(file, "\n");
-
-}
-
-#ifdef QUERY
-static void query_ast_routine(void *arg)
-{
-    struct dlm_lksb *lksb = arg;
-    struct dlm_queryinfo *qi = (struct dlm_queryinfo *)lksb->sb_lvbptr;
-    int i;
-
-    qi->gqi_resinfo->rsi_name[qi->gqi_resinfo->rsi_length] = '\0';
-    /* Dump resource info */
-    printf("lockinfo: status     = %d\n", lksb->sb_status);
-    printf("lockinfo: resource   = '%s'\n", qi->gqi_resinfo->rsi_name);
-    printf("lockinfo: grantcount = %d\n", qi->gqi_resinfo->rsi_grantcount);
-    printf("lockinfo: convcount  = %d\n", qi->gqi_resinfo->rsi_convcount);
-    printf("lockinfo: waitcount  = %d\n", qi->gqi_resinfo->rsi_waitcount);
-    printf("lockinfo: masternode = %d\n", qi->gqi_resinfo->rsi_masternode);
-
-    /* Dump all the locks */
-    for (i = 0; i < qi->gqi_lockcount; i++)
-    {
-	struct dlm_lockinfo *li = &qi->gqi_lockinfo[i];
-
-	printf("lockinfo: lock: lkid        = %x\n", li->lki_lkid);
-	printf("lockinfo: lock: master lkid = %x\n", li->lki_mstlkid);
-	printf("lockinfo: lock: parent lkid = %x\n", li->lki_parent);
-	printf("lockinfo: lock: node        = %d\n", li->lki_node);
-	printf("lockinfo: lock: pid         = %d\n", li->lki_ownpid);
-	printf("lockinfo: lock: state       = %d\n", li->lki_state);
-	printf("lockinfo: lock: grmode      = %d\n", li->lki_grmode);
-	printf("lockinfo: lock: rqmode      = %d\n", li->lki_rqmode);
-	printf("\n");
-    }
-
-    if (qi->gqi_lockinfo)
-	free(qi->gqi_lockinfo);
-}
-
-static struct dlm_queryinfo qinfo;
-static struct dlm_resinfo resinfo;
-#define MAX_QUERY_LOCKS 10
-
-
-static int query_lock(int lockid)
-{
-    int status;
-struct dlm_lksb tmplksb;
-    lksb.sb_lkid = lockid;
-    qinfo.gqi_resinfo = &resinfo;
-    qinfo.gqi_lockinfo = malloc(sizeof(struct dlm_lockinfo) * MAX_QUERY_LOCKS);
-    qinfo.gqi_locksize = MAX_QUERY_LOCKS;
-    lksb.sb_lvbptr = (char *)&qinfo;
-
-    status = dlm_query(&tmplksb,
-		       DLM_QUERY_QUEUE_ALL | DLM_QUERY_LOCKS_ALL,
-		       &qinfo,
-		       query_ast_routine,
-		       &tmplksb);
-    if (status)
-	perror("Query failed");
-    else
-	sleep(1); /* Just to allow the result to come back. There isn't
-		     a synchronous version of this call */
-    return status;
-}
-#endif
-
-
-int main(int argc, char *argv[])
-{
-    const char *resource = "LOCK-NAME";
-    int  flags = 0;
-    int  status;
-    int  delay = 5;
-    int  mode = LKM_EXMODE;
-    int  convmode = -1;
-    int  lockid;
-    int  quiet = 0;
-    int  do_unlock = 1;
-    int  do_query = 0;
-    int  do_expedite = 0;
-    signed char opt;
-
-    /* Deal with command-line arguments */
-    opterr = 0;
-    optind = 0;
-    while ((opt=getopt(argc,argv,"?m:nquQepd:c:vV")) != EOF)
-    {
-	switch(opt)
-	{
-	case 'h':
-	    usage(argv[0], stdout);
-	    exit(0);
-
-	case '?':
-	    usage(argv[0], stderr);
-	    exit(0);
-
-	case 'm':
-	    mode = modetonum(optarg);
-	    break;
-
-	case 'c':
-	    convmode = modetonum(optarg);
-	    break;
-
-        case 'e':
-            do_expedite = 1;
-            break;
-
-        case 'p':
-            flags |= LKF_PERSISTENT;
-            break;
-
-	case 'n':
-	    flags |= LKF_NOQUEUE;
-	    break;
-
-	case 'd':
-	    delay = atoi(optarg);
-	    break;
-
-        case 'q':
-            quiet = 1;
-            break;
-
-        case 'u':
-            do_unlock = 0;
-            break;
-
-	case 'Q':
-	    do_query = 1;
-	    break;
-
-	case 'V':
-	    printf("\ndlmtest version 0.3\n\n");
-	    exit(1);
-	    break;
-	}
-    }
-
-    if (argv[optind])
-	resource = argv[optind];
-
-    if (!quiet)
-    fprintf(stderr, "locking %s %s %s...", resource,
-	    numtomode(mode),
-	    (flags&LKF_NOQUEUE?"(NOQUEUE)":""));
-
-    fflush(stderr);
-
-    status = lock_resource(resource, mode, flags, &lockid);
-    if (status == -1)
-    {
-	if (!quiet) fprintf(stderr, "\n");
-	perror("lock");
-
-	return -1;
-    }
-    if (lockid == 0)
-    {
-	fprintf(stderr, "error: got lockid of zero\n");
-	return 0;
-    }
-
-    if (!quiet) fprintf(stderr, "done (lkid = %x)\n", lockid);
-
-    if (!do_unlock) return 0;
-
-#ifdef QUERY
-    if (do_query) query_lock(lockid);
-#endif
-
-    sleep(delay);
-
-    if (convmode != -1)
-    {
-        if (do_expedite)
-		flags |= LKF_EXPEDITE;
-
-	if (!quiet)
-	{
-	    fprintf(stderr, "converting %s to %s...", resource, numtomode(convmode));
-	    fflush(stderr);
-	}
-
-	status = lock_resource(resource, convmode, flags | LKF_CONVERT, &lockid);
-	if (status == -1)
-	{
-	    if (!quiet) fprintf(stderr, "\n");
-	    perror("convert");
-	    return -1;
-	}
-	if (!quiet) fprintf(stderr, "done\n");
-    }
-
-    sleep(delay);
-
-    if (!quiet)
-    {
-        fprintf(stderr, "unlocking %s...", resource);
-        fflush(stderr);
-    }
-
-    status = unlock_resource(lockid);
-    if (status == -1)
-    {
-	if (!quiet) fprintf(stderr, "\n");
-	perror("unlock");
-	return -1;
-    }
-
-    if (!quiet) fprintf(stderr, "done\n");
-
-    /* For some reason, calling this IMMEDIATELY before
-       exitting, causes a thread hang. either don't call it at
-       all or do something in afterwards before calling exit
-    */
-    dlm_pthread_cleanup();
-    return 0;
-}
-
diff --git a/dlm/tests/usertest/dlmtest2.c b/dlm/tests/usertest/dlmtest2.c
deleted file mode 100644
index 9d3afd9..0000000
--- a/dlm/tests/usertest/dlmtest2.c
+++ /dev/null
@@ -1,1469 +0,0 @@
-#include "clusterautoconfig.h"
-
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <stddef.h>
-#include <string.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <time.h>
-#include <signal.h>
-#include <syslog.h>
-#include <sys/time.h>
-#include <asm/types.h>
-#include <sys/socket.h>
-#include <sys/poll.h>
-#include <sys/un.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/errno.h>
-
-#include "libdlm.h"
-
-#define MAX_CLIENTS 4
-#define MAX_LOCKS 16
-#define MAX_RESOURCES 16
-
-static dlm_lshandle_t *dh;
-static int libdlm_fd;
-static int timewarn = 0;
-static uint64_t timeout = 0;
-static int noqueue = 1;
-static int persistent = 0;
-static int ignore_bast = 0;
-static int quiet = 1;
-static int verbose = 0;
-static int bast_cb;
-static int maxn = MAX_LOCKS;
-static int maxr = MAX_RESOURCES;
-static int iterations;
-static int minhold = 0;
-static int stress_stop = 0;
-static int stress_delay = 0;
-static int stress_lock_only = 0;
-static int openclose_ls = 0;
-static uint64_t our_xid;
-static char cmd[32];
-static int opt_cmd = 0;
-
-static unsigned int sts_eunlock, sts_ecancel, sts_etimedout, sts_edeadlk, sts_eagain, sts_other, sts_zero;
-static unsigned int bast_unlock, bast_skip;
-
-
-#define log_print(fmt, args...) \
-do { \
-	if (!quiet) \
-		printf(fmt , ##args); \
-} while (0)
-
-#define log_op(fmt, args...) \
-do { \
-	if (!quiet) \
-		printf(fmt , ##args); \
-} while (0)
-
-#define log_ast(fmt, args...) \
-do { \
-	if (verbose) \
-		printf(fmt , ##args); \
-} while (0)
-
-#define log_bast(fmt, args...) \
-do { \
-	if (verbose > 1) \
-		printf(fmt , ##args); \
-} while (0)
-
-#define log_verbose(fmt, args...) \
-do { \
-	if (verbose > 2) \
-		printf(fmt , ##args); \
-} while (0)
-
-struct client {
-	int fd;
-	char type[32];
-};
-
-static int client_size = MAX_CLIENTS;
-static struct client client[MAX_CLIENTS];
-static struct pollfd pollfd[MAX_CLIENTS];
-
-enum {
-	Op_lock = 1,
-	Op_unlock,
-	Op_unlockf,
-	Op_cancel,
-};
-
-struct lk {
-	int id;
-	int rqmode;
-	int grmode;
-	int wait_ast;
-	int lastop;
-	int last_status;
-	int bast;
-	int minhold;
-	struct dlm_lksb lksb;
-	struct timeval begin;
-	struct timeval acquired;
-};
-
-struct lk *locks;
-
-static void unlock(int i);
-static void unlockf(int i);
-
-
-static int rand_int(int a, int b)
-{
-	return a + (int) (((float)(b - a + 1)) * random() / (RAND_MAX+1.0));
-}
-
-static const char *status_str(int status)
-{
-	static char sts_str[8];
-
-	switch (status) {
-	case 0:
-		return "0      ";
-	case EUNLOCK:
-		return "EUNLOCK";
-	case ECANCEL:
-		return "ECANCEL";
-	case EAGAIN:
-		return "EAGAIN ";
-	case EBUSY:
-		return "EBUSY  ";
-	case ETIMEDOUT:
-		return "ETIMEDO";
-	case EDEADLK:
-		return "EDEADLK";
-	default:
-		snprintf(sts_str, 8, "%8x", status);
-		return sts_str;
-	}
-}
-
-static const char *op_str(int op)
-{
-	switch (op) {
-	case Op_lock:
-		return "lock";
-	case Op_unlock:
-		return "unlock";
-	case Op_unlockf:
-		return "unlockf";
-	case Op_cancel:
-		return "cancel";
-	default:
-		return "unknown";
-	}
-}
-
-static struct lk *get_lock(int i)
-{
-	if (i < 0)
-		return NULL;
-	if (i >= maxn)
-		return NULL;
-	return &locks[i];
-}
-
-static int all_unlocks_done(void)
-{
-	struct lk *lk;
-	int i;
-
-	for (i = 0; i < maxn; i++) {
-		lk = get_lock(i);
-		if (lk->grmode == -1 && !lk->wait_ast)
-			continue;
-		return 0;
-	}
-	return 1;
-}
-
-static void dump(void)
-{
-	struct timeval now;
-	struct lk *lk;
-	int i;
-
-	gettimeofday(&now, NULL);
-
-	for (i = 0; i < maxn; i++) {
-		lk = get_lock(i);
-		printf("x %2d lkid %08x gr %2d rq %2d wait_ast %d last op %s  \t%s  %us\n",
-			i,
-			lk->lksb.sb_lkid,
-			lk->grmode,
-			lk->rqmode,
-			lk->wait_ast,
-			op_str(lk->lastop),
-			status_str(lk->last_status),
-			lk->wait_ast ? (unsigned int)(now.tv_sec - lk->begin.tv_sec) : 0);
-	}
-}
-
-static void bastfn(void *arg)
-{
-	struct lk *lk = arg;
-	lk->bast = 1;
-	bast_cb = 1;
-}
-
-static void do_bast(struct lk *lk)
-{
-	int skip = 0;
-
-	if (lk->lastop == Op_unlock || lk->lastop == Op_unlockf) {
-		skip = 1;
-	}
-	if (!lk->lksb.sb_lkid) {
-		skip = 1;
-	}
-
-	if (skip) {
-		bast_skip++;
-		log_bast("    bast: skip    %3d\t%x\n", lk->id, lk->lksb.sb_lkid);
-	} else {
-		bast_unlock++;
-		log_bast("    bast: unlockf %3d\t%x\n", lk->id, lk->lksb.sb_lkid);
-		unlockf(lk->id);
-	}
-	lk->bast = 0;
-}
-
-static void do_bast_unlocks(void)
-{
-	struct lk *lk;
-	int i;
-
-	for (i = 0; i < maxn; i++) {
-		lk = get_lock(i);
-		if (lk->bast)
-			do_bast(lk);
-	}
-	bast_cb = 0;
-}
-
-static void process_libdlm(void)
-{
-	dlm_dispatch(libdlm_fd);
-	if (bast_cb && !ignore_bast)
-		do_bast_unlocks();
-}
-
-static void astfn(void *arg)
-{
-	struct lk *lk = arg;
-	int i = lk->id;
-
-	if (!lk->wait_ast) {
-		printf("     ast: %s %3d\t%x: !wait_ast gr %d rq %d last op %s %s\n",
-		       status_str(lk->lksb.sb_status), i, lk->lksb.sb_lkid,
-		       lk->grmode, lk->rqmode,
-		       op_str(lk->lastop), status_str(lk->last_status));
-	}
-
-	log_ast("     ast: %s %3d\t%x\n",
-		status_str(lk->lksb.sb_status), i, lk->lksb.sb_lkid);
-
-	lk->last_status = lk->lksb.sb_status;
-
-	if (lk->lksb.sb_status == EUNLOCK) {
-		sts_eunlock++;
-		memset(&lk->lksb, 0, sizeof(struct dlm_lksb));
-		lk->grmode = -1;
-		lk->wait_ast = 0;
-
-	} else if (lk->lksb.sb_status == ECANCEL) {
-		sts_ecancel++;
-		if (lk->grmode == -1) {
-			memset(&lk->lksb, 0, sizeof(struct dlm_lksb));
-			lk->wait_ast = 0;
-		} else {
-			if (lk->lastop != Op_unlock && lk->lastop != Op_unlockf)
-				lk->wait_ast = 0;
-		}
-
-	} else if (lk->lksb.sb_status == ETIMEDOUT) {
-		sts_etimedout++;
-		if (lk->grmode == -1) {
-			memset(&lk->lksb, 0, sizeof(struct dlm_lksb));
-			lk->wait_ast = 0;
-		} else {
-			if (lk->lastop != Op_unlock && lk->lastop != Op_unlockf)
-				lk->wait_ast = 0;
-		}
-
-	} else if (lk->lksb.sb_status == EDEADLK) {
-		sts_edeadlk++;
-		if (lk->grmode == -1) {
-			memset(&lk->lksb, 0, sizeof(struct dlm_lksb));
-			lk->wait_ast = 0;
-		} else {
-			if (lk->lastop != Op_unlock && lk->lastop != Op_unlockf)
-				lk->wait_ast = 0;
-		}
-
-	} else if (lk->lksb.sb_status == EAGAIN) {
-		sts_eagain++;
-		if (lk->grmode == -1) {
-			memset(&lk->lksb, 0, sizeof(struct dlm_lksb));
-			lk->wait_ast = 0;
-		} else {
-			if (lk->lastop != Op_unlockf)
-				lk->wait_ast = 0;
-		}
-
-	} else {
-		if (lk->lksb.sb_status != 0) {
-			sts_other++;
-			printf("BAD  ast: %d %3d\t%x: gr %d rq %d last op %s %s\n",
-		       		lk->lksb.sb_status, i, lk->lksb.sb_lkid,
-				lk->grmode, lk->rqmode, op_str(lk->lastop),
-				status_str(lk->last_status));
-			stress_stop = 1;
-			return;
-		}
-
-		sts_zero++;
-
-		if (lk->lastop != Op_unlockf)
-			lk->wait_ast = 0;
-
-		lk->grmode = lk->rqmode;
-
-		if (minhold) {
-			gettimeofday(&lk->acquired, NULL);
-			lk->minhold = minhold;
-		}
-	}
-
-	lk->rqmode = -1;
-}
-
-/* EBUSY from dlm_ls_lockx() is expected sometimes, e.g. lock, cancel, lock;
-   the first lock is successful and the app gets the status back,
-   and issues the second lock before the reply for the overlapping
-   cancel (which did nothing) has been received in the dlm. */
-
-static void lock(int i, int mode)
-{
-	char name[DLM_RESNAME_MAXLEN];
-	struct lk *lk;
-	int flags = 0;
-	int rv;
-	uint64_t *timeout_arg = NULL;
-
-	lk = get_lock(i);
-	if (!lk)
-		return;
-
-	if (noqueue)
-		flags |= LKF_NOQUEUE;
-	if (persistent)
-		flags |= LKF_PERSISTENT;
-	if (timeout) {
-		flags |= LKF_TIMEOUT;
-		timeout_arg = &timeout;
-	}
-
-	if (lk->lksb.sb_lkid)
-		flags |= LKF_CONVERT;
-
-	memset(name, 0, sizeof(name));
-	snprintf(name, sizeof(name), "test%d", (i % maxr));
-
-	log_verbose("lock: %d grmode %d rqmode %d flags %x lkid %x %s\n",
-	            i, lk->grmode, mode, flags, lk->lksb.sb_lkid, name);
-
-#if 0
-	rv = dlm_ls_lock(dh, mode, &lk->lksb, flags, name, strlen(name), 0,
-			  astfn, (void *) lk, bastfn, NULL);
-#else
-	rv = dlm_ls_lockx(dh, mode, &lk->lksb, flags, name, strlen(name), 0,
-			  astfn, (void *) lk, bastfn, &our_xid, timeout_arg);
-#endif
-	if (!rv) {
-		lk->wait_ast = 1;
-		lk->rqmode = mode;
-		gettimeofday(&lk->begin, NULL);
-	} else if (rv == -1 && errno == EBUSY) {
-		printf("        : lock    %3d\t%x: EBUSY gr %d rq %d wait_ast %d\n",
-			i, lk->lksb.sb_lkid, lk->grmode, lk->rqmode, lk->wait_ast);
-	} else {
-		printf("        : lock    %3d\t%x: errno %d rv %d gr %d rq %d wait_ast %d\n",
-			i, lk->lksb.sb_lkid, errno, rv, lk->grmode, lk->rqmode, lk->wait_ast);
-		stress_stop = 1;
-	}
-
-	log_verbose("lock: %d rv %d sb_lkid %x sb_status %x\n",
-	            i, rv, lk->lksb.sb_lkid, lk->lksb.sb_status);
-
-	lk->lastop = Op_lock;
-}
-
-static void lock_sync(int i, int mode)
-{
-	char name[DLM_RESNAME_MAXLEN];
-	int flags = 0;
-	int rv;
-	struct lk *lk;
-
-	lk = get_lock(i);
-	if (!lk)
-		return;
-
-	if (noqueue)
-		flags |= LKF_NOQUEUE;
-	if (persistent)
-		flags |= LKF_PERSISTENT;
-
-	if (lk->lksb.sb_lkid)
-		flags |= LKF_CONVERT;
-
-	memset(name, 0, sizeof(name));
-	snprintf(name, sizeof(name), "test%d", (i % maxr));
-
-	log_verbose("lock_sync: %d rqmode %d flags %x lkid %x %s\n",
-	            i, mode, flags, lk->lksb.sb_lkid, name);
-
-	rv = dlm_ls_lock_wait(dh, mode, &lk->lksb, flags,
-			 name, strlen(name), 0, (void *) lk,
-			 bastfn, NULL);
-
-	log_verbose("lock_sync: %d rv %d sb_lkid %x sb_status %x\n",
-	            i, rv, lk->lksb.sb_lkid, lk->lksb.sb_status);
-
-	if (!rv) {
-		lk->grmode = mode;
-		lk->rqmode = -1;
-	} else if (rv == EAGAIN) {
-		if (lk->grmode == -1)
-			memset(&lk->lksb, 0, sizeof(struct dlm_lksb));
-	} else {
-		printf("unknown rv %d\n", rv);
-		exit(-1);
-	}
-}
-
-static void lock_all(int mode)
-{
-	int i;
-
-	for (i = 0; i < maxn; i++)
-		lock(i, mode);
-}
-
-static const char *uflags(uint32_t flags)
-{
-	if (flags == LKF_FORCEUNLOCK)
-		return "FORCEUNLOCK";
-	if (flags == LKF_CANCEL)
-		return "CANCEL";
-	return "0";
-}
-
-/* ENOENT is expected from dlm_ls_unlock() sometimes because we'll
-   try to do an unlockf during an outstanding op that will free
-   the lock itself */
-
-static void _unlock(int i, uint32_t flags)
-{
-	struct lk *lk;
-	uint32_t lkid;
-	int rv;
-
-	lk = get_lock(i);
-	if (!lk)
-		return;
-
-	lkid = lk->lksb.sb_lkid;
-	if (!lkid)
-		return;
-
-	log_verbose("unlock: %d lkid %x flags %x\n", i, lkid, flags);
-
-	rv = dlm_ls_unlock(dh, lkid, flags, &lk->lksb, lk);
-	if (!rv) {
-		lk->wait_ast = 1;
-		gettimeofday(&lk->begin, NULL);
-	} else if (rv == -1 && errno == EBUSY) {
-		printf("        : unlock  %3d\t%x: EBUSY flags %s gr %d rq %d wait_ast %d\n",
-			i, lk->lksb.sb_lkid, uflags(flags), lk->grmode, lk->rqmode, lk->wait_ast);
-	} else if (rv == -1 && errno == ENOENT) {
-		printf("        : unlock  %3d\t%x: ENOENT flags %s gr %d rq %d wait_ast %d\n",
-			i, lk->lksb.sb_lkid, uflags(flags), lk->grmode, lk->rqmode, lk->wait_ast);
-	} else {
-		printf("        : unlock  %3d\t%x: errno %d flags %s rv %d gr %d rq %d wait_ast %d\n",
-			i, lk->lksb.sb_lkid, errno, uflags(flags), rv, lk->grmode, lk->rqmode, lk->wait_ast);
-	}
-}
-
-static void unlock(int i)
-{
-	struct lk *lk = get_lock(i);
-
-	if (minhold) {
-		struct timeval now;
-
-		if (lk->wait_ast)
-			return;
-
-		gettimeofday(&now, NULL);
-		if (lk->acquired.tv_sec + lk->minhold > now.tv_sec) {
-			printf("        : unlock  %3d\t%x: gr %d rq %d held %u of %u s\n",
-				i, lk->lksb.sb_lkid, lk->grmode, lk->rqmode,
-				(unsigned int)(now.tv_sec - lk->acquired.tv_sec), lk->minhold);
-			return;
-		}
-	}
-
-	_unlock(i, 0);
-	lk->rqmode = -1;
-	lk->lastop = Op_unlock;
-}
-
-static void unlockf(int i)
-{
-	struct lk *lk = get_lock(i);
-
-	if (minhold) {
-		struct timeval now;
-
-		if (lk->wait_ast)
-			return;
-
-		gettimeofday(&now, NULL);
-		if (lk->acquired.tv_sec + lk->minhold > now.tv_sec) {
-			printf("        : unlockf %3d\t%x: gr %d rq %d held %u of %u s\n",
-				i, lk->lksb.sb_lkid, lk->grmode, lk->rqmode,
-				(unsigned int)(now.tv_sec - lk->acquired.tv_sec), lk->minhold);
-			return;
-		}
-	}
-
-	_unlock(i, LKF_FORCEUNLOCK);
-	lk->rqmode = -1;
-	lk->lastop = Op_unlockf;
-}
-
-static void cancel(int i)
-{
-	struct lk *lk = get_lock(i);
-	_unlock(i, LKF_CANCEL);
-	lk->lastop = Op_cancel;
-}
-
-static void canceld(int i, uint32_t lkid)
-{
-	int rv;
-
-	rv = dlm_ls_deadlock_cancel(dh, lkid, 0);
-
-	printf("canceld %x: %d %d\n", lkid, rv, errno);
-}
-
-static void unlock_sync(int i)
-{
-	uint32_t lkid;
-	int rv;
-	struct lk *lk;
-
-	lk = get_lock(i);
-	if (!lk)
-		return;
-
-	lkid = lk->lksb.sb_lkid;
-	if (!lkid) {
-		log_print("unlock %d skip zero lkid\n", i);
-		return;
-	}
-
-	log_verbose("unlock_sync: %d lkid %x\n", i, lkid);
-
-	rv = dlm_ls_unlock_wait(dh, lkid, 0, &lk->lksb);
-
-	log_verbose("unlock_sync: %d rv %d sb_status %x\n", i, rv,
-	            lk->lksb.sb_status);
-
-	memset(&lk->lksb, 0, sizeof(struct dlm_lksb));
-	lk->grmode = -1;
-	lk->rqmode = -1;
-}
-
-static void unlock_all(void)
-{
-	struct lk *lk;
-	int i;
-
-	for (i = 0; i < maxn; i++) {
-		lk = get_lock(i);
-		unlock(i);
-	}
-}
-
-static void purge(int nodeid, int pid)
-{
-	struct lk *lk;
-	int i, rv;
-
-	rv = dlm_ls_purge(dh, nodeid, pid);
-	if (rv) {
-		printf("dlm_ls_purge %d %d error %d\n", nodeid, pid, rv);
-		return;
-	}
-
-	for (i = 0; i < maxn; i++) {
-		lk = get_lock(i);
-		memset(&lk->lksb, 0, sizeof(struct dlm_lksb));
-		lk->grmode = -1;
-		lk->wait_ast = 0;
-	}
-}
-
-static void purgetest(int nodeid, int pid)
-{
-	struct lk *lk;
-	int i, mid = maxn / 2;
-
-	printf("lock %d to %d\n", 0, mid-1);
-	for (i = 0; i < mid; i++)
-		lock(i, 3);
-
-	while (1) {
-		process_libdlm();
-		for (i = 0; i < mid; i++) {
-			lk = get_lock(i);
-			if (!lk->wait_ast)
-				continue;
-			break;
-		}
-		if (i == mid)
-			break;
-	}
-
-	for (i = mid; i < maxn; i++)
-		lock(i, 3);
-	for (i = 0; i < mid; i++)
-		unlock(i);
-	/* usleep(10000); */
-	purge(nodeid, pid);
-}
-
-static void tstress_unlocks(void)
-{
-	struct lk *lk;
-	struct timeval now;
-	int i;
-
-	for (i = 0; i < maxn; i++) {
-		lk = get_lock(i);
-		if (!lk)
-			continue;
-		if (lk->wait_ast)
-			continue;
-		if (lk->grmode < 0)
-			continue;
-
-		/* if we've held the lock for minhold seconds, then unlock */
-
-		gettimeofday(&now, NULL);
-
-		if (now.tv_sec >= lk->acquired.tv_sec + minhold) {
-			printf("        : unlock  %3d\t%x: gr %d rq %d held %u of %u s\n",
-				i, lk->lksb.sb_lkid, lk->grmode, lk->rqmode,
-				(unsigned int)(now.tv_sec - lk->acquired.tv_sec), minhold);
-
-			_unlock(i, 0);
-			lk->rqmode = -1;
-			lk->lastop = Op_unlock;
-		}
-
-	}
-}
-
-static void tstress(int num)
-{
-	unsigned int n, skips, lock_ops, unlock_ops, unlockf_ops, cancel_ops;
-	int i;
-	struct lk *lk;
-
-	n = skips = lock_ops = unlock_ops = unlockf_ops = cancel_ops = 0;
-	sts_eunlock = sts_ecancel = sts_etimedout = sts_edeadlk = sts_eagain = sts_other = sts_zero = 0;
-	bast_unlock = bast_skip = 0;
-
-	noqueue = 0;
-	ignore_bast = 1;
-	quiet = 0;
-
-	if (!timeout)
-		timeout = 4;
-	if (!minhold)
-		minhold = 5;
-
-	while (!stress_stop) {
-		if (stress_delay)
-			usleep(stress_delay);
-
-		process_libdlm();
-
-		tstress_unlocks();
-
-		if (++n == num) {
-			if (all_unlocks_done())
-				break;
-			else
-				continue;
-		}
-
-		i = rand_int(0, maxn-1);
-		lk = get_lock(i);
-		if (!lk)
-			continue;
-
-		if (lk->wait_ast || lk->grmode > -1)
-			continue;
-
-		lock(i, rand_int(0, 5));
-		lock_ops++;
-		printf("%8x: lock    %3d\t%x\n", n, i, lk->lksb.sb_lkid);
-	}
-
-	printf("ops: skip %d lock %d unlock %d unlockf %d cancel %d\n",
-		skips, lock_ops, unlock_ops, unlockf_ops, cancel_ops);
-	printf("bast: unlock %u skip %u\n", bast_unlock, bast_skip);
-	printf("ast status: eunlock %d ecancel %d etimedout %d edeadlk %d eagain %d\n",
-		sts_eunlock, sts_ecancel, sts_etimedout, sts_edeadlk, sts_eagain);
-	printf("ast status: zero %d other %d\n", sts_zero, sts_other);
-}
-
-static void dstress(int num)
-{
-	unsigned int n, skips, lock_ops, unlock_ops, unlockf_ops, cancel_ops;
-	int i;
-	struct lk *lk;
-
-	n = skips = lock_ops = unlock_ops = unlockf_ops = cancel_ops = 0;
-	sts_eunlock = sts_ecancel = sts_etimedout = sts_edeadlk = sts_eagain = sts_other = sts_zero = 0;
-	bast_unlock = bast_skip = 0;
-
-	noqueue = 0;
-	ignore_bast = 1;
-	quiet = 0;
-
-	while (!stress_stop && n < num) {
-
-		sleep(1);
-
-		process_libdlm();
-
-		if (n && !(n % 60))
-			unlock_all();
-		n++;
-
-		i = rand_int(0, maxn-1);
-		lk = get_lock(i);
-		if (!lk)
-			continue;
-
-		if (lk->wait_ast || lk->grmode > -1) {
-			printf("%8x: lock    %3d\t%x: skip gr %d wait_ast %d\n",
-				n, i, lk->lksb.sb_lkid, lk->grmode, lk->wait_ast);
-			continue;
-		}
-
-		lock(i, rand_int(0, 5));
-		lock_ops++;
-		printf("%8x: lock    %3d\t%x\n", n, i, lk->lksb.sb_lkid);
-	}
-
-	printf("ops: skip %d lock %d unlock %d unlockf %d cancel %d\n",
-		skips, lock_ops, unlock_ops, unlockf_ops, cancel_ops);
-	printf("bast: unlock %u skip %u\n", bast_unlock, bast_skip);
-	printf("ast status: eunlock %d ecancel %d etimedout %d edeadlk %d eagain %d\n",
-		sts_eunlock, sts_ecancel, sts_etimedout, sts_edeadlk, sts_eagain);
-	printf("ast status: zero %d other %d\n", sts_zero, sts_other);
-}
-
-static void stress(int num)
-{
-	int i, o, op, max_op, skip;
-	unsigned int n, skips, lock_ops, unlock_ops, unlockf_ops, cancel_ops;
-	struct lk *lk;
-
-	n = skips = lock_ops = unlock_ops = unlockf_ops = cancel_ops = 0;
-	sts_eunlock = sts_ecancel = sts_etimedout = sts_edeadlk = sts_eagain = sts_other = sts_zero = 0;
-	bast_unlock = bast_skip = 0;
-
-	while (!stress_stop) {
-		if (stress_delay)
-			usleep(stress_delay);
-
-		process_libdlm();
-
-		if (++n == num)
-			break;
-
-		i = rand_int(0, maxn-1);
-		lk = get_lock(i);
-		if (!lk)
-			continue;
-
-		max_op = 5;
-		if (stress_lock_only)
-			max_op = 2;
-
-		o = rand_int(0, max_op);
-		switch (o) {
-		case 0:
-		case 1:
-		case 2:
-			op = Op_lock;
-			break;
-		case 3:
-			op = Op_unlock;
-			break;
-		case 4:
-			op = Op_unlockf;
-			break;
-		case 5:
-			op = Op_cancel;
-			break;
-		default:
-			op = 0;
-		}
-
-		skip = 0;
-
-		switch (op) {
-		case Op_lock:
-			if (lk->wait_ast) {
-				skip = 1;
-				break;
-			}
-
-			noqueue = !!o;
-			our_xid = n;
-
-			lock(i, rand_int(0, 5));
-			lock_ops++;
-			log_op("%8x: lock    %3d\t%x\n", n, i, lk->lksb.sb_lkid);
-			break;
-
-		case Op_unlock:
-			if (lk->wait_ast) {
-				skip = 1;
-				break;
-			}
-			if (lk->lastop == Op_unlock || lk->lastop == Op_unlockf) {
-				skip = 1;
-				break;
-			}
-			if (!lk->lksb.sb_lkid) {
-				skip = 1;
-				break;
-			}
-
-			unlock(i);
-			unlock_ops++;
-			log_op("%8x: unlock  %3d\t%x\n", n, i, lk->lksb.sb_lkid);
-			break;
-
-		case Op_unlockf:
-			if (lk->lastop == Op_unlock || lk->lastop == Op_unlockf) {
-				skip = 1;
-				break;
-			}
-			if (!lk->lksb.sb_lkid) {
-				skip = 1;
-				break;
-			}
-
-			unlockf(i);
-			unlockf_ops++;
-			log_op("%8x: unlockf %3d\t%x\n", n, i, lk->lksb.sb_lkid);
-			break;
-
-		case Op_cancel:
-			if (!lk->wait_ast) {
-				skip = 1;
-				break;
-			}
-			if (lk->lastop > Op_lock) {
-				skip = 1;
-				break;
-			}
-
-			cancel(i);
-			cancel_ops++;
-			log_op("%8x: cancel  %3d\t%x\n", n, i, lk->lksb.sb_lkid);
-			break;
-		}
-
-		if (skip)
-			skips++;
-	}
-
-	printf("ops: skip %d lock %d unlock %d unlockf %d cancel %d\n",
-		skips, lock_ops, unlock_ops, unlockf_ops, cancel_ops);
-	printf("bast: unlock %u skip %u\n", bast_unlock, bast_skip);
-	printf("ast status: eunlock %d ecancel %d etimedout %d edeadlk %d eagain %d\n",
-		sts_eunlock, sts_ecancel, sts_etimedout, sts_edeadlk, sts_eagain);
-	printf("ast status: zero %d other %d\n", sts_zero, sts_other);
-}
-
-static int client_add(int fd, int *maxi)
-{
-	int i;
-
-	for (i = 0; i < client_size; i++) {
-		if (client[i].fd == -1) {
-			client[i].fd = fd;
-			pollfd[i].fd = fd;
-			pollfd[i].events = POLLIN;
-			if (i > *maxi)
-				*maxi = i;
-			printf("client %d fd %d added\n", i, fd);
-			return i;
-		}
-	}
-	printf("client add failed\n");
-	return -1;
-}
-
-static void client_dead(int ci)
-{
-	printf("client %d fd %d dead\n", ci, client[ci].fd);
-	close(client[ci].fd);
-	client[ci].fd = -1;
-	pollfd[ci].fd = -1;
-}
-
-static void client_init(void)
-{
-	int i;
-
-	for (i = 0; i < client_size; i++)
-		client[i].fd = -1;
-}
-
-static void print_commands(void)
-{
-	printf("Usage:\n");
-	printf("max locks (maxn) is %d (x of 0 to %d)\n", maxn, maxn-1);
-	printf("max resources (maxr) is %d, lock x used on resource (x %% maxr)\n", maxr);
-	printf("EXIT		 - exit program after unlocking any held locks\n");
-	printf("kill		 - exit program without unlocking any locks\n");
-	printf("lock x mode	 - request/convert lock x\n");
-	printf("unlock x 	 - unlock lock x\n");
-	printf("unlockf x 	 - force unlock lock x\n");
-	printf("cancel x 	 - cancel lock x\n");
-	printf("canceld x lkid	 - cancel lock x, return EDEADLK as status\n");
-	printf("lock_sync x mode - synchronous version of lock\n");
-	printf("unlock_sync x 	 - synchronous version of unlock\n");
-	printf("ex x		 - equivalent to: lock x 5\n");
-	printf("pr x		 - equivalent to: lock x 3\n");
-	printf("hold		 - for x in 0 to max, lock x 3\n");
-	printf("release		 - for x in 0 to max, unlock x\n");
-	printf("purge nodeid pid - purge orphan locks of process\n");
-	printf("stress n	 - loop doing random lock/unlock/unlockf/cancel on all locks, n times\n");
-	printf("tstress n	 - stress timeouts\n");
-	printf("dstress n	 - stress deadlock\n");
-	printf("timeout n	 - enable lock timeouts, set timeout to n seconds\n");
-	printf("dump		 - show info for all locks\n");
-	printf("minhold		 - set minimum number of seconds locks will be held\n");
-	printf("ignore_bast	 - ignore all basts\n");
-	printf("noqueue		 - toggle NOQUEUE flag for all requests\n");
-	printf("persistent	 - toggle PERSISTENT flag for all requests\n");
-	printf("quiet		 - toggle quiet flag\n");
-	printf("verbose		 - toggle verbose flag\n");
-	printf("settings	 - show settings\n");
-
-	printf("\ncombined operations\n");
-	printf("hold-kill                     - hold; kill\n");
-	printf("release-kill                  - release; kill\n");
-	printf("lock-kill x mode              - lock; kill\n");
-	printf("unlock-kill x                 - unlock; kill\n");
-	printf("lock-cancel x mode msec       - lock; sleep; cancel\n");
-	printf("lock-unlockf x mode msec      - lock; sleep; unlockf\n");
-	printf("lock-cancel-kill x mode msec  - lock; sleep; cancel; kill\n");
-	printf("lock-unlockf-kill x mode msec - lock; sleep; unlockf; kill\n");
-	printf("purgetest nodeid pid\n");
-}
-
-static void print_settings(void)
-{
-	printf("timewarn %d\n", timewarn);
-	printf("timeout %llu\n", (unsigned long long) timeout);
-	printf("noqueue %d\n", noqueue);
-	printf("persistent %d\n", persistent);
-	printf("ignore_bast %d\n", ignore_bast);
-	printf("quiet %d\n", quiet);
-	printf("verbose %d\n", verbose);
-	printf("maxn %d\n", maxn);
-	printf("maxr %d\n", maxr);
-	printf("iterations %d\n", iterations);
-	printf("minhold %d\n", minhold);
-	printf("stress_stop %d\n", stress_stop);
-	printf("stress_delay %d\n", stress_delay);
-	printf("stress_lock_only %d\n", stress_lock_only);
-	printf("our_xid %llx\n", (unsigned long long)our_xid);
-}
-
-static void process_command(int *quit)
-{
-	char inbuf[132];
-	int x = 0, y = 0;
-
-	if (!opt_cmd) {
-		fgets(inbuf, sizeof(inbuf), stdin);
-		sscanf(inbuf, "%s %d %d", cmd, &x, &y);
-	}
-
-	if (!strncmp(cmd, "EXIT", 4)) {
-		*quit = 1;
-		unlock_all();
-		return;
-	}
-
-	if (!strncmp(cmd, "CLOSE", 5)) {
-		*quit = 1;
-		openclose_ls = 1;
-		unlock_all();
-		return;
-	}
-
-	if (!strncmp(cmd, "kill", 4)) {
-		printf("process exiting\n");
-		exit(0);
-	}
-
-	if (!strncmp(cmd, "lock", 4) && strlen(cmd) == 4) {
-		lock(x, y);
-		return;
-	}
-
-	if (!strncmp(cmd, "unlock", 6) && strlen(cmd) == 6) {
-		unlock(x);
-		return;
-	}
-
-	if (!strncmp(cmd, "unlockf", 7) && strlen(cmd) == 7) {
-		unlockf(x);
-		return;
-	}
-
-	if (!strncmp(cmd, "cancel", 6) && strlen(cmd) == 6) {
-		cancel(x);
-		return;
-	}
-
-	if (!strncmp(cmd, "canceld", 7) && strlen(cmd) == 7) {
-		canceld(x, y);
-		return;
-	}
-
-	if (!strncmp(cmd, "lock_sync", 9) && strlen(cmd) == 9) {
-		lock_sync(x, y);
-		return;
-	}
-
-	if (!strncmp(cmd, "unlock_sync", 11) && strlen(cmd) == 11) {
-		unlock_sync(x);
-		return;
-	}
-
-	if (!strncmp(cmd, "lock-kill", 9) && strlen(cmd) == 9) {
-		lock(x, y);
-		printf("process exiting\n");
-		exit(0);
-	}
-
-	if (!strncmp(cmd, "unlock-kill", 11) && strlen(cmd) == 11) {
-		unlock(x);
-		printf("process exiting\n");
-		exit(0);
-	}
-
-	if (!strncmp(cmd, "lock-cancel", 11) && strlen(cmd) == 11) {
-		lock(x, y);
-		/* usleep(1000 * z); */
-		cancel(x);
-		return;
-	}
-
-	if (!strncmp(cmd, "lock-unlockf", 12) && strlen(cmd) == 12) {
-		lock(x, y);
-		/* usleep(1000 * z); */
-		unlockf(x);
-		return;
-	}
-
-	if (!strncmp(cmd, "ex", 2)) {
-		lock(x, LKM_EXMODE);
-		return;
-	}
-
-	if (!strncmp(cmd, "pr", 2)) {
-		lock(x, LKM_PRMODE);
-		return;
-	}
-
-	if (!strncmp(cmd, "hold", 4) && strlen(cmd) == 4) {
-		lock_all(LKM_PRMODE);
-		return;
-	}
-
-	if (!strncmp(cmd, "hold-kill", 9) && strlen(cmd) == 9) {
-		lock_all(LKM_PRMODE);
-		exit(0);
-	}
-
-	if (!strncmp(cmd, "release", 7) && strlen(cmd) == 7) {
-		unlock_all();
-		return;
-	}
-
-	if (!strncmp(cmd, "release-kill", 12) && strlen(cmd) == 12) {
-		unlock_all();
-		exit(0);
-	}
-
-	if (!strncmp(cmd, "dump", 4) && strlen(cmd) == 4) {
-		dump();
-		return;
-	}
-
-	if (!strncmp(cmd, "stress", 6) && strlen(cmd) == 6) {
-		if (iterations && !x)
-			x = iterations;
-		stress(x);
-		return;
-	}
-
-	if (!strncmp(cmd, "tstress", 7) && strlen(cmd) == 7) {
-		tstress(x);
-		return;
-	}
-
-	if (!strncmp(cmd, "dstress", 7) && strlen(cmd) == 7) {
-		dstress(x);
-		return;
-	}
-
-	if (!strncmp(cmd, "stress_delay", 12) && strlen(cmd) == 12) {
-		stress_delay = x;
-		return;
-	}
-
-	if (!strncmp(cmd, "stress_lock_only", 16) && strlen(cmd) == 16) {
-		stress_lock_only = !stress_lock_only;
-		printf("stress_lock_only is %s\n", stress_lock_only ? "on" : "off");
-		return;
-	}
-
-	if (!strncmp(cmd, "stress_stop", 11) && strlen(cmd) == 11) {
-		stress_stop = !stress_stop;
-		printf("stress_stop is %d\n", stress_stop);
-		return;
-	}
-
-	if (!strncmp(cmd, "ignore_bast", 11) && strlen(cmd) == 11) {
-		ignore_bast = !ignore_bast;
-		printf("ignore_bast is %s\n", ignore_bast ? "on" : "off");
-		return;
-	}
-
-	if (!strncmp(cmd, "our_xid", 7) && strlen(cmd) == 7) {
-		our_xid = x;
-		printf("our_xid is %llx\n", (unsigned long long)our_xid);
-		return;
-	}
-
-
-	if (!strncmp(cmd, "purge", 5) && strlen(cmd) == 5) {
-		purge(x, y);
-		return;
-	}
-
-	if (!strncmp(cmd, "purgetest", 9) && strlen(cmd) == 9) {
-		purgetest(x, y);
-		return;
-	}
-
-	if (!strncmp(cmd, "noqueue", 7)) {
-		noqueue = !noqueue;
-		printf("noqueue is %s\n", noqueue ? "on" : "off");
-		return;
-	}
-
-	if (!strncmp(cmd, "persistent", 10)) {
-		persistent = !persistent;
-		printf("persistent is %s\n", persistent ? "on" : "off");
-		return;
-	}
-
-	if (!strncmp(cmd, "minhold", 7)) {
-		minhold = x;
-		return;
-	}
-
-	if (!strncmp(cmd, "timeout", 7)) {
-		timeout = (uint64_t) 100 * x; /* dlm takes it in centiseconds */
-		printf("timeout is %d\n", x);
-		return;
-	}
-
-	if (!strncmp(cmd, "quiet", 5)) {
-		quiet = !quiet;
-		printf("quiet is %d\n", quiet);
-		return;
-	}
-
-	if (!strncmp(cmd, "verbose", 7)) {
-		verbose = !verbose;
-		printf("verbose is %d\n", verbose);
-		return;
-	}
-
-	if (!strncmp(cmd, "help", 4)) {
-		print_commands();
-		return;
-	}
-
-	if (!strncmp(cmd, "settings", 8)) {
-		print_settings();
-		return;
-	}
-
-	printf("unknown command %s\n", cmd);
-}
-
-static void print_usage(void)
-{
-	printf("Options:\n");
-	printf("\n");
-	printf("  -n           The number of locks to work with, default %d\n", MAX_LOCKS);
-	printf("  -r           The number of resources to work with, default %d\n", MAX_RESOURCES);
-	printf("  -i           Iterations in looping stress test, default 0 is no limit\n");
-	printf("  -t           Enable timeout warnings\n");
-}
-
-static void decode_arguments(int argc, char **argv)
-{
-	int cont = 1;
-	int optchar;
-
-	while (cont) {
-		optchar = getopt(argc, argv, "n:r:c:i:thVoq:v:");
-
-		switch (optchar) {
-
-		case 'n':
-			maxn = atoi(optarg);
-			break;
-
-		case 'r':
-			maxr = atoi(optarg);
-			break;
-
-		case 'c':
-			strcpy(cmd, optarg);
-			opt_cmd = 1;
-			break;
-
-		case 'i':
-			iterations = atoi(optarg);
-			break;
-
-		case 't':
-			timewarn = 1;
-			break;
-
-		case 'o':
-			openclose_ls = 1;
-			break;
-
-		case 'q':
-			quiet = atoi(optarg);
-			break;
-
-		case 'v':
-			verbose = atoi(optarg);
-			break;
-
-		case 'h':
-			print_usage();
-			exit(EXIT_SUCCESS);
-			break;
-
-		case 'V':
-			printf("%s (built %s %s)\n", argv[0], __DATE__, __TIME__);
-			/* printf("%s\n", REDHAT_COPYRIGHT); */
-			exit(EXIT_SUCCESS);
-			break;
-
-		case ':':
-		case '?':
-			fprintf(stderr, "Please use '-h' for usage.\n");
-			exit(EXIT_FAILURE);
-			break;
-
-		case EOF:
-			cont = 0;
-			break;
-
-		default:
-			fprintf(stderr, "unknown option: %c\n", optchar);
-			exit(EXIT_FAILURE);
-			break;
-		};
-	}
-}
-
-static void sigterm_handler(int sig)
-{
-	stress_stop = 1;
-}
-
-int main(int argc, char *argv[])
-{
-	uint32_t major, minor, patch;
-	struct lk *lk;
-	int i, rv, maxi = 0, quit = 0;
-
-	srandom(time(NULL));
-
-	decode_arguments(argc, argv);
-
-	if (maxn < maxr) {
-		printf("number of resources must be >= number of locks\n");
-		return -1;
-	}
-	if (maxn % maxr) {
-		printf("number of locks must be multiple of number of resources\n");
-		return -1;
-	}
-
-	printf("maxn = %d\n", maxn);
-	printf("maxr = %d\n", maxr);
-	printf("locks per resource = %d\n", maxn / maxr);
-
-	signal(SIGTERM, sigterm_handler);
-
-	client_init();
-
-	locks = malloc(maxn * sizeof(struct lk));
-	if (!locks) {
-		printf("no mem for %d locks\n", maxn);
-		return 0;
-	}
-	memset(locks, 0, sizeof(*locks));
-
-	lk = locks;
-	for (i = 0; i < maxn; i++) {
-		lk->id = i;
-		lk->grmode = -1;
-		lk->rqmode = -1;
-		lk++;
-	}
-
-	rv = dlm_kernel_version(&major, &minor, &patch);
-	if (rv < 0) {
-		printf("can't detect dlm in kernel %d\n", errno);
-		return -1;
-	}
-	printf("dlm kernel version: %u.%u.%u\n", major, minor, patch);
-	dlm_library_version(&major, &minor, &patch);
-	printf("dlm library version: %u.%u.%u\n", major, minor, patch);
-
-	if (openclose_ls) {
-		printf("dlm_open_lockspace...\n");
-
-		dh = dlm_open_lockspace("test");
-		if (!dh) {
-			printf("dlm_open_lockspace error %lu %d\n",
-				(unsigned long)dh, errno);
-			return -ENOTCONN;
-		}
-	} else {
-		printf("dlm_new_lockspace...\n");
-
-		dh = dlm_new_lockspace("test", 0600,
-				       timewarn ? DLM_LSFL_TIMEWARN : 0);
-		if (!dh) {
-			printf("dlm_new_lockspace error %lu %d\n",
-				(unsigned long)dh, errno);
-			return -ENOTCONN;
-		}
-	}
-
-	rv = dlm_ls_get_fd(dh);
-	if (rv < 0) {
-		printf("dlm_ls_get_fd error %d %d\n", rv, errno);
-		dlm_release_lockspace("test", dh, 1);
-		return rv;
-	}
-	libdlm_fd = rv;
-
-	client_add(libdlm_fd, &maxi);
-
-	if (opt_cmd) {
-		process_command(&quit);
-		goto out;
-	}
-
-	client_add(STDIN_FILENO, &maxi);
-
-	printf("Type EXIT to finish, help for usage\n");
-
-	while (1) {
-		rv = poll(pollfd, maxi + 1, -1);
-		if (rv < 0 && errno == EINTR)
-			continue;
-		if (rv < 0)
-			printf("poll error %d errno %d\n", rv, errno);
-
-		for (i = 0; i <= maxi; i++) {
-			if (client[i].fd < 0)
-				continue;
-
-			if (pollfd[i].revents & POLLIN) {
-				if (pollfd[i].fd == libdlm_fd)
-					process_libdlm();
-				else if (pollfd[i].fd == STDIN_FILENO)
-					process_command(&quit);
-			}
-
-			if (pollfd[i].revents & (POLLHUP | POLLERR | POLLNVAL))
-				client_dead(i);
-		}
-
-		if (quit && all_unlocks_done())
-			break;
-	}
-
- out:
-	if (openclose_ls) {
-		printf("dlm_close_lockspace\n");
-
-		rv = dlm_close_lockspace(dh);
-		if (rv < 0)
-			printf("dlm_close_lockspace error %d %d\n", rv, errno);
-	} else {
-		printf("dlm_release_lockspace\n");
-
-		rv = dlm_release_lockspace("test", dh, 1);
-		if (rv < 0)
-			printf("dlm_release_lockspace error %d %d\n", rv, errno);
-	}
-
-	return 0;
-}
diff --git a/dlm/tests/usertest/flood.c b/dlm/tests/usertest/flood.c
deleted file mode 100644
index a7e69ad..0000000
--- a/dlm/tests/usertest/flood.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/* Flood the DLM !
-   but not too much...
-*/
-
-#include "clusterautoconfig.h"
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <sys/poll.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <limits.h>
-#include <unistd.h>
-#include <errno.h>
-#include <getopt.h>
-
-#include "libdlm.h"
-
-static pthread_cond_t  cond;
-static pthread_mutex_t mutex;
-
-static int count = 0;
-
-static void usage(char *prog, FILE *file)
-{
-    fprintf(file, "Usage:\n");
-    fprintf(file, "%s [mcnpquhV] <lockname>\n", prog);
-    fprintf(file, "\n");
-    fprintf(file, "   -V         Show version of %s\n", prog);
-    fprintf(file, "   -h         Show this help information\n");
-    fprintf(file, "   -m <num>   Maximum number of locks to hold (default 100000)\n");
-    fprintf(file, "   -i <num>   Show progress in <n> increments (default 1000)\n");
-    fprintf(file, "   -n <num>   Number of resources (default 10)\n");
-    fprintf(file, "   -q         Quit\n");
-
-
-    fprintf(file, "\n");
-
-}
-
-static void ast_routine(void *arg)
-{
-    struct dlm_lksb *lksb = arg;
-
-    if (lksb->sb_status == 0) {
-	dlm_unlock(lksb->sb_lkid, 0, lksb, lksb);
-	return;
-    }
-
-    if (lksb->sb_status == EUNLOCK) {
-	    count--;
-    }
-}
-
-int main(int argc, char *argv[])
-{
-    int  flags = 0;
-    int  lockops = 0;
-    int  maxlocks = 100000;
-    int  rescount = 10;
-    int  increment = 1000;
-    int  quiet = 0;
-    int  status;
-    int  i;
-    int  mode = LKM_CRMODE;
-    int  lksbnum = 0;
-    signed char opt;
-    char **resources;
-    struct dlm_lksb *lksbs;
-
-    /* Deal with command-line arguments */
-    opterr = 0;
-    optind = 0;
-    while ((opt=getopt(argc,argv,"?m:i:qn:vV")) != EOF)
-    {
-	switch(opt)
-	{
-	case 'h':
-	    usage(argv[0], stdout);
-	    exit(0);
-
-	case '?':
-	    usage(argv[0], stderr);
-	    exit(0);
-
-	case 'm':
-	    maxlocks = atoi(optarg);
-	    break;
-
-	case 'i':
-	    increment = atoi(optarg);
-	    break;
-
-	case 'n':
-	    rescount = atoi(optarg);
-	    break;
-
-	case 'q':
-	    quiet = 1;
-	    break;
-
-	case 'V':
-	    printf("\nflood version 0.3\n\n");
-	    exit(1);
-	    break;
-	}
-    }
-
-    resources = malloc(sizeof(char*) * rescount);
-    for (i=0; i < rescount; i++) {
-	    char resname[256];
-	    sprintf(resname, "TESTLOCK%d", i);
-	    resources[i] = strdup(resname);
-    }
-
-    lksbs = malloc(sizeof(struct dlm_lksb) * maxlocks);
-    if (!lksbs)
-    {
-	    perror("cannot allocate lksbs");
-	    return 1;
-    }
-
-    pthread_cond_init(&cond, NULL);
-    pthread_mutex_init(&mutex, NULL);
-    pthread_mutex_lock(&mutex);
-
-    dlm_pthread_init();
-
-    while (1) {
-	    char *resource = resources[rand() % rescount];
-
-	    status = dlm_lock(mode,
-			      &lksbs[lksbnum],
-			      flags,
-			      resource,
-			      strlen(resource),
-			      0, // Parent,
-			      ast_routine,
-			      &lksbs[lksbnum],
-			      NULL, // bast_routine,
-			      NULL); // Range
-	    if (status == -1)
-	    {
-		    perror("lock failed");
-		    return -1;
-	    }
-
-	    count++;
-	    lockops++;
-	    if ((lockops % increment) == 0 && !quiet)
-		    fprintf(stderr, "%d lockops, %d locks\n", lockops, count);
-
-	    while (count > maxlocks) {
-		    sleep(1);
-	    }
-	    lksbnum = (lksbnum+1)%maxlocks;
-    }
-
-    return 0;
-}
-
diff --git a/dlm/tests/usertest/joinleave.c b/dlm/tests/usertest/joinleave.c
deleted file mode 100644
index c2ae659..0000000
--- a/dlm/tests/usertest/joinleave.c
+++ /dev/null
@@ -1,64 +0,0 @@
-#include "clusterautoconfig.h"
-
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <stddef.h>
-#include <errno.h>
-#include <time.h>
-#include <sys/time.h>
-#include <syslog.h>
-#include <sys/types.h>
-#include <sys/errno.h>
-
-#include "libdlm.h"
-
-static dlm_lshandle_t *dh;
-
-int main(int argc, char *argv[])
-{
-	struct timeval begin, end, diff;
-	char *name;
-	int sec = 0;
-
-	if (argc < 2) {
-		printf("%s <lockspace name> [sleep sec]\n", argv[0]);
-		exit(-1);
-	}
-
-	name = argv[1];
-
-	if (argc > 2)
-		sec = atoi(argv[2]);
-
-	printf("Joining lockspace \"%s\" ... ", name);
-	fflush(stdout);
-
-	gettimeofday(&begin, NULL);
-	dh = dlm_create_lockspace(name, 0600);
-	if (!dh) {
-		printf("dlm_create_lockspace error %p %d\n", dh, errno);
-		return -ENOTCONN;
-	}
-	gettimeofday(&end, NULL);
-
-	timersub(&end, &begin, &diff);
-	printf("%lu s\n", diff.tv_sec);
-
-	if (sec)
-		sleep(sec);
-
-	printf("Leaving lockspace \"%s\" ... ", name);
-	fflush(stdout);
-
-	gettimeofday(&begin, NULL);
-	dlm_release_lockspace(name, dh, 1);
-	gettimeofday(&end, NULL);
-
-	timersub(&end, &begin, &diff);
-	printf("%lu s\n", diff.tv_sec);
-
-	return 0;
-}
-
diff --git a/dlm/tests/usertest/lstest.c b/dlm/tests/usertest/lstest.c
deleted file mode 100644
index c84843a..0000000
--- a/dlm/tests/usertest/lstest.c
+++ /dev/null
@@ -1,328 +0,0 @@
-/* Test program for userland lockspaces */
-
-#include "clusterautoconfig.h"
-
-#ifdef _REENTRANT
-#include <pthread.h>
-#endif
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <sys/poll.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <limits.h>
-#include <unistd.h>
-#include <errno.h>
-#include <getopt.h>
-
-#include "libdlm.h"
-
-static struct dlm_lksb lksb;
-static int use_threads = 0;
-static int quiet = 0;
-
-/* Used by the pthread test */
-static pthread_cond_t  cond;
-static pthread_mutex_t mutex;
-
-/* Used by the poll() test */
-static int ast_called = 0;
-
-static int modetonum(char *modestr)
-{
-    int mode = LKM_EXMODE;
-
-    if (strncasecmp(modestr, "NL", 2) == 0) mode = LKM_NLMODE;
-    if (strncasecmp(modestr, "CR", 2) == 0) mode = LKM_CRMODE;
-    if (strncasecmp(modestr, "CW", 2) == 0) mode = LKM_CWMODE;
-    if (strncasecmp(modestr, "PR", 2) == 0) mode = LKM_PRMODE;
-    if (strncasecmp(modestr, "PW", 2) == 0) mode = LKM_PWMODE;
-    if (strncasecmp(modestr, "EX", 2) == 0) mode = LKM_EXMODE;
-
-    return mode;
-}
-
-static const char *numtomode(int mode)
-{
-    switch (mode)
-    {
-    case LKM_NLMODE: return "NL";
-    case LKM_CRMODE: return "CR";
-    case LKM_CWMODE: return "CW";
-    case LKM_PRMODE: return "PR";
-    case LKM_PWMODE: return "PW";
-    case LKM_EXMODE: return "EX";
-    default: return "??";
-    }
-}
-
-static void usage(char *prog, FILE *file)
-{
-    fprintf(file, "Usage:\n");
-    fprintf(file, "%s [mcnpqdlrfuhV] <lockname>\n", prog);
-    fprintf(file, "\n");
-    fprintf(file, "   -V         Show version of dlmtest\n");
-    fprintf(file, "   -h         Show this help information\n");
-    fprintf(file, "   -m <mode>  lock mode (default EX)\n");
-    fprintf(file, "   -n         don't block\n");
-    fprintf(file, "   -p         Use pthreads\n");
-    fprintf(file, "   -q         Quiet\n");
-    fprintf(file, "   -d <secs>  Delay betwen lock & unlock\n");
-    fprintf(file, "   -l <ls>    Lockspace name to create\n");
-    fprintf(file, "   -r         Don't release lockspace before finishing\n");
-    fprintf(file, "   -f         Force release lockspace\n");
-    fprintf(file, "   -u         Don't unlock explicitly\n");
-    fprintf(file, "\n");
-
-}
-
-static void ast_routine(void *arg)
-{
-    struct dlm_lksb *alksb = arg;
-
-    if (!quiet)
-	printf("ast called, status = %d, lkid=%x\n", alksb->sb_status, alksb->sb_lkid);
-
-    /* Wake the main thread */
-    if (use_threads)
-    {
-	pthread_mutex_lock(&mutex);
-	pthread_cond_signal(&cond);
-	pthread_mutex_unlock(&mutex);
-    }
-    else
-    {
-	ast_called = 1;
-    }
-}
-
-static void bast_routine(void *arg)
-{
-    struct dlm_lksb *blksb = arg;
-
-    if (!quiet)
-	printf("\nblocking ast called, status = %d, lkid=%x\n", blksb->sb_status, blksb->sb_lkid);
-}
-
-/* Using poll(2) to wait for and dispatch ASTs */
-static int poll_for_ast(dlm_lshandle_t ls)
-{
-    struct pollfd pfd;
-
-    pfd.fd = dlm_ls_get_fd(ls);
-    pfd.events = POLLIN;
-    while (!ast_called)
-    {
-	if (poll(&pfd, 1, 0) < 0)
-	{
-	    perror("poll");
-	    return -1;
-	}
-	dlm_dispatch(dlm_ls_get_fd(ls));
-    }
-    ast_called = 0;
-    return 0;
-}
-
-int main(int argc, char *argv[])
-{
-    const char *resource = "LOCK-NAME";
-    int  flags = 0;
-    int  status;
-    int  mode = LKM_EXMODE;
-    int  do_unlock = 1;
-    int  release_ls = 1;
-    int  open_ls = 0;
-    int  force = 0;
-    int  sleeptime = 5;
-    signed char opt;
-    char lsname[64];
-    dlm_lshandle_t  ls;
-
-    strcpy(lsname, "testls");
-
-    /* Deal with command-line arguments */
-    opterr = 0;
-    optind = 0;
-    while ((opt=getopt(argc,argv,"?m:nqupd:c:l:rfoV")) != EOF)
-    {
-	switch(opt)
-	{
-	case 'h':
-	    usage(argv[0], stdout);
-	    exit(0);
-
-	case '?':
-	    usage(argv[0], stderr);
-	    exit(0);
-
-	case 'm':
-	    mode = modetonum(optarg);
-	    break;
-
-	case 'l':
-	    strcpy(lsname, optarg);
-	    break;
-
-	case 'd':
-	    sleeptime = atoi(optarg);
-	    break;
-
-        case 'p':
-            use_threads++;
-            break;
-
-        case 'o':
-            open_ls++;
-            break;
-
-        case 'f':
-            force++;
-            break;
-
-        case 'r':
-            release_ls = 0;
-            break;
-
-	case 'n':
-	    flags |= LKF_NOQUEUE;
-	    break;
-
-        case 'q':
-            quiet = 1;
-            break;
-
-        case 'u':
-            do_unlock = 0;
-            break;
-
-	case 'V':
-	    printf("\nasttest version 0.2\n\n");
-	    exit(1);
-	    break;
-	}
-    }
-
-    if (argv[optind])
-	resource = argv[optind];
-
-
-    if (!open_ls)
-    {
-	if (!quiet)
-	    fprintf(stderr, "Creating lockspace %s\n", lsname);
-
-
-	ls = dlm_create_lockspace(lsname, 0444);
-	if (ls == NULL)
-	{
-	    perror("ls create");
-	    exit(4);
-	}
-    }
-    else
-    {
-	if (!quiet)
-	    fprintf(stderr, "Opening lockspace %s\n", lsname);
-
-
-	ls = dlm_open_lockspace(lsname);
-	if (ls == NULL)
-	{
-	    perror("ls open");
-	    exit(4);
-	}
-    }
-
-
-    if (!quiet)
-    fprintf(stderr, "locking %s %s %s...", resource,
-	    numtomode(mode),
-	    (flags&LKF_NOQUEUE?"(NOQUEUE)":""));
-
-    fflush(stderr);
-
-    if (use_threads)
-    {
-	pthread_cond_init(&cond, NULL);
-	pthread_mutex_init(&mutex, NULL);
-	pthread_mutex_lock(&mutex);
-
-	status = dlm_ls_pthread_init(ls); printf("status=%d\n", status);
-	status = dlm_ls_pthread_init(ls); printf("status=%d\n", status);
-    }
-
-    status = dlm_ls_lock(ls,mode,
-			 &lksb,
-			 flags,
-			 resource,
-			 strlen(resource),
-			 0, // Parent,
-			 ast_routine,
-			 &lksb,
-			 bast_routine,
-			 NULL); // Range
-    if (status == -1)
-    {
-	if (!quiet) fprintf(stderr, "\n");
-	perror("lock");
-
-	return -1;
-    }
-
-    /* Wait */
-    if (use_threads)
-	pthread_cond_wait(&cond, &mutex);
-    else
-	poll_for_ast(ls);
-
-    sleep(sleeptime);
-
-    if (!quiet)
-    {
-        fprintf(stderr, "unlocking %s...", resource);
-        fflush(stderr);
-    }
-
-    if (do_unlock)
-    {
-	status = dlm_ls_unlock(ls,
-			       lksb.sb_lkid,
-			       0, // flags
-			       &lksb,
-			       &lksb); // AST args
-	if (status == -1)
-	{
-	    if (!quiet) fprintf(stderr, "\n");
-	    perror("unlock");
-	    return -1;
-	}
-
-	/* Wait */
-	if (use_threads)
-	    pthread_cond_wait(&cond, &mutex);
-	else
-	    poll_for_ast(ls);
-    }
-
-    if (release_ls)
-    {
-	if (!quiet)
-	    fprintf(stderr, "Releasing ls %s\n", lsname);
-
-	status = dlm_release_lockspace(lsname, ls, force);
-	if (status)
-	    perror("release ls");
-    }
-
-    return 0;
-}
-
diff --git a/dlm/tests/usertest/lvb.c b/dlm/tests/usertest/lvb.c
deleted file mode 100644
index 4fe656d..0000000
--- a/dlm/tests/usertest/lvb.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/* Simple LVB test prog */
-
-#include "clusterautoconfig.h"
-
-#ifdef VMS
-#include starlet
-#include psldef
-#include ssdef
-#include errno
-#include descrip
-#include rsdmdef
-#include lckdef
-
-#include stdio
-#include stdlib
-#include string
-
-struct lksb
-{
-    int sb_status;
-    int sb_lkid;
-    char sb_lvb[16];
-};
-#endif
-
-#ifdef __linux__
-#include <stdio.h>
-#include <pthread.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libdlm.h>
-#include <unistd.h>
-#define LCK$M_VALBLK LKF_VALBLK
-#define LCK$M_CONVERT LKF_CONVERT
-#define LCK$K_CRMODE LKM_CRMODE
-#define LCK$K_PWMODE LKM_PWMODE
-#define PSL$C_USER 0
-#define SS$_NORMAL 0
-#define SS$_DEADLOCK EDEADLOCK
-#define EVMSERR errno
-#define sys$exit exit
-#define sys$hiber pause
-
-
-struct lksb {
-	int sb_status;
-	uint32_t sb_lkid;
-	char sb_flags;
-	char *sb_lvb;
-};
-
-struct dsc$descriptor_s
-{
-	int dsc$w_length;
-	char *dsc$a_pointer;
-};
-
-static int sys$enq(int efn, int mode, struct lksb *lksb, int flags,
-		   struct dsc$descriptor_s *name, int parent,
-		   void *compast, void *astarg, void *blockast,
-		   int accmode, int nullarg)
-{
-	if (name)
-		return dlm_lock(mode, (struct dlm_lksb *)lksb, flags,
-				name->dsc$a_pointer,
-				name->dsc$w_length,
-				parent,
-				compast, astarg,
-				blockast, NULL);
-	else
-		return dlm_lock(mode, (struct dlm_lksb *)lksb, flags,
-				NULL,
-				0,
-				parent,
-				compast, astarg,
-				blockast, NULL);
-}
-
-static int sys$deq(int lkid, struct lksb *lksb, int accmode, int flags, int c)
-{
-	return dlm_unlock(lkid, flags, (struct dlm_lksb *)lksb, NULL);
-}
-
-static char *linux_strerror(int vmserr, int err)
-{
-	return strerror(err);
-}
-#define strerror linux_strerror
-
-#endif
-
-
-static struct lksb our_lksb;
-static int cur_mode;
-static void compast_routine(void *arg);
-static void blockast_routine(void *arg, int mode);
-static const char *name = "TESTLOCK";
-
-#ifdef __linux__
-static char lksb_lvb[DLM_LVB_LEN];
-#endif
-
-static void start_lock(int mode)
-{
-    struct dsc$descriptor_s name_s;
-    int status;
-
-    cur_mode = mode;
-
-/* Make a descriptor of the name */
-    memset(&name_s, 0, sizeof(struct dsc$descriptor_s));
-    name_s.dsc$w_length = strlen(name);
-    name_s.dsc$a_pointer = (char *)name;
-
-    /* Lock it */
-    status = sys$enq(0,
-		      cur_mode,
-		      &our_lksb,
-		      LCK$M_VALBLK, /* flags */
-		      &name_s,
-		      0, /* parent */
-		      compast_routine,
-		      0, /* astp */
-		      blockast_routine,
-		      PSL$C_USER,
- 		      0);
-
-    if (status != SS$_NORMAL)
-    {
-        printf("lock enq failed : %s\n", strerror(EVMSERR, status));
-	sys$exit(status);
-    }
-
-    printf("Lock ID is %x\n", our_lksb.sb_lkid);
-    return;
-}
-
-static int convert_lock(int mode, char *lvb)
-{
-    int status;
-
-    memset(our_lksb.sb_lvb, 0, 16);
-    if (lvb[strlen(lvb)-1] == '\n')
-      lvb[strlen(lvb)-1] = '\0';
-
-    cur_mode = mode;
-    strcpy(our_lksb.sb_lvb, lvb);
-    printf("converting to %d\n", mode);
-
-    /* Lock it */
-    status = sys$enq(0,
-		     mode,
-		     &our_lksb,
-		     LCK$M_CONVERT | LCK$M_VALBLK,
-		     NULL,
-		     0, /* parent */
-		     compast_routine,
-		     0, /* astp */
-		     blockast_routine,
-		     PSL$C_USER,
-		     0);
-
-    if (status != SS$_NORMAL)
-    {
-        printf("convert enq failed : %s\n", strerror(EVMSERR, status));
-    }
-
-    return status;
-}
-
-static void unlock(void)
-{
-    int status;
-
-    status = sys$deq(our_lksb.sb_lkid, NULL,0,0,0);
-    if (status != SS$_NORMAL)
-    {
-        printf("denq failed : %s\n", strerror(EVMSERR, status));
-    }
-}
-
-static void compast_routine(void *arg)
-{
-#ifdef __linux__
-    if (our_lksb.sb_flags & DLM_SBF_VALNOTVALID)
-    {
-        printf("testlock: LVB not valid\n");
-	sys$hiber();
-    }
-#endif
-    if (our_lksb.sb_status == SS$_DEADLOCK)
-    {
-	printf("testlock: deadlocked\n");
-	unlock();
-	return;
-    }
-
-    if (our_lksb.sb_status == SS$_NORMAL)
-    {
-	printf("testlock. compast, now at %d, lvb=%s\n", cur_mode, our_lksb.sb_lvb);
-    }
-    else
-    {
-	printf("testlock: lock failed (compast): %s\n", strerror(EVMSERR, our_lksb.sb_status));
-	sys$hiber();
-    }
-}
-
-static void blockast_routine(void *arg, int mode)
-{
-    printf("testlock. blkast.\n");
-}
-
-int main(int argc, char *argv[])
-{
-    char buf[80];
-
-#ifdef __linux__
-    our_lksb.sb_lvb = lksb_lvb;
-    dlm_pthread_init();
-#endif
-
-    if (argc > 1)
-      name = argv[1];
-
-    start_lock(LCK$K_CRMODE);
-
-    do {
-      char cmd;
-
-      fgets(buf, sizeof(buf), stdin);
-      cmd = buf[0] & 0x5F;
-
-      if (cmd == 'W')
-	convert_lock(LCK$K_CRMODE, &buf[1]);
-      else
-	convert_lock(LCK$K_PWMODE, &buf[1]);
-    }
-    while (buf[0] != 'x');
-
-    return SS$_NORMAL;
-}
-
diff --git a/dlm/tests/usertest/pingtest.c b/dlm/tests/usertest/pingtest.c
deleted file mode 100644
index bc797b1..0000000
--- a/dlm/tests/usertest/pingtest.c
+++ /dev/null
@@ -1,345 +0,0 @@
-
-/* Ping Test the locking interface */
-
-#include "clusterautoconfig.h"
-
-#ifdef __linux__
-#include <pthread.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <netdb.h>
-#include <unistd.h>
-
-#include <libdlm.h>
-
-static char our_lvb[DLM_LVB_LEN];
-static struct dlm_lksb our_lksb = {.sb_lvbptr = our_lvb};
-static int *lvb_int = (int *)our_lvb;
-#define SUCCESS 0
-#endif
-
-
-#ifdef VMS
-#include starlet
-#include psldef
-#include ssdef
-#include errno
-#include descrip
-#include rsdmdef
-#include lckdef
-
-#include stdio
-#include stdlib
-#include string
-
-struct lksb
-{
-    int sb_status;
-    int sb_lkid;
-    char sb_lvb[16];
-};
-
-static struct lksb our_lksb;
-static int *lvb_int = (int *)&our_lksb.sb_lvb;
-
-#define LKM_NLMODE LCK$K_NLMODE
-#define LKM_CRMODE LCK$K_CRMODE
-#define LKM_CWMODE LCK$K_CWMODE
-#define LKM_PRMODE LCK$K_PRMODE
-#define LKM_PWMODE LCK$K_PWMODE
-#define LKM_EXMODE LCK$K_EXMODE
-#define EDEADLOCK SS$_DEADLOCK
-
-/* This is wrong...VMS does not deliver ASTs
-   for $DEQ but we'll never get this code, honest.
- */
-#define EUNLOCK 65535
-
-#define SUCCESS SS$_NORMAL
-#endif
-
-static const char *lockname="ping";
-static int us = 1;
-static int maxnode = 2;
-static int cur_mode;
-
-static int granted = 0;
-static void compast_routine(void *arg);
-static void blockast_routine(void *arg);
-
-#ifdef __linux__
-static int convert_lock(int mode)
-{
-    int status;
-
-    printf("pinglock: convert to %d starting\n", mode);
-    status = dlm_lock( mode,
-		       &our_lksb,
-		       LKF_VALBLK | LKF_CONVERT,
-		       NULL,
-		       0,
-		       0,
-		       compast_routine,
-		       &our_lksb,
-		       blockast_routine,
-		       NULL);
-    if (status != 0)
-    {
-	perror("pinglock: convert failed");
-    }
-    else
-    {
-	cur_mode = mode;
-	printf("pinglock: convert to %d started\n", mode);
-    }
-    return status;
-}
-
-static void unlock(void)
-{
-    int status;
-    status = dlm_unlock( our_lksb.sb_lkid,
-			 0,
-			 &our_lksb,
-			 0);
-    if (status != 0)
-	perror("pinglock: unlock failed");
-
-}
-
-static void start_lock(void)
-{
-    int status;
-    cur_mode = LKM_EXMODE;
-
-    *lvb_int = us-1;
-
-    printf("pinglock: starting\n");
-    status = dlm_lock( cur_mode,
-		       &our_lksb,
-		       LKF_VALBLK,
-		       lockname,
-		       strlen(lockname)+1, /* include trailing NUL for ease of following */
-		       0, /* Parent */
-		       compast_routine,
-		       &our_lksb,
-		       blockast_routine,
-		       NULL);
-    if (status != 0)
-	perror("pinglock: lock failed");
-}
-
-#endif /* __linux__ */
-
-#ifdef VMS
-
-static void start_lock()
-{
-    struct dsc$descriptor_s name_s;
-    int status;
-    char *name = "PINGLOCK";
-
-    cur_mode = LCK$K_EXMODE;
-
-    *lvb_int = us-1;
-
-/* Make a descriptor of the name */
-    memset(&name_s, 0, sizeof(struct dsc$descriptor_s));
-    name_s.dsc$w_length = strlen(name);
-    name_s.dsc$a_pointer = name;
-
-    /* Lock it */
-    status = sys$enqw(0,
-		      cur_mode,
-		      &our_lksb,
-		      0, /* flags */
-		      &name_s,
-		      0, /* parent */
-		      compast_routine,
-		      0, /* astp */
-		      blockast_routine,
-		      PSL$C_USER,
-		      RSDM$K_PROCESS_RSDM_ID,
-		      0);
-
-    if (status != SS$_NORMAL)
-    {
-        printf("lock enq failed : %s\n", strerror(EVMSERR, status));
-	sys$exit(status);
-    }
-
-    printf("Lock ID is %x\n", our_lksb.sb_lkid);
-    return;
-}
-
-static int convert_lock(int mode)
-{
-    int status;
-    int old_mode = cur_mode;
-
-    printf("converting to %d\n", mode);
-
-    /* Lock it */
-    status = sys$enq(0,
-		     mode,
-		     &our_lksb,
-		     LCK$M_CONVERT | LCK$M_VALBLK,
-		     NULL,
-		     0, /* parent */
-		     compast_routine,
-		     0, /* astp */
-		     blockast_routine,
-		     PSL$C_USER,
-		     RSDM$K_PROCESS_RSDM_ID,
-		     0);
-
-    if (status != SS$_NORMAL)
-    {
-        printf("convert enq failed : %s\n", strerror(EVMSERR, status));
-	sys$wake();
-    }
-    else
-    {
-	cur_mode = mode;
-	status = 0; /* simulate Unix retcodes */
-    }
-    return status;
-}
-
-static void unlock()
-{
-    int status;
-
-    status = sys$deq(our_lksb.sb_lkid, NULL,0,0,0);
-    if (status != SS$_NORMAL)
-    {
-        printf("denq failed : %s\n", strerror(EVMSERR, status));
-	sys$wake();
-    }
-}
-
-#endif
-
-static void compast_routine(void *arg)
-{
-
-#ifdef __linux__
-    if (our_lksb.sb_flags & DLM_SBF_VALNOTVALID)
-#endif
-#ifdef VMS
-    if (our_lksb.sb_status == SS$_VALNOTVALID)
-#endif
-    {
-	    printf(" valblk not valid. current value is %d\n", *lvb_int);
-	    unlock();
-	    exit(10);
-    }
-
-    if (our_lksb.sb_status == EDEADLOCK)
-    {
-	printf("pinglock: deadlocked\n");
-	unlock();
-	exit(11);
-    }
-
-    if (our_lksb.sb_status == EUNLOCK)
-    {
-	return;
-    }
-
-    if (our_lksb.sb_status == SUCCESS)
-    {
-	granted = 1;
-	switch (cur_mode)
-	{
-	case LKM_NLMODE:
-	    printf("pinglock. compast, (valblk = %d) now at NL\n", *lvb_int);
-	    if (convert_lock(LKM_CRMODE) == 0)
-		granted = 0;
-	    break;
-
-	case LKM_CRMODE:
-	    printf("pinglock. compast, (valblk = %d) now at CR\n", *lvb_int);
-	    if (*lvb_int == us-1)
-	    {
-		if (convert_lock(LKM_EXMODE) == 0)
-		    granted = 0;
-	    }
-	    break;
-
-	case LKM_EXMODE:
-	    printf("pinglock. compast. (valblk = %d) now at EX\n", *lvb_int);
-	    if (*lvb_int == us-1)
-	    {
-		(*lvb_int)++;
-		*lvb_int %= maxnode;
-		printf("pinglock. compast. incrementing valblk to %d\n", *lvb_int);
-	    }
-	    if (convert_lock(LKM_CRMODE) == 0)
-		granted = 0;
-	    break;
-	}
-    }
-    else
-    {
-	printf("pinglock: lock failed (compast): %d\n", our_lksb.sb_status);
-	unlock();
-    }
-}
-
-static void blockast_routine(void *arg)
-{
-    printf("pinglock. blkast, granted = %d\n", granted);
-    if (!granted)
-    {
-	return;
-    }
-
-    printf("pinglock. blkast, demoting lock to NL\n");
-    if (convert_lock(LKM_NLMODE) == 0)
-	granted = 0;
-}
-
-
-#ifdef __linux__
-int main(int argc, char *argv[])
-{
-    if (argc < 3)
-    {
-        printf("usage: %s <maxnodes> <us>\n", argv[0]);
-	return 2;
-    }
-    maxnode = atoi(argv[1]);
-    us = atoi(argv[2]);
-
-    dlm_pthread_init();
-    start_lock();
-    while(1)
-	    sleep(100000);
-    return 0;
-}
-
-
-#endif
-
-#ifdef VMS
-int main(int argc, char *argv[])
-{
-    if (argc < 3)
-    {
-        printf("usage: %s <maxnodes> <us>\n", argv[0]);
-	return 2;
-    }
-    maxnode = atoi(argv[1]);
-    us = atoi(argv[2]);
-
-    start_lock();
-    while(1)
-	sys$hiber();
-
-    return SS$_NORMAL;
-}
-#endif
diff --git a/dlm/tests/usertest/sublocks.c b/dlm/tests/usertest/sublocks.c
deleted file mode 100644
index 756b90d..0000000
--- a/dlm/tests/usertest/sublocks.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/* Test program for userland DLM interface */
-
-#include "clusterautoconfig.h"
-
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <limits.h>
-#include <unistd.h>
-#include <errno.h>
-#include <getopt.h>
-
-#include "libdlm.h"
-
-static int modetonum(char *modestr)
-{
-    int mode = LKM_EXMODE;
-
-    if (strncasecmp(modestr, "NL", 2) == 0) mode = LKM_NLMODE;
-    if (strncasecmp(modestr, "CR", 2) == 0) mode = LKM_CRMODE;
-    if (strncasecmp(modestr, "CW", 2) == 0) mode = LKM_CWMODE;
-    if (strncasecmp(modestr, "PR", 2) == 0) mode = LKM_PRMODE;
-    if (strncasecmp(modestr, "PW", 2) == 0) mode = LKM_PWMODE;
-    if (strncasecmp(modestr, "EX", 2) == 0) mode = LKM_EXMODE;
-
-    return mode;
-}
-
-static void usage(char *prog, FILE *file)
-{
-    fprintf(file, "Usage:\n");
-    fprintf(file, "%s [mndvV] <parent>\n", prog);
-    fprintf(file, "\n");
-    fprintf(file, "   -V         Show version of %s\n", prog);
-    fprintf(file, "   -h         Show this help information\n");
-    fprintf(file, "   -v         Do it verbosely\n");
-    fprintf(file, "   -m <mode>  lock mode (default CR)\n");
-    fprintf(file, "   -p         Pause at end\n");
-    fprintf(file, "   -d <num>   Depth of lock tree (default 4)\n");
-    fprintf(file, "   -n <num>   Number of children (default 4)\n");
-    fprintf(file, "   -s <name>  Subresource name (eg SUBRES-%%d)\n");
-    fprintf(file, "\n");
-
-}
-
-int  maxdepth = 4;
-int  nchildren = 4;
-int  verbose = 0;
-char *subresformat="SUBRES-%d-%d";
-
-
-int do_childlocks(int parent, int mode, int depth, int flags)
-{
-    int status;
-    int i;
-    char subresname[64];
-    struct dlm_lksb lksb;
-
-    if (depth > maxdepth) return 0;
-
-    memset(&lksb, 0, sizeof(lksb));
-
-    for (i = 0; i < nchildren; i++)
-    {
-	sprintf(subresname, subresformat, depth, i);
-
-	if (verbose)
-	    printf("locking '%s', depth %d\n", subresname, depth);
-
-	status = dlm_lock_wait(mode, &lksb, flags, subresname, strlen(subresname)+1,
-			       parent, NULL, NULL, NULL);
-	if (status || !lksb.sb_lkid)
-	{
-	    perror("lock failed");
-	    return 0;
-	}
-	do_childlocks(lksb.sb_lkid, mode, depth+1, flags);
-    }
-    return 0;
-}
-
-
-int main(int argc, char *argv[])
-{
-    char *resource = "LOCK-NAME";
-    int  flags = 0;
-    int  status;
-    int  mode = LKM_CRMODE;
-    int  pause_at_end=0;
-    struct dlm_lksb lksb;
-    signed char opt;
-
-    /* Deal with command-line arguments */
-    opterr = 0;
-    optind = 0;
-    while ((opt=getopt(argc,argv,"?m:n:d:s:pvV")) != EOF)
-    {
-	switch(opt)
-	{
-	case 'h':
-	    usage(argv[0], stdout);
-	    exit(0);
-
-	case '?':
-	    usage(argv[0], stderr);
-	    exit(0);
-
-	case 'm':
-	    mode = modetonum(optarg);
-	    break;
-
-	case 'v':
-	    verbose++;
-	    break;
-
-	case 'p':
-	    pause_at_end++;
-	    break;
-
-	case 'd':
-	    maxdepth = atoi(optarg);
-	    break;
-
-	case 'n':
-	    nchildren = atoi(optarg);
-	    break;
-
-	case 's':
-	    strcpy(subresformat, optarg);
-	    break;
-
-	case 'V':
-	    printf("\n%s version 0.1\n\n", argv[0]);
-	    exit(1);
-	    break;
-	}
-    }
-
-    if (argv[optind])
-	resource = argv[optind];
-
-    /* Lock parent */
-    if (verbose)
-	fprintf(stderr, "locking parent '%s'\n", resource);
-
-    fflush(stderr);
-
-    status = dlm_lock_wait(mode, &lksb, flags,
-			   resource, strlen(resource)+1,
-			   0, NULL, NULL, NULL);
-    if (status == -1)
-    {
-	perror("lock");
-	return -1;
-    }
-
-    if (lksb.sb_lkid == 0)
-    {
-	fprintf(stderr, "error: got lockid of zero\n");
-	return 0;
-    }
-
-    do_childlocks(lksb.sb_lkid, mode, 0, flags);
-
-    if (pause_at_end)
-    {
-	printf("paused\n");
-	pause();
-    }
-    return 0;
-}
diff --git a/dlm/tests/usertest/threads.c b/dlm/tests/usertest/threads.c
deleted file mode 100644
index 8137004..0000000
--- a/dlm/tests/usertest/threads.c
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
- * Threaded DLM example
- */
-
-#include "clusterautoconfig.h"
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <sys/poll.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <limits.h>
-#include <unistd.h>
-#include <errno.h>
-#include <getopt.h>
-
-#include "libdlm.h"
-
-struct lock_wait {
-	pthread_cond_t cond;
-	pthread_mutex_t mutex;
-	struct dlm_lksb lksb;
-};
-
-struct thread_args
-{
-	dlm_lshandle_t *lockspace;
-	char *resource;
-	int flags;
-	int delay;
-	int mode;
-	int verbose;
-	int num;
-};
-
-static int modetonum(char *modestr)
-{
-    int mode = LKM_EXMODE;
-
-    if (strncasecmp(modestr, "NL", 2) == 0) mode = LKM_NLMODE;
-    if (strncasecmp(modestr, "CR", 2) == 0) mode = LKM_CRMODE;
-    if (strncasecmp(modestr, "CW", 2) == 0) mode = LKM_CWMODE;
-    if (strncasecmp(modestr, "PR", 2) == 0) mode = LKM_PRMODE;
-    if (strncasecmp(modestr, "PW", 2) == 0) mode = LKM_PWMODE;
-    if (strncasecmp(modestr, "EX", 2) == 0) mode = LKM_EXMODE;
-
-    return mode;
-}
-
-static void usage(char *prog, FILE *file)
-{
-    fprintf(file, "Usage:\n");
-    fprintf(file, "%s [mcnpquhV] <lockname>\n", prog);
-    fprintf(file, "\n");
-    fprintf(file, "   -V           show version of %s\n", prog);
-    fprintf(file, "   -h           show this help information\n");
-    fprintf(file, "   -m <mode>    lock mode (default EX)\n");
-    fprintf(file, "   -n           don't block\n");
-    fprintf(file, "   -t <threads> number of threads\n");
-    fprintf(file, "   -d <secs>    delay while holding lock\n");
-    fprintf(file, "   -l <name>    lockspace name\n");
-    fprintf(file, "   -v           verbose (up to 3)\n");
-    fprintf(file, "\n");
-
-}
-
-/* Simply wakes the thread that initiated the lock */
-static void sync_ast_routine(void *arg)
-{
-	struct lock_wait *lwait = arg;
-
-	pthread_mutex_lock(&lwait->mutex);
-	pthread_cond_signal(&lwait->cond);
-	pthread_mutex_unlock(&lwait->mutex);
-}
-
-/* Get/Convert a lock and wait for it to complete (or fail) */
-static int sync_lock(dlm_lshandle_t lockspace,
-		     const char *resource,
-		     int mode,
-		     int flags,
-		     int *lockid)
-{
-	int status;
-	struct lock_wait lwait;
-
-	if (!lockid) {
-		errno = EINVAL;
-		return -1;
-	}
-
-	/* Conversions need the lockid in the LKSB */
-	if (flags & LKF_CONVERT)
-		lwait.lksb.sb_lkid = *lockid;
-
-	pthread_cond_init(&lwait.cond, NULL);
-	pthread_mutex_init(&lwait.mutex, NULL);
-	pthread_mutex_lock(&lwait.mutex);
-
-	status = dlm_ls_lock(lockspace,
-			     mode,
-			     &lwait.lksb,
-			     flags,
-			     resource,
-			     strlen(resource),
-			     0, sync_ast_routine, &lwait, NULL, NULL);
-	if (status)
-		return status;
-
-	/* Wait for it to complete */
-	pthread_cond_wait(&lwait.cond, &lwait.mutex);
-	pthread_mutex_unlock(&lwait.mutex);
-
-	*lockid = lwait.lksb.sb_lkid;
-
-	errno = lwait.lksb.sb_status;
-
-	if (lwait.lksb.sb_status)
-		return -1;
-	else
-		return 0;
-}
-
-/* Unlock - and wait for it to complete */
-static int sync_unlock(dlm_lshandle_t lockspace, int lockid)
-{
-	int status;
-	struct lock_wait lwait;
-
-	pthread_cond_init(&lwait.cond, NULL);
-	pthread_mutex_init(&lwait.mutex, NULL);
-	pthread_mutex_lock(&lwait.mutex);
-
-	status = dlm_ls_unlock(lockspace, lockid, 0, &lwait.lksb, &lwait);
-
-	if (status)
-		return status;
-
-	/* Wait for it to complete */
-	pthread_cond_wait(&lwait.cond, &lwait.mutex);
-	pthread_mutex_unlock(&lwait.mutex);
-
-	errno = lwait.lksb.sb_status;
-	if (lwait.lksb.sb_status != EUNLOCK)
-		return -1;
-	else
-		return 0;
-
-}
-
-static void *thread_fn(void *arg)
-{
-	struct thread_args *ta = arg;
-	int lockid=0;
-	int status;
-
-	if (ta->verbose > 1)
-		fprintf(stderr, "Locking in thread %lx\n", pthread_self());
-
-	status = sync_lock(ta->lockspace, ta->resource,
-			   ta->mode, ta->flags, &lockid);
-
-	if (status)
-	{
-		if (ta->verbose)
-			fprintf(stderr, "Lock in thread %lx failed: %s\n", pthread_self(), strerror(errno));
-		return NULL;
-	}
-
-	sleep(ta->delay);
-
-	if (ta->verbose > 1)
-		fprintf(stderr, "Unlocking in thread %lx\n", pthread_self());
-
-	status = sync_unlock(ta->lockspace,lockid);
-	if (status)
-	{
-		if (ta->verbose)
-			fprintf(stderr, "Unlock in thread %lx failed: %s\n", pthread_self(), strerror(errno));
-	}
-
-	return NULL;
-}
-
-
-int main(int argc, char *argv[])
-{
-    char const *resource = "LOCK-NAME";
-    char const *lockspace_name = "threadtest";
-    dlm_lshandle_t *lockspace;
-    int  flags = 0;
-    int  num_threads = 5;
-    int  delay = 1;
-    int  mode = LKM_EXMODE;
-    int  verbose = 0;
-    int  i;
-    signed char opt;
-    pthread_t *threads;
-    struct thread_args ta;
-
-    /* Deal with command-line arguments */
-    opterr = 0;
-    optind = 0;
-    while ((opt=getopt(argc,argv,"h?nt:d:l:m:vV")) != EOF)
-    {
-	switch(opt)
-	{
-	case 'h':
-	    usage(argv[0], stdout);
-	    exit(0);
-
-	case '?':
-	    usage(argv[0], stderr);
-	    exit(0);
-
-	case 'n':
-	    flags |= LKF_NOQUEUE;
-	    break;
-
-	case 't':
-            num_threads = atoi(optarg);
-	    break;
-
-	case 'm':
-            mode = modetonum(optarg);
-	    break;
-
-	case 'l':
-	    lockspace_name = strdup(optarg);
-	    break;
-
-	case 'd':
-            delay = atoi(optarg);
-	    break;
-
-	case 'v':
-	    verbose++;
-	    break;
-
-	case 'V':
-	    printf("\nthread example version 0.1\n\n");
-	    exit(1);
-	    break;
-	}
-    }
-
-    if (argv[optind])
-	resource = argv[optind];
-
-    if (verbose)
-	    fprintf(stderr, "Creating lockspace '%s'...", lockspace_name);
-
-    /* You need to be root to create the lockspace ... but not to use it */
-    lockspace = dlm_create_lockspace(lockspace_name, 0666);
-    if (!lockspace) {
-	    perror("Unable to create lockspace");
-	    return 1;
-    }
-    if (verbose)
-	    fprintf(stderr, "done\n");
-
-    dlm_ls_pthread_init(lockspace);
-
-    threads = malloc(sizeof(pthread_t) * num_threads);
-    if (!threads)
-    {
-	    perror("can't malloc threads array");
-	    return 2;
-    }
-
-    if (verbose)
-	    fprintf(stderr, "Starting threads\n");
-
-    ta.lockspace = lockspace;
-    ta.mode = mode;
-    ta.flags = flags;
-    ta.delay = delay;
-    ta.verbose = verbose;
-    ta.resource = (char *)resource;
-
-    for (i=0; i<num_threads; i++)
-    {
-	    if (verbose > 2)
-		    fprintf(stderr, "Starting thread %d\n", i);
-
-	    pthread_create(&threads[i], NULL, thread_fn, &ta);
-    }
-
-    if (verbose)
-	    fprintf(stderr, "All threads started\n");
-
-    for (i=0; i<num_threads; i++)
-    {
-	    void *status;
-	    if (verbose > 2)
-		    fprintf(stderr, "Waiting for thread %d\n", i);
-	    pthread_join(threads[i], &status);
-    }
-
-    return 0;
-}
-
diff --git a/dlm/tool/Makefile.am b/dlm/tool/Makefile.am
deleted file mode 100644
index 091114f..0000000
--- a/dlm/tool/Makefile.am
+++ /dev/null
@@ -1,12 +0,0 @@
-MAINTAINERCLEANFILES	= Makefile.in
-
-sbin_PROGRAMS		= dlm_tool
-
-dlm_tool_SOURCES	= main.c
-
-dlm_tool_CPPFLAGS	= -I$(top_srcdir)/dlm/libdlm \
-			  -I$(top_srcdir)/dlm/libdlmcontrol \
-			  -I$(top_srcdir)/group/dlm_controld
-
-dlm_tool_LDADD		= $(top_builddir)/dlm/libdlm/libdlm.la \
-			  $(top_builddir)/dlm/libdlmcontrol/libdlmcontrol.la
diff --git a/doc/COPYING.applications b/doc/COPYING.applications
deleted file mode 100644
index d511905..0000000
--- a/doc/COPYING.applications
+++ /dev/null
@@ -1,339 +0,0 @@
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License along
-    with this program; if not, write to the Free Software Foundation, Inc.,
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/doc/COPYING.libraries b/doc/COPYING.libraries
deleted file mode 100644
index 2d2d780..0000000
--- a/doc/COPYING.libraries
+++ /dev/null
@@ -1,510 +0,0 @@
-
-                  GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
-	51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations
-below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it
-becomes a de-facto standard.  To achieve this, non-free programs must
-be allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
-                  GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control
-compilation and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at least
-    three years, to give the same user the materials specified in
-    Subsection 6a, above, for a charge no more than the cost of
-    performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply, and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License
-may add an explicit geographical distribution limitation excluding those
-countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-                            NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms
-of the ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.
-It is safest to attach them to the start of each source file to most
-effectively convey the exclusion of warranty; and each file should
-have at least the "copyright" line and a pointer to where the full
-notice is found.
-
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or
-your school, if any, to sign a "copyright disclaimer" for the library,
-if necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James
-  Random Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/doc/COPYRIGHT b/doc/COPYRIGHT
deleted file mode 100644
index 77c8112..0000000
--- a/doc/COPYRIGHT
+++ /dev/null
@@ -1,42 +0,0 @@
-Unless specified otherwise in the "exceptions section" below:
-
-Copyright (C) 1997-2003 Sistina Software, Inc.  All rights reserved.
-Copyright (C) 2004-2010 Red Hat, Inc.  All rights reserved.
-
-Exceptions:
-
-dlm/doc/example.c:
- Author: Daniel Phillips <phillips at redhat.com>
-
-Authors as known by current RCS as of the time of writing:
-
-Abhijith Das <adas at redhat.com>
-Adam Manthei <amanthei at redhat.com>
-A. J. Lewis <alewis at redhat.com>
-Alasdair G. Kergon <agk at redhat.com>
-Andrew Price <andy at andrewprice.me.uk>
-Benjamin Marzinski <bmarzins at redhat.com>
-Bob Peterson <rpeterso at redhat.com>
-Chris Feist <cfeist at redhat.com>
-Christine Caulfield <ccaulfie at redhat.com>
-Daniel Phillips <phillips at redhat.com>
-David Teigland <teigland at redhat.com>
-Fabio M. Di Nitto <fdinitto at redhat.com>
-James Parsons <jparsons at redhat.com>
-Joel Becker <joel.becker at oracle.com>
-Jonathan Brassow <jbrassow at redhat.com>
-jparsons <jparsons at redhat.com>
-Ken Preslan <kpreslan at redhat.com>
-Lon Hohberger <lhh at redhat.com>
-Marc - A. Dahlhaus <mad at wol.de>
-Marek 'marx' Grac <mgrac at redhat.com>
-Mark Hlawatschek <hlawatschek at atix.de>
-Michael Conrad Tadpol Tilstra <mtilstra at redhat.com>
-Patrick Caulfield <pcaulfie at redhat.com>
-Robert Peterson <rpeterso at redhat.com>
-Ross Vandegrift <ross at kallisti.us>
-Ryan McCabe <rmccabe at redhat.com>
-Ryan O'Hara <rohara at redhat.com>
-Stanko Kupcevic <kupcevic at redhat.com>
-Steven Whitehouse <swhiteho at redhat.com>
-Wendy Cheng <wcheng at redhat.com>
diff --git a/doc/Makefile.am b/doc/Makefile.am
deleted file mode 100644
index 2e6a2ec..0000000
--- a/doc/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-MAINTAINERCLEANFILES	= Makefile.in
-
-dist_doc_DATA		= gfs2.txt \
-			  journaling.txt \
-			  min-gfs.txt \
-			  usage.txt \
-			  COPYING.applications \
-			  COPYING.libraries \
-			  COPYRIGHT \
-			  README.licence
diff --git a/doc/README.licence b/doc/README.licence
deleted file mode 100644
index 075aa77..0000000
--- a/doc/README.licence
+++ /dev/null
@@ -1,33 +0,0 @@
-The Red Hat Cluster is a collection of free software built on top of different
-libraries and applications.
-
-For a detailed list of authors and copyright holders, please check the
-included COPYRIGHT file.
-
-Libraries:
-
-You can redistribute them and/or modify them under the terms of the GNU Lesser
-General Public License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-The libraries are distributed in the hope that they will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
-details.
-
-Applications:
-
-You can redistribute them and/or modify them under the terms of the GNU General
-Public License as published by the Free Software Foundation; either version
-2 of the License, or (at your option) any later version.
-
-The applications are distributed in the hope that they will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
-details.
-
-A copy of each license is included for your convenience in COPYING.applications
-and COPYING.libraries.
-
-If missing, write to the Free Software Foundation, Inc., 51 Franklin St,
-Fifth Floor, Boston, MA 02110-1301 USA.
diff --git a/doc/gfs2.txt b/doc/gfs2.txt
deleted file mode 100644
index 88f0143..0000000
--- a/doc/gfs2.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-Global File System
-------------------
-
-http://sources.redhat.com/cluster/
-
-GFS is a cluster file system. It allows a cluster of computers to
-simultaneously use a block device that is shared between them (with FC,
-iSCSI, NBD, etc).  GFS reads and writes to the block device like a local
-file system, but also uses a lock module to allow the computers coordinate
-their I/O so file system consistency is maintained.  One of the nifty
-features of GFS is perfect consistency -- changes made to the file system
-on one machine show up immediately on all other machines in the cluster.
-
-GFS uses interchangable inter-node locking mechanisms.  Different lock
-modules can plug into GFS and each file system selects the appropriate
-lock module at mount time.  Lock modules include:
-
-  lock_nolock -- does no real locking and allows gfs to be used as a
-  local file system
-
-  lock_dlm -- uses a distributed lock manager (dlm) for inter-node locking
-  The dlm is found at linux/fs/dlm/
-
-In addition to interfacing with an external locking manager, a gfs lock
-module is responsible for interacting with external cluster management
-systems.  Lock_dlm depends on user space cluster management systems found
-at the URL above.
-
-To use gfs as a local file system, no external clustering systems are
-needed, simply:
-
-  $ gfs2_mkfs -p lock_nolock -j 1 /dev/block_device
-  $ mount -t gfs2 /dev/block_device /dir
-
-GFS2 is not on-disk compatible with previous versions of GFS.
-
-The following man pages can be found at the URL above:
-  gfs2_mkfs	to make a filesystem
-  gfs2_fsck	to repair a filesystem
-  gfs2_grow	to expand a filesystem online
-  gfs2_jadd	to add journals to a filesystem online
-  gfs2_tool	to manipulate, examine and tune a filesystem
-  gfs2_quota	to examine and change quota values in a filesystem
-  mount.gfs2	to find mount options
-
diff --git a/doc/journaling.txt b/doc/journaling.txt
deleted file mode 100644
index e89eefa..0000000
--- a/doc/journaling.txt
+++ /dev/null
@@ -1,155 +0,0 @@
-o  Journaling & Replay
-
-The fundamental problem with a journaled cluster filesystem is
-handling journal replay with multiple journals.  A single block of
-metadata can be modified sequentially by many different nodes in the
-cluster.  As the block is modified by each node, it gets logged in the
-journal for each node.  If care is not taken, it's possible to get
-into a situation where a journal replay can actually corrupt a
-filesystem.  The error scenario is:
-
-1) Node A modifies a metadata block by putting a updated copy into its
-   incore log.
-2) Node B wants to read and modify the block so it requests the lock
-   and a blocking callback is sent to Node A.
-3) Node A flushes its incore log to disk, and then syncs out the
-   metadata block to its inplace location.
-4) Node A then releases the lock.
-5) Node B reads in the block and puts a modified copy into its ondisk
-   log and then the inplace block location.
-6) Node A crashes.
-
-At this point, Node A's journal needs to be replayed.  Since there is
-a newer version of block inplace, if that block is replayed, the
-filesystem will be corrupted.  There are a few different ways of
-avoiding this problem.
-
-1) Generation Numbers (GFS1)
-
-   Each metadata block has header in it that contains a 64-bit
-   generation number.  As each block is logged into a journal, the
-   generation number is incremented.  This provides a strict ordering
-   of the different versions of the block a they are logged in the FS'
-   different journals.  When journal replay happens, each block in the
-   journal is not replayed if generation number in the journal is less
-   than the generation number in place.  This ensures that a newer
-   version of a block is never replaced with an older version.  So,
-   this solution basically allows multiple copies of the same block in
-   different journals, but it allows you to always know which is the
-   correct one.
-
-   Pros:
-
-   A) This method allows the fastest callbacks.  To release a lock,
-      the incore log for the lock must be flushed and then the inplace
-      data and metadata must be synced.  That's it.  The sync
-      operations involved are: start the log body and wait for it to
-      become stable on the disk, synchronously write the commit block,
-      start the inplace metadata and wait for it to become stable on
-      the disk.
-
-   Cons:
-
-   A) Maintaining the generation numbers is expensive.  All newly
-      allocated metadata block must be read off the disk in order to
-      figure out what the previous value of the generation number was.
-      When deallocating metadata, extra work and care must be taken to
-      make sure dirty data isn't thrown away in such a way that the
-      generation numbers stop doing their thing.
-   B) You can't continue to modify the filesystem during journal
-      replay.  Basically, replay of a block is a read-modify-write
-      operation: the block is read from disk, the generation number is
-      compared, and (maybe) the new version is written out.  Replay
-      requires that the R-M-W operation is atomic with respect to
-      other R-M-W operations that might be happening (say by a normal
-      I/O process).  Since journal replay doesn't (and can't) play by
-      the normal metadata locking rules, you can't count on them to
-      protect replay.  Hence GFS1, quieces all writes on a filesystem
-      before starting replay.  This provides the mutual exclusion
-      required, but it's slow and unnecessarily interrupts service on
-      the whole cluster.
-
-2) Total Metadata Sync (OCFS2)
-
-   This method is really simple in that it uses exactly the same
-   infrastructure that a local journaled filesystem uses.  Every time
-   a node receives a callback, it stops all metadata modification,
-   syncs out the whole incore journal, syncs out any dirty data, marks
-   the journal as being clean (unmounted), and then releases the lock.
-   Because journal is marked as clean and recovery won't look at any
-   of the journaled blocks in it, a valid copy of any particular block
-   only exists in one journal at a time and that journal always the
-   journal who modified it last.
-
-   Pros:
-
-   A) Very simple to implement.
-   B) You can reuse journaling code from other places (such as JBD).
-   C) No quiece necessary for replay.
-   D) No need for generation numbers sprinkled throughout the metadata.
-
-   Cons:
-
-   A) This method has the slowest possible callbacks.  The sync
-      operations are: stop all metadata operations, start and wait for
-      the log body, write the log commit block, start and wait for all
-      the FS' dirty metadata, write an unmount block.  Writing the
-      metadata for the whole filesystem can be particularly expensive
-      because it can be scattered all over the disk and there can be a
-      whole journal's worth of it.
-
-3) Revocation of a lock's buffers (GFS2)
-
-   This method prevents a block from appearing in more than one
-   journal by canceling out the metadata blocks in the journal that
-   belong to the lock being released.  Journaling works very similarly
-   to a local filesystem or to #2 above.
-
-   The biggest difference is you have to keep track of buffers in the
-   active region of the ondisk journal, even after the inplace blocks
-   have been written back.  This is done in GFS2 by adding a second
-   part to the Active Items List.  The first part (in GFS2 called
-   AIL1) contains a list of all the blocks which have been logged to
-   the journal, but not written back to their inplace location.  Once
-   an item in AIL1 has been written back to its inplace location, it
-   is moved to AIL2.  Once the tail of the log moves past the block's
-   transaction in the log, it can be removed from AIL2.
-
-   When a callback occurs, the log is flushed to the disk and the
-   metadata for the lock is synced to disk.  At this point, any
-   metadata blocks for the lock that are in the current active region
-   of the log will be in the AIL2 list.  We then build a transaction
-   that contains revoke tags for each buffer in the AIL2 list that
-   belongs to that lock.
-
-   Pros:
-
-   A) No quiece necessary for Replay
-   B) No need for generation numbers sprinkled throughout the
-      metadata.
-   C) The sync operations are: stop all metadata operations, start and
-      wait for the log body, write the log commit block, start and
-      wait for all the FS' dirty metadata, start and wait for the log
-      body of a transaction that revokes any of the lock's metadata
-      buffers in the journal's active region, and write the commit
-      block for that transaction.
-
-   Cons:
-
-   A) Recovery takes two passes, one to find all the revoke tags in
-      the log and one to replay the metadata blocks using the revoke
-      tags as a filter.  This is necessary for a local filesystem and
-      the total sync method, too.  It's just that there will probably
-      be more tags.
-
-Comparing #2 and #3, both do extra I/O during a lock callback to make
-sure that any metadata blocks in the log for that lock will be
-removed.  I believe #2 will be slower because syncing out all the
-dirty metadata for entire filesystem requires lots of little,
-scattered I/O across the whole disk.  The extra I/O done by #3 is a
-log write to the disk.  So, not only should it be less I/O, but it
-should also be better suited to get good performance out of the disk
-subsystem.
-
-KWP 07/06/05
-
diff --git a/doc/min-gfs.txt b/doc/min-gfs.txt
deleted file mode 100644
index af1399c..0000000
--- a/doc/min-gfs.txt
+++ /dev/null
@@ -1,159 +0,0 @@
-
-Minimum GFS HowTo
------------------
-
-The following gfs configuration requires a minimum amount of hardware and
-no expensive storage system.  It's the cheapest and quickest way to "play"
-with gfs.
-
-
-  ----------       ----------
-  | GNBD   |       | GNBD   |
-  | client |       | client |       <-- these nodes use gfs
-  | node2  |       | node3  |
-  ----------       ----------
-      |                |
-      ------------------  IP network
-               |
-          ----------
-          | GNBD   |
-          | server |                <-- this node doesn't use gfs
-          | node1  |
-          ----------
-
-- There are three machines to use with hostnames: node1, node2, node3
-
-- node1 has an extra disk /dev/sda1 to use for gfs
-  (this could be hda1 or an lvm LV or an md device)
-
-- node1 will use gnbd to export this disk to node2 and node3
-
-- Node1 cannot use gfs, it only acts as a gnbd server.
-  (Node1 will /not/ actually be part of the cluster since it is only
-   running the gnbd server.)
-
-- Only node2 and node3 will be in the cluster and use gfs.
-  (A two-node cluster is a special case for cman, noted in the config below.)
-
-- There's not much point to using clvm in this setup so it's left out.
-
-- Download the "cluster" source tree.
-
-- Build and install from the cluster source tree.  (The kernel components
-  are not required on node1 which will only need the gnbd_serv program.)
-
-    cd cluster
-    ./configure --kernel_src=/path/to/kernel
-    make; make install
-
-- Create /etc/cluster/cluster.conf on node2 with the following contents:
-
-<?xml version="1.0"?>
-<cluster name="gamma" config_version="1">
-
-<cman two_node="1" expected_votes="1">
-</cman>
-
-<clusternodes>
-<clusternode name="node2">
-	<fence>
-		<method name="single">
-			<device name="gnbd" ipaddr="node2"/>
-		</method>
-	</fence>
-</clusternode>
-
-<clusternode name="node3">
-	<fence>
-		<method name="single">
-			<device name="gnbd" ipaddr="node3"/>
-		</method>
-	</fence>
-</clusternode>
-</clusternodes>
-
-<fencedevices>
-	<fencedevice name="gnbd" agent="fence_gnbd" servers="node1"/>
-</fencedevices>
-
-</cluster>
-
-
-- load kernel modules on nodes
-
-node2 and node3> modprobe gnbd
-node2 and node3> modprobe gfs
-node2 and node3> modprobe lock_dlm
-
-- run the following commands
-
-node1> gnbd_serv -n
-node1> gnbd_export -c -d /dev/sda1 -e global_disk
-
-node2 and node3> gnbd_import -n -i node1
-node2 and node3> ccsd
-node2 and node3> cman_tool join
-node2 and node3> fence_tool join
-
-node2> gfs_mkfs -p lock_dlm -t gamma:gfs1 -j 2 /dev/gnbd/global_disk
-
-node2 and node3> mount -t gfs /dev/gnbd/global_disk /mnt
-
-- the end, you now have a gfs file system mounted on node2 and node3
-
-
-Appendix A
-----------
-
-To use manual fencing instead of gnbd fencing, the cluster.conf file
-would look like this:
-
-<?xml version="1.0"?>
-<cluster name="gamma" config_version="1">
-
-<cman two_node="1" expected_votes="1">
-</cman>
-
-<clusternodes>
-<clusternode name="node2">
-	<fence>
-		<method name="single">
-			<device name="manual" ipaddr="node2"/>
-		</method>
-	</fence>
-</clusternode>
-
-<clusternode name="node3">
-	<fence>
-		<method name="single">
-			<device name="manual" ipaddr="node3"/>
-		</method>
-	</fence>
-</clusternode>
-</clusternodes>
-
-<fencedevices>
-	<fencedevice name="manual" agent="fence_manual"/>
-</fencedevices>
-
-</cluster>
-
-
-FAQ
----
-
-- Why can't node3 use gfs, too?
-
-You might be able to make it work, but we recommend that you not try.
-This software was not intended or designed to allow that kind of usage.
-
-- Isn't node3 a single point of failure? how do I avoid that?
-
-Yes it is.  For the time being, there's no way to avoid that, apart from
-not using gnbd, of course.  Eventually, there will be a way to avoid this
-using cluster mirroring.
-
-- More info from
-  http://sources.redhat.com/cluster/gnbd/gnbd_usage.txt
-  http://sources.redhat.com/cluster/doc/usage.txt
-
diff --git a/doc/usage.txt b/doc/usage.txt
deleted file mode 100644
index f9e2866..0000000
--- a/doc/usage.txt
+++ /dev/null
@@ -1,177 +0,0 @@
-How to install and run GFS.
-
-Refer to the cluster project page for the latest information.
-http://sources.redhat.com/cluster/
-
-
-Install
--------
-
-Install a Linux kernel with GFS2, DLM, configfs, IPV6 and SCTP,
-  2.6.23-rc1 or later
-
-  If you want to use gfs1 (from cluster/gfs-kernel), then you need to
-  export three additional symbols from gfs2 by adding the following lines
-  to the end of linux/fs/gfs2/locking.c:
-     EXPORT_SYMBOL_GPL(gfs2_unmount_lockproto);
-     EXPORT_SYMBOL_GPL(gfs2_mount_lockproto);
-     EXPORT_SYMBOL_GPL(gfs2_withdraw_lockproto);
-
-Install openais
-  get the latest "whitetank" (stable) release from
-  http://openais.org/
-  or
-  svn checkout http://svn.osdl.org/openais
-  cd openais/branches/whitetank
-  make; make install DESTDIR=/
-
-Install gfs/dlm/fencing/etc components
-  get the latest cluster-2.xx.yy tarball from
-  ftp://sources.redhat.com/pub/cluster/
-  or
-  cvs -d :pserver:cvs at sources.redhat.com:/cvs/cluster login cvs
-  cvs -d :pserver:cvs at sources.redhat.com:/cvs/cluster checkout cluster
-  the password is "cvs"
-  cd cluster
-  ./configure --kernel_src=/path/to/kernel
-  make install
-
-  NOTE: On 64-bit systems, you will usually need to add '--libdir=/usr/lib64'
-        to the configure line.
-
-Install LVM2/CLVM (optional)
-  cvs -d :pserver:cvs at sources.redhat.com:/cvs/lvm2 login cvs
-  cvs -d :pserver:cvs at sources.redhat.com:/cvs/lvm2 checkout LVM2
-  cvs -d :pserver:cvs at sources.redhat.com:/cvs/lvm2
-  the password is "cvs"
-  cd LVM2
-  ./configure --with-clvmd=cman --with-cluster=shared
-  make; make install
-
-  NOTE: On 64-bit systems, you will usually need to add '--libdir=/usr/lib64'
-        to the configure line.
-
-Load kernel modules
--------------------
-
-modprobe gfs2
-modprobe gfs
-modprobe lock_dlm
-modprobe lock_nolock
-modprobe dlm
-
-
-Configuration
--------------
-
-Create /etc/cluster/cluster.conf and copy it to all nodes.
-
-  The format and content of cluster.conf has changed little since the
-  last generation of the software.  See old example here:
-  http://sources.redhat.com/cluster/doc/usage.txt
-  The one change you will need to make is to add nodeids for all nodes
-  in the cluster. These are now mandatory. eg:
-
-     <clusternode name="node12.mycluster.mycompany.com" votes="1" nodeid="12">
-
-  If you already have a cluster.conf file with no nodeids in it, then you can
-  use the 'ccs_tool addnodeids' command to add them.
-
-
-Example cluster.conf
---------------------
-
-This is a basic cluster.conf file that requires manual fencing.  The node
-names should resolve to the address on the network interface you want to
-use for openais/cman/dlm communication.
-
-<?xml version="1.0"?>
-<cluster name="alpha" config_version="1">
-
-<clusternodes>
-<clusternode name="node01" nodeid="1">
-        <fence>
-        </fence>
-</clusternode>
-
-<clusternode name="node02" nodeid="2">
-        <fence>
-        </fence>
-</clusternode>
-
-<clusternode name="node03" nodeid="3">
-        <fence>
-        </fence>
-</clusternode>
-</clusternodes>
-
-<fencedevices>
-</fencedevices>
-
-</cluster>
-
-
-Startup procedure
------------------
-
-Run these commands on each cluster node:
-
-> mount -t configfs none /sys/kernel/config
-> ccsd
-> cman_tool join
-> groupd
-> fenced
-> fence_tool join
-> dlm_controld
-> gfs_controld
-> clvmd (optional)
-> mkfs -t gfs2 -p lock_dlm -t <clustername>:<fsname> -j <#journals> <blockdev>
-> mount -t gfs2 [-v] <blockdev> <mountpoint>
-
-Notes:
-- replace "gfs2" with "gfs" above to use gfs1 instead of gfs2
-- <clustername> in mkfs should match the one in cluster.conf.
-- <fsname> in mkfs is any name you pick, each fs must have a different name.
-- <#journals> in mkfs should be greater than or equal to the number of nodes
-  that you want to mount this fs, each node uses a separate journal.
-- To avoid unnecessary fencing when starting the cluster, it's best for
-  all nodes to join the cluster (complete cman_tool join) before any
-  of them do fence_tool join.
-- The cman_tool "status" and "nodes" options show the status and members
-  of the cluster.
-- The group_tool command shows the status of fencing, dlm and gfs groups
-  that the local node is part of.
-- The "cman" init script can be used for starting everything up through
-  gfs_controld in the list above.
-
-
-Shutdown procedure
-------------------
-
-Run these commands on each cluster node:
-
-> umount [-v] <mountpoint>
-> fence_tool leave
-> cman_tool leave
-
-
-Converting from GFS1 to GFS2
-----------------------------
-
-If you have GFS1 filesystems that you need to convert to GFS2, follow
-this procedure:
-
-1. Back up your entire filesystem first.
-   e.g. cp /dev/your_vg/lvol0 /your_gfs_backup
-
-2. Run fsck to ensure filesystem integrity.
-   e.g. gfs2_fsck /dev/your_vg/lvol0
-
-3. Make sure the filesystem is not mounted from any node.
-   e.g. for i in `grep "<clusternode name" /etc/cluster/cluster.conf | cut -d '"' -f2` ; do ssh $i "mount | grep gfs" ; done
-
-4. Make sure you have the latest software versions.
-
-5. Run gfs2_convert <blockdev> from one of the nodes.
-   e.g. gfs2_convert /dev/your_vg/lvol0
-
diff --git a/group/Makefile.am b/group/Makefile.am
deleted file mode 100644
index d94a155..0000000
--- a/group/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-MAINTAINERCLEANFILES	= Makefile.in
-
-SUBDIRS			= dlm_controld include man
diff --git a/group/dlm_controld/Makefile.am b/group/dlm_controld/Makefile.am
deleted file mode 100644
index aa68000..0000000
--- a/group/dlm_controld/Makefile.am
+++ /dev/null
@@ -1,33 +0,0 @@
-MAINTAINERCLEANFILES	= Makefile.in
-
-sbin_PROGRAMS		= dlm_controld
-
-noinst_HEADERS		= config.h dlm_controld.h dlm_daemon.h
-
-dlm_controld_SOURCES	= action.c cpg.c crc.c main.c \
-			  plock.c config.c member_cman.c \
-			  logging.c rbtree.c
-
-dlm_controld_CPPFLAGS	= -I$(top_srcdir)/dlm/libdlm \
-			  -I$(top_srcdir)/dlm/libdlmcontrol \
-			  -I$(top_srcdir)/group/include
-
-dlm_controld_CFLAGS	= $(logt_CFLAGS) \
-			  $(cpg_CFLAGS) \
-			  $(confdb_CFLAGS)
-			  $(ccs_CFLAGS) \
-			  $(fenced_CFLAGS) \
-			  $(cfg_CFLAGS) \
-			  $(quorum_CFLAGS)
-
-dlm_controld_LDFLAGS	= $(logt_LIBS) \
-			  $(cpg_LIBS) \
-			  $(confdb_LIBS) \
-			  $(ccs_LIBS) \
-			  $(fenced_LIBS) \
-			  $(cfg_LIBS) \
-			  $(quorum_LIBS) \
-			  -lpthread
-
-dlm_controld_LDADD	= $(top_builddir)/dlm/libdlm/libdlm.la \
-			  $(top_builddir)/dlm/libdlmcontrol/libdlmcontrol.la
diff --git a/group/include/Makefile.am b/group/include/Makefile.am
deleted file mode 100644
index 04922a5..0000000
--- a/group/include/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-MAINTAINERCLEANFILES	= Makefile.in
-
-noinst_HEADERS		= linux_endian.h list.h rbtree.h
diff --git a/group/man/Makefile.am b/group/man/Makefile.am
deleted file mode 100644
index 0ef74ae..0000000
--- a/group/man/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-MAINTAINERCLEANFILES	= Makefile.in
-
-dist_man_MANS		= dlm_controld.8


More information about the cluster-commits mailing list