All of lore.kernel.org
 help / color / mirror / Atom feed
From: adas@sourceware.org <adas@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/gfs2/mkfs main_jadd.c
Date: 20 Jul 2006 22:54:27 -0000	[thread overview]
Message-ID: <20060720225427.26955.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	adas at sourceware.org	2006-07-20 22:54:26

Modified files:
	gfs2/mkfs      : main_jadd.c 

Log message:
	gfs2 doesn't allow gfs2meta and gfs2 filesystems to run parallely. gfs2_jadd umounts gfs2 and mounts gfs2meta to do its thing. Removed test mode. little-endian to big-endian change on disk-hash.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mkfs/main_jadd.c.diff?cvsroot=cluster&r1=1.6&r2=1.7

--- cluster/gfs2/mkfs/main_jadd.c	2006/07/10 22:51:10	1.6
+++ cluster/gfs2/mkfs/main_jadd.c	2006/07/20 22:54:25	1.7
@@ -115,7 +115,6 @@
 	printf("  -J <MB>           Size of journals\n");
 	printf("  -j <num>          Number of journals\n");
 	printf("  -q                Don't print anything\n");
-	printf("  -T                Test, do everything except update FS\n");
 	printf("  -V                Print program version information, then exit\n");
 }
 
@@ -134,7 +133,7 @@
 	int optchar;
 	
 	while (cont) {
-		optchar = getopt(argc, argv, "c:DhJ:j:qTu:VX");
+		optchar = getopt(argc, argv, "c:DhJ:j:qu:VX");
 		
 		switch (optchar) {
 		case 'c':
@@ -156,9 +155,6 @@
 		case 'q':
 			sdp->quiet = TRUE;
 			break;
-		case 'T':
-			sdp->test = TRUE;
-			break;
 		case 'V':
 			printf("gfs2_jadd %s (built %s %s)\n", GFS2_RELEASE_NAME,
 			       __DATE__, __TIME__);
@@ -197,7 +193,6 @@
 		printf("  jsize = %u\n", sdp->jsize);
 		printf("  journals = %u\n", sdp->md.journals);
 		printf("  quiet = %d\n", sdp->quiet);
-		printf("  test = %d\n", sdp->test);
 		printf("  path = %s\n", sdp->path_name);
 	}
 }
@@ -227,8 +222,6 @@
 	else if (sdp->quiet)
 		return;
 
-	if (sdp->test)
-		printf("Test mode:              on\n");
 	if (sdp->expert)
 		printf("Expert mode:            on\n");
 
@@ -236,8 +229,6 @@
 	printf("Old Journals           %u\n", sdp->orig_journals);
 	printf("New Journals           %u\n", sdp->md.journals);
 
-	if (sdp->test)
-		printf("\nThe filesystem was not modified.\n");
 }
 
 int 
@@ -282,14 +273,14 @@
 		memset(&ir, 0, sizeof(struct gfs2_inum_range));
 		do_write(fd, (void*)&ir, sizeof(struct gfs2_inum_range));
 	}
-
+	
 	close(fd);
 	
 	sprintf(new_name, "inum_range%u", sdp->md.journals);
 	error = rename2system(sdp, "per_node", new_name);
 	if (error < 0 && errno != EEXIST)
 		die("can't rename2system %s (%d): %s\n", 
-		    new_name, error, strerror(errno));
+		new_name, error, strerror(errno));
 }
 
 void 
@@ -477,7 +468,7 @@
 			lh.lh_blkno = x;
 			gfs2_log_header_out(&lh, buf);
 			hash = gfs2_disk_hash(buf, sizeof(struct gfs2_log_header));
-			((struct gfs2_log_header *)buf)->lh_hash = cpu_to_le32(hash);
+			((struct gfs2_log_header *)buf)->lh_hash = cpu_to_be32(hash);
 
 			do_write(fd, buf, sdp->bsize);
 
@@ -563,8 +554,6 @@
 {
 	int ret;
 	/* mount the meta fs */
-	fprintf(stderr, "mount %s %s %s %d\n", sdp->device_name,
-		meta_mount, "gfs2_meta", 0);
 	if (!dir_exists(meta_mount)) {
 		ret = mkdir(meta_mount, 0700);
 		if (ret)
@@ -663,6 +652,11 @@
 	check_for_gfs2(sdp);
 
 	gather_info(sdp);
+	/* umount gfs2 to be able to mount gfs2meta */
+	{
+		close(sdp->path_fd);
+		umount(sdp->path_name);
+	}
 	if (!find_gfs2_meta(sdp))
 		mount_gfs2_meta(sdp);
 	lock_for_admin(sdp);
@@ -681,7 +675,7 @@
 	}
 
 	close(metafs_fd);
-	close(sdp->path_fd);
+	//close(sdp->path_fd);
 
 	cleanup(sdp);
 



             reply	other threads:[~2006-07-20 22:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-20 22:54 adas [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-08-30 18:32 [Cluster-devel] cluster/gfs2/mkfs main_jadd.c adas
2006-09-28 16:23 adas

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=20060720225427.26955.qmail@sourceware.org \
    --to=adas@sourceware.org \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.