From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13090 invoked by alias); 26 Jan 2009 17:09:23 -0000 Received: (qmail 13083 invoked by alias); 26 Jan 2009 17:09:22 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,KAM_MX,SPF_HELO_PASS X-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,KAM_MX,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on bastion.fedora.phx.redhat.com Subject: gfs2-utils: master - libgfs2: test_locking should be in mkfs To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: gfs2-utils.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: e33573bfd27e151dc6d2a7c07a647d888e6ca914 X-Git-Newrev: e787a9272c4e5f66174958cddc435abbe2fdb5b2 From: Steven Whitehouse Message-Id: <20090126170905.4F510C024D@lists.fedorahosted.org> Date: Mon, 26 Jan 2009 17:09:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q1/txt/msg00278.txt.bz2 Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=e787a9272c4e5f66174958cddc435abbe2fdb5b2 Commit: e787a9272c4e5f66174958cddc435abbe2fdb5b2 Parent: e33573bfd27e151dc6d2a7c07a647d888e6ca914 Author: Steven Whitehouse AuthorDate: Mon Jan 26 16:07:58 2009 +0000 Committer: Steven Whitehouse 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 --- 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 -#include -#include -#include -#include -#include - -#include -#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;