public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* gfs2-utils: master - libgfs2: test_locking should be in mkfs
@ 2009-01-26 17:09 Steven Whitehouse
0 siblings, 0 replies; only message in thread
From: Steven Whitehouse @ 2009-01-26 17:09 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=e787a9272c4e5f66174958cddc435abbe2fdb5b2
Commit: e787a9272c4e5f66174958cddc435abbe2fdb5b2
Parent: e33573bfd27e151dc6d2a7c07a647d888e6ca914
Author: Steven Whitehouse <swhiteho@redhat.com>
AuthorDate: Mon Jan 26 16:07:58 2009 +0000
Committer: Steven Whitehouse <swhiteho@redhat.com>
CommitterDate: Mon Jan 26 16:07:58 2009 +0000
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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-01-26 17:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-26 17:09 gfs2-utils: master - libgfs2: test_locking should be in mkfs Steven Whitehouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).