public inbox for cluster-cvs@sourceware.org help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@fedoraproject.org> To: cluster-cvs-relay@redhat.com Subject: gfs2-utils: master - libgfs2: test_locking should be in mkfs Date: Mon, 26 Jan 2009 17:09:00 -0000 [thread overview] Message-ID: <20090126170905.4F510C024D@lists.fedorahosted.org> (raw) 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;
reply other threads:[~2009-01-26 17:09 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20090126170905.4F510C024D@lists.fedorahosted.org \ --to=swhiteho@fedoraproject.org \ --cc=cluster-cvs-relay@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).