From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28055 invoked by alias); 18 Jun 2008 20:53:30 -0000 Received: (qmail 28023 invoked by uid 9582); 18 Jun 2008 20:53:30 -0000 Date: Wed, 18 Jun 2008 20:53:00 -0000 Message-ID: <20080618205330.28007.qmail@sourceware.org> From: rpeterso@sourceware.org To: cluster-cvs@sources.redhat.com, cluster-devel@redhat.com Subject: Cluster Project branch, RHEL5, updated. cmirror_1_1_15-119-g215796b X-Git-Refname: refs/heads/RHEL5 X-Git-Reftype: branch X-Git-Oldrev: 151f91487730addf1edd1bcf47e4ee5a4cb2ae78 X-Git-Newrev: 215796bbd78788ce810d7e12288e8fa7341bbf5d 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: 2008-q2/txt/msg00504.txt.bz2 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Cluster Project". http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=215796bbd78788ce810d7e12288e8fa7341bbf5d The branch, RHEL5 has been updated via 215796bbd78788ce810d7e12288e8fa7341bbf5d (commit) via ac21687ce47e7bcb62ef73879525d0cadc53c150 (commit) from 151f91487730addf1edd1bcf47e4ee5a4cb2ae78 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 215796bbd78788ce810d7e12288e8fa7341bbf5d Author: Bob Peterson Date: Wed Jun 18 15:49:28 2008 -0500 Fix white space commit ac21687ce47e7bcb62ef73879525d0cadc53c150 Author: Bob Peterson Date: Wed Jun 11 13:55:00 2008 -0500 Added an optional block-size to mkfs.gfs2 ----------------------------------------------------------------------- Summary of changes: gfs2/man/mkfs.gfs2.8 | 11 ++++++++--- gfs2/mkfs/main_mkfs.c | 29 ++++++++++++++++++++++++----- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/gfs2/man/mkfs.gfs2.8 b/gfs2/man/mkfs.gfs2.8 index b411467..9c8918d 100644 --- a/gfs2/man/mkfs.gfs2.8 +++ b/gfs2/man/mkfs.gfs2.8 @@ -8,7 +8,7 @@ mkfs.gfs2 - Make a GFS2 filesystem .SH SYNOPSIS .B mkfs.gfs2 -[\fIOPTION\fR]... \fIDEVICE\fR +[\fIOPTION\fR]... \fIDEVICE\fR \fI[ block-count ]\fR .SH DESCRIPTION mkfs.gfs2 is used to create a Global File System. @@ -23,7 +23,7 @@ x86_64, s390, s390x), the memory page size is 4096 bytes. On other architectures it may be bigger. The default block size is 4096 bytes. In general, GFS2 filesystems should not deviate from the default value. .TP -\fB-c MegaBytes\fP +\fB-c\fP \fIMegaBytes\fR Initial size of each journal's quota change file .TP \fB-D\fP @@ -73,12 +73,17 @@ Fsname is a unique file system name used to distinguish this GFS2 file system from others created (1 to 16 characters). Lock_nolock doesn't use this field. .TP -\fB-u MegaBytes\fP +\fB-u\fP \fIMegaBytes\fR Initial size of each journal's unlinked tag file .TP \fB-V\fP Print program version information, then exit. +.TP +[ \fIblock-count\fR ] +Make the file system this many blocks in size. If not specified, the +entire length of the specified device is used. + .SH EXAMPLE .TP gfs2_mkfs -t mycluster:mygfs2 -p lock_dlm -j 2 /dev/vg0/mygfs2 diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c index f66a990..0db34e7 100644 --- a/gfs2/mkfs/main_mkfs.c +++ b/gfs2/mkfs/main_mkfs.c @@ -55,7 +55,7 @@ print_usage(void) { printf("Usage:\n"); printf("\n"); - printf("%s [options] \n", prog_name); + printf("%s [options] [ block-count ]\n", prog_name); printf("\n"); printf("Options:\n"); printf("\n"); @@ -90,6 +90,7 @@ decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp) memset(sdp->device_name, 0, sizeof(sdp->device_name)); sdp->md.journals = 1; + sdp->orig_fssize = 0; while (cont) { optchar = getopt(argc, argv, "-b:c:DhJ:j:Op:qr:t:u:VX"); @@ -173,10 +174,13 @@ decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp) case 1: if (strcmp(optarg, "gfs2") == 0) continue; - if (sdp->device_name[0]) { - die("More than one device specified (try -h for help)"); - } - strcpy(sdp->device_name, optarg); + if (!sdp->device_name[0]) + strcpy(sdp->device_name, optarg); + else if (!sdp->orig_fssize && + isdigit(optarg[0])) + sdp->orig_fssize = atol(optarg); + else + die("More than one device specified (try -h for help)\n"); break; default: @@ -192,6 +196,9 @@ decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp) die("no device specified (try -h for help)\n"); if (optind < argc) + sdp->orig_fssize = atol(argv[optind++]); + + if (optind < argc) die("Unrecognized argument: %s\n", argv[optind]); if (sdp->debug) { @@ -210,6 +217,9 @@ decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp) printf(" table = %s\n", sdp->locktable); printf(" utsize = %u\n", sdp->utsize); printf(" device = %s\n", sdp->device_name); + if (sdp->orig_fssize) + printf(" block-count = %llu\n", + (unsigned long long)sdp->orig_fssize); } } @@ -403,6 +413,15 @@ main_mkfs(int argc, char *argv[]) /* Get the device geometry */ device_geometry(sdp); + /* Convert optional block-count to basic blocks */ + if (sdp->orig_fssize) { + sdp->orig_fssize *= sdp->bsize; + sdp->orig_fssize >>= GFS2_BASIC_BLOCK_SHIFT; + if (sdp->orig_fssize > sdp->device.length) + die("specified block count is smaller than the" + "actual device.\n"); + sdp->device.length = sdp->orig_fssize; + } fix_device_geometry(sdp); /* Compute the resource group layouts */ hooks/post-receive -- Cluster Project