cluster: STABLE3 - libgfs2: test_locking should be in mkfs
Fabio M. Di Nitto
fabbione@fedoraproject.org
Thu Feb 19 10:09:00 GMT 2009
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a0e1292d5369ab0015c648a0a0fea85c26beece2
Commit: a0e1292d5369ab0015c648a0a0fea85c26beece2
Parent: ab6bd3fac2fc94a8189df82ae3df7c4ec17fa77e
Author: Steven Whitehouse <swhiteho@redhat.com>
AuthorDate: Mon Jan 26 16:07:58 2009 +0000
Committer: Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Thu Feb 19 10:59:56 2009 +0100
libgfs2: test_locking should be in mkfs
The test_locking function was only used in mkfs, so move it
there and remove it from the library.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
---
gfs2/libgfs2/Makefile | 1 -
gfs2/libgfs2/libgfs2.h | 3 --
gfs2/libgfs2/locking.c | 56 ------------------------------------------------
gfs2/mkfs/main_mkfs.c | 50 +++++++++++++++++++++++++++++++++++++++++-
4 files changed, 48 insertions(+), 62 deletions(-)
diff --git a/gfs2/libgfs2/Makefile b/gfs2/libgfs2/Makefile
index e00e31f..9411130 100644
--- a/gfs2/libgfs2/Makefile
+++ b/gfs2/libgfs2/Makefile
@@ -9,7 +9,6 @@ OBJS= block_list.o \
fs_geometry.o \
fs_ops.o \
gfs1.o \
- locking.o \
gfs2_log.o \
gfs2_disk_hash.o \
misc.o \
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 9d38e41..e681608 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -573,9 +573,6 @@ extern int gfs1_ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount);
extern struct gfs2_inode *gfs_inode_get(struct gfs2_sbd *sdp,
struct gfs2_buffer_head *bh);
-/* locking.c */
-extern void test_locking(char *lockproto, char *locktable);
-
/* gfs2_log.c */
struct gfs2_options {
char *device;
diff --git a/gfs2/libgfs2/locking.c b/gfs2/libgfs2/locking.c
deleted file mode 100644
index b9199c4..0000000
--- a/gfs2/libgfs2/locking.c
+++ /dev/null
@@ -1,56 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <ctype.h>
-
-#include <linux/types.h>
-#include "libgfs2.h"
-
-/**
- * test_locking - Make sure the GFS2 is set up to use the right lock protocol
- * @lockproto: the lock protocol to mount
- * @locktable: the locktable name
- *
- */
-
-void test_locking(char *lockproto, char *locktable)
-{
- char *c;
-
- if (strcmp(lockproto, "lock_nolock") == 0) {
- /* Nolock is always ok. */
- } else if (strcmp(lockproto, "lock_gulm") == 0 ||
- strcmp(lockproto, "lock_dlm") == 0) {
- for (c = locktable; *c; c++) {
- if (isspace(*c))
- die("locktable error: contains space characters\n");
- if (!isprint(*c))
- die("locktable error: contains unprintable characters\n");
- }
-
- c = strstr(locktable, ":");
- if (!c)
- die("locktable error: missing colon in the locktable\n");
-
- if (c == locktable)
- die("locktable error: missing cluster name\n");
- if (c - locktable > 16)
- die("locktable error: cluster name too long\n");
-
- c++;
- if (!c)
- die("locktable error: missing filesystem name\n");
-
- if (strstr(c, ":"))
- die("locktable error: more than one colon present\n");
-
- if (!strlen(c))
- die("locktable error: missing filesystem name\n");
- if (strlen(c) > 16)
- die("locktable error: filesystem name too long\n");
- } else {
- die("lockproto error: %s unknown\n", lockproto);
- }
-}
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index aaa9a2e..2b8a82a 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -211,8 +211,54 @@ decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp)
}
}
-static void
-verify_arguments(struct gfs2_sbd *sdp)
+/**
+ * test_locking - Make sure the GFS2 is set up to use the right lock protocol
+ * @lockproto: the lock protocol to mount
+ * @locktable: the locktable name
+ *
+ */
+
+static void test_locking(char *lockproto, char *locktable)
+{
+ char *c;
+
+ if (strcmp(lockproto, "lock_nolock") == 0) {
+ /* Nolock is always ok. */
+ } else if (strcmp(lockproto, "lock_gulm") == 0 ||
+ strcmp(lockproto, "lock_dlm") == 0) {
+ for (c = locktable; *c; c++) {
+ if (isspace(*c))
+ die("locktable error: contains space characters\n");
+ if (!isprint(*c))
+ die("locktable error: contains unprintable characters\n");
+ }
+
+ c = strstr(locktable, ":");
+ if (!c)
+ die("locktable error: missing colon in the locktable\n");
+
+ if (c == locktable)
+ die("locktable error: missing cluster name\n");
+ if (c - locktable > 16)
+ die("locktable error: cluster name too long\n");
+
+ c++;
+ if (!c)
+ die("locktable error: missing filesystem name\n");
+
+ if (strstr(c, ":"))
+ die("locktable error: more than one colon present\n");
+
+ if (!strlen(c))
+ die("locktable error: missing filesystem name\n");
+ if (strlen(c) > 16)
+ die("locktable error: filesystem name too long\n");
+ } else {
+ die("lockproto error: %s unknown\n", lockproto);
+ }
+}
+
+static void verify_arguments(struct gfs2_sbd *sdp)
{
unsigned int x;
More information about the Cluster-cvs
mailing list