public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* Cluster Project branch, STABLE2, updated. cluster-2.03.04-1-g5f3baac
@ 2008-06-11 20:10 rpeterso
  0 siblings, 0 replies; only message in thread
From: rpeterso @ 2008-06-11 20:10 UTC (permalink / raw)
  To: cluster-cvs, cluster-devel

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=5f3baac6a84cc3cf78061a799325eb2102e209a6

The branch, STABLE2 has been updated
       via  5f3baac6a84cc3cf78061a799325eb2102e209a6 (commit)
      from  4ce57de84bf434983af8c6c352cecc5d78806808 (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 5f3baac6a84cc3cf78061a799325eb2102e209a6
Author: Bob Peterson <rpeterso@redhat.com>
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 4bb726c..279c12f 100644
--- a/gfs2/man/mkfs.gfs2.8
+++ b/gfs2/man/mkfs.gfs2.8
@@ -5,7 +5,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.
@@ -20,7 +20,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
@@ -70,12 +70,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 8a2059a..38af2b9 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -42,7 +42,7 @@ print_usage(void)
 {
 	printf("Usage:\n");
 	printf("\n");
-	printf("%s [options] <device>\n", prog_name);
+	printf("%s [options] <device> [ block-count ]\n", prog_name);
 	printf("\n");
 	printf("Options:\n");
 	printf("\n");
@@ -77,6 +77,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");
@@ -160,10 +161,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:
@@ -179,6 +183,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) {
@@ -197,6 +204,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);
 	}
 }
 
@@ -390,6 +400,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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-06-11 20:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-11 20:10 Cluster Project branch, STABLE2, updated. cluster-2.03.04-1-g5f3baac rpeterso

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).