public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* Cluster Project branch, master, updated. gfs-kernel_0_1_22-155-g56e13f4
@ 2008-04-11 14:02 rpeterso
  0 siblings, 0 replies; only message in thread
From: rpeterso @ 2008-04-11 14:02 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=56e13f474bc8abf02324e294462527755f8752f4

The branch, master has been updated
       via  56e13f474bc8abf02324e294462527755f8752f4 (commit)
       via  f0454169acbc4190d2c902a1b25cab35282351d5 (commit)
       via  19e98c46738e96f8aa2c4c1719075d8a4d369518 (commit)
       via  0e66ec5001902c704aadc0f6224ce3391ed643c6 (commit)
      from  9fecacd358dba0a191f29e7932281fc862a6ec33 (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 56e13f474bc8abf02324e294462527755f8752f4
Author: Bob Peterson <rpeterso@redhat.com>
Date:   Thu Apr 10 10:45:47 2008 -0500

    Fix some compiler warnings in gfs2_edit

commit f0454169acbc4190d2c902a1b25cab35282351d5
Author: Bob Peterson <rpeterso@redhat.com>
Date:   Thu Apr 10 10:45:47 2008 -0500

    gfs2_edit was not recalculating the max block size after it figured
    that out.

commit 19e98c46738e96f8aa2c4c1719075d8a4d369518
Author: Bob Peterson <rpeterso@redhat.com>
Date:   Tue Mar 18 15:44:24 2008 -0500

    Fix gfs2_edit print options (-p) to work properly for gfs-1
    rgs and rindex.  Also fixed rgflags option for gfs1.

commit 0e66ec5001902c704aadc0f6224ce3391ed643c6
Author: Bob Peterson <rpeterso@redhat.com>
Date:   Tue Mar 11 18:18:43 2008 -0500

    Fix savemeta so it saves gfs-1 rg information properly
    Also add savergs option to facilitate rg-only repairs.

-----------------------------------------------------------------------

Summary of changes:
 gfs2/edit/gfs2hex.c  |   12 ++--
 gfs2/edit/hexedit.c  |  178 +++++++++++++++++++++++++++++++++++++++++---------
 gfs2/edit/hexedit.h  |   32 +++++++++
 gfs2/edit/savemeta.c |   38 +++++++----
 4 files changed, 210 insertions(+), 50 deletions(-)

diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index dfd6c03..7262d78 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -70,9 +70,9 @@ void print_gfs2(const char *fmt, ...)
 	va_start(args, fmt);
 	vsprintf(string, fmt, args);
 	if (termlines)
-		printw(string);
+		printw("%s", string);
 	else
-		printf(string);
+		printf("%s", string);
 	va_end(args);
 }
 
@@ -127,9 +127,9 @@ void print_it(const char *label, const char *fmt, const char *fmt2, ...)
 		vsprintf(tmp_string, fmt, args);
 
 		if (termlines)
-			printw(tmp_string);
+			printw("%s", tmp_string);
 		else
-			printf(tmp_string);
+			printf("%s", tmp_string);
 		check_highlight(FALSE);
 
 		if (fmt2) {
@@ -159,10 +159,10 @@ void print_it(const char *label, const char *fmt, const char *fmt2, ...)
 				fmtstring="(decimal)";
 			if (termlines) {
 				move(line, 50);
-				printw(fmtstring);
+				printw("%s", fmtstring);
 			}
 			else
-				printf(fmtstring);
+				printf("%s", fmtstring);
 		}
 		if (termlines) {
 			refresh();
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index bd4f917..07edf81 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -387,7 +387,7 @@ int display_block_type(const char *lpBuffer, int from_restore)
 	}
 	if (block == RGLIST_DUMMY_BLOCK) {
 		ret_type = GFS2_METATYPE_RG;
-		struct_len = sizeof(struct gfs2_rgrp);
+		struct_len = gfs1 ? sizeof(struct gfs_rgrp) : sizeof(struct gfs2_rgrp);
 	}
 	else if ((ret_type = get_block_type(lpBuffer))) {
 		switch (*(lpBuffer+7)) {
@@ -618,6 +618,17 @@ uint64_t masterblock(const char *fn)
 }
 
 /* ------------------------------------------------------------------------ */
+/* risize - size of one rindex entry, whether gfs1 or gfs2                  */
+/* ------------------------------------------------------------------------ */
+static int risize(void)
+{
+	if (gfs1)
+		return sizeof(struct gfs_rindex);
+	else
+		return sizeof(struct gfs2_rindex);
+}
+
+/* ------------------------------------------------------------------------ */
 /* rgcount - return how many rgrps there are.                               */
 /* ------------------------------------------------------------------------ */
 void rgcount(void)
@@ -633,7 +644,7 @@ void rgcount(void)
 	ribh = bread(&sbd, block);
 	riinode = inode_get(&sbd, ribh);
 	printf("%lld RGs in this file system.\n",
-	       riinode->i_di.di_size / sizeof(struct gfs2_rindex));
+	       riinode->i_di.di_size / risize());
 	inode_put(riinode, not_updated);
 	exit(EXIT_SUCCESS);
 }
@@ -646,10 +657,18 @@ uint64_t find_rgrp_block(struct gfs2_inode *di, int rg)
 	char buf[sizeof(struct gfs2_rindex)];
 	int amt;
 	struct gfs2_rindex ri;
+	uint64_t offset, gfs1_adj = 0;
 
-	amt = gfs2_readi(di, (void *)&buf,
-			 rg * sizeof(struct gfs2_rindex),
-			 sizeof(struct gfs2_rindex));
+	offset = rg * risize();
+	if (gfs1) {
+		uint64_t sd_jbsize =
+			(sbd.bsize - sizeof(struct gfs2_meta_header));
+
+		gfs1_adj = (offset / sd_jbsize) *
+			sizeof(struct gfs2_meta_header);
+		gfs1_adj += sizeof(struct gfs2_meta_header);
+	}
+	amt = gfs2_readi(di, (void *)&buf, offset + gfs1_adj, risize());
 	if (!amt) /* end of file */
 		return 0;
 	gfs2_rindex_in(&ri, buf);
@@ -657,6 +676,55 @@ uint64_t find_rgrp_block(struct gfs2_inode *di, int rg)
 }
 
 /* ------------------------------------------------------------------------ */
+/* gfs_rgrp_in - Read in a resource group header                            */
+/* ------------------------------------------------------------------------ */
+void gfs_rgrp_in(struct gfs_rgrp *rgrp, char *buf)
+{
+	struct gfs_rgrp *str = (struct gfs_rgrp *)buf;
+
+	gfs2_meta_header_in(&rgrp->rg_header, buf);
+	rgrp->rg_flags = be32_to_cpu(str->rg_flags);
+	rgrp->rg_free = be32_to_cpu(str->rg_free);
+	rgrp->rg_useddi = be32_to_cpu(str->rg_useddi);
+	rgrp->rg_freedi = be32_to_cpu(str->rg_freedi);
+	gfs2_inum_in(&rgrp->rg_freedi_list, (char *)&str->rg_freedi_list);
+	rgrp->rg_usedmeta = be32_to_cpu(str->rg_usedmeta);
+	rgrp->rg_freemeta = be32_to_cpu(str->rg_freemeta);
+}
+
+/* ------------------------------------------------------------------------ */
+/* gfs_rgrp_out */
+/* ------------------------------------------------------------------------ */
+void gfs_rgrp_out(struct gfs_rgrp *rgrp, char *buf)
+{
+	struct gfs_rgrp *str = (struct gfs_rgrp *)buf;
+
+	gfs2_meta_header_out(&rgrp->rg_header, buf);
+	str->rg_flags = cpu_to_be32(rgrp->rg_flags);
+	str->rg_free = cpu_to_be32(rgrp->rg_free);
+	str->rg_useddi = cpu_to_be32(rgrp->rg_useddi);
+	str->rg_freedi = cpu_to_be32(rgrp->rg_freedi);
+	gfs2_inum_out(&rgrp->rg_freedi_list, (char *)&str->rg_freedi_list);
+	str->rg_usedmeta = cpu_to_be32(rgrp->rg_usedmeta);
+	str->rg_freemeta = cpu_to_be32(rgrp->rg_freemeta);
+}
+
+/* ------------------------------------------------------------------------ */
+/* gfs_rgrp_print - print a gfs1 resource group                             */
+/* ------------------------------------------------------------------------ */
+void gfs_rgrp_print(struct gfs_rgrp *rg)
+{
+	gfs2_meta_header_print(&rg->rg_header);
+	pv(rg, rg_flags, "%u", "0x%x");
+	pv(rg, rg_free, "%u", "0x%x");
+	pv(rg, rg_useddi, "%u", "0x%x");
+	pv(rg, rg_freedi, "%u", "0x%x");
+	gfs2_inum_print(&rg->rg_freedi_list);
+	pv(rg, rg_usedmeta, "%u", "0x%x");
+	pv(rg, rg_freemeta, "%u", "0x%x");
+}
+
+/* ------------------------------------------------------------------------ */
 /* set_rgrp_flags - Set an rgrp's flags to a given value                    */
 /* rgnum: which rg to print or modify flags for (0 - X)                     */
 /* new_flags: value to set new rg_flags to (if modify == TRUE)              */
@@ -665,7 +733,10 @@ uint64_t find_rgrp_block(struct gfs2_inode *di, int rg)
 /* ------------------------------------------------------------------------ */
 void set_rgrp_flags(int rgnum, uint32_t new_flags, int modify, int full)
 {
-	struct gfs2_rgrp rg;
+	union {
+		struct gfs2_rgrp rg2;
+		struct gfs_rgrp rg1;
+	} rg;
 	struct gfs2_buffer_head *bh, *ribh;
 	uint64_t rgblk, block;
 	struct gfs2_inode *riinode;
@@ -676,34 +747,43 @@ void set_rgrp_flags(int rgnum, uint32_t new_flags, int modify, int full)
 		block = masterblock("rindex");
 	ribh = bread(&sbd, block);
 	riinode = inode_get(&sbd, ribh);
-	if (rgnum >= riinode->i_di.di_size / sizeof(struct gfs2_rindex)) {
+	if (rgnum >= riinode->i_di.di_size / risize()) {
 		fprintf(stderr, "Error: File system only has %lld RGs.\n",
-		       riinode->i_di.di_size / sizeof(struct gfs2_rindex));
+			riinode->i_di.di_size / risize());
 		inode_put(riinode, not_updated);
 		brelse(ribh, not_updated);
 		return;
 	}
 	rgblk = find_rgrp_block(riinode, rgnum);
 	bh = bread(&sbd, rgblk);
-	gfs2_rgrp_in(&rg, bh->b_data);
+	if (gfs1)
+		gfs_rgrp_in(&rg.rg1, bh->b_data);
+	else
+		gfs2_rgrp_in(&rg.rg2, bh->b_data);
 	if (modify) {
 		printf("RG #%d (block %llu / 0x%llx) rg_flags changed from 0x%08x to 0x%08x\n",
 		       rgnum, (unsigned long long)rgblk,
-		       (unsigned long long)rgblk, rg.rg_flags, new_flags);
-		rg.rg_flags = new_flags;
-		gfs2_rgrp_out(&rg, bh->b_data);
+		       (unsigned long long)rgblk, rg.rg2.rg_flags, new_flags);
+		rg.rg2.rg_flags = new_flags;
+		if (gfs1)
+			gfs_rgrp_out(&rg.rg1, bh->b_data);
+		else
+			gfs2_rgrp_out(&rg.rg2, bh->b_data);
 		brelse(bh, updated);
 	} else {
 		if (full) {
 			print_gfs2("RG #%d", rgnum);
 			print_gfs2(" located at: %llu (0x%llx)", rgblk, rgblk);
                         eol(0);
-			gfs2_rgrp_print(&rg);
+			if (gfs1)
+				gfs_rgrp_print(&rg.rg1);
+			else
+				gfs2_rgrp_print(&rg.rg2);
 		}
 		else
 			printf("RG #%d (block %llu / 0x%llx) rg_flags = 0x%08x\n",
 			       rgnum, (unsigned long long)rgblk,
-			       (unsigned long long)rgblk, rg.rg_flags);
+			       (unsigned long long)rgblk, rg.rg2.rg_flags);
 		brelse(bh, not_updated);
 	}
 	inode_put(riinode, not_updated);
@@ -718,20 +798,36 @@ int parse_rindex(struct gfs2_inode *di, int print_rindex)
 {
 	int error, start_line;
 	struct gfs2_rindex ri;
-	char buf[sizeof(struct gfs2_rindex)];
+	char buf[sizeof(struct gfs_rindex)];
 	char highlighted_addr[32];
 
 	start_line = line;
 	error = 0;
-	print_gfs2("RG index entries found: %d.",
-			   di->i_di.di_size / sizeof(struct gfs2_rindex));
+	print_gfs2("RG index entries found: %d.", di->i_di.di_size / risize());
 	eol(0);
 	lines_per_row[dmode] = 6;
 	memset(highlighted_addr, 0, sizeof(highlighted_addr));
+	if (gfs1) {
+		/* gfs1 rindex files have the meta_header which is not
+		   accounted for in gfs2's dinode size.  Therefore, adjust. */
+		di->i_di.di_size += ((di->i_di.di_size / sbd.bsize) + 1) *
+			sizeof(struct gfs2_meta_header);
+	}
 	for (print_entry_ndx=0; ; print_entry_ndx++) {
-		error = gfs2_readi(di, (void *)&buf,
-				   print_entry_ndx * sizeof(struct gfs2_rindex),
-				   sizeof(struct gfs2_rindex));
+		uint64_t gfs1_adj = 0;
+		uint64_t offset = print_entry_ndx * risize();
+
+		if (gfs1) {
+			uint64_t sd_jbsize =
+				(sbd.bsize - sizeof(struct gfs2_meta_header));
+
+			gfs1_adj = (offset / sd_jbsize) *
+				sizeof(struct gfs2_meta_header);
+			gfs1_adj += sizeof(struct gfs2_meta_header);
+		}
+
+		error = gfs2_readi(di, (void *)&buf, offset + gfs1_adj,
+				   risize());
 		if (!error) /* end of file */
 			break;
 		gfs2_rindex_in(&ri, buf);
@@ -753,12 +849,18 @@ int parse_rindex(struct gfs2_inode *di, int print_rindex)
 			if(print_rindex)
 				gfs2_rindex_print(&ri);
 			else {
-				struct gfs2_rgrp rg;
 				struct gfs2_buffer_head *tmp_bh;
 
 				tmp_bh = bread(&sbd, ri.ri_addr);
-				gfs2_rgrp_in(&rg, tmp_bh->b_data);
-				gfs2_rgrp_print(&rg);
+				if (gfs1) {
+					struct gfs_rgrp rg1;
+					gfs_rgrp_in(&rg1, tmp_bh->b_data);
+					gfs_rgrp_print(&rg1);
+				} else {
+					struct gfs2_rgrp rg;
+					gfs2_rgrp_in(&rg, tmp_bh->b_data);
+					gfs2_rgrp_print(&rg);
+				}
 				brelse(tmp_bh, not_updated);
 			}
 			last_entry_onscreen[dmode] = print_entry_ndx;
@@ -1283,7 +1385,10 @@ int display_extended(void)
 	else if (display_indirect(indirect, indirect_blocks, 0, 0) == 0)
 		return -1;
 	else if (block_is_rglist()) {
-		tmp_bh = bread(&sbd, masterblock("rindex"));
+		if (gfs1)
+			tmp_bh = bread(&sbd, sbd1->sb_rindex_di.no_addr);
+		else
+			tmp_bh = bread(&sbd, masterblock("rindex"));
 		tmp_inode = inode_get(&sbd, tmp_bh);
 		parse_rindex(tmp_inode, FALSE);
 		brelse(tmp_bh, not_updated);
@@ -1380,9 +1485,12 @@ int display(int identify_only)
 {
 	uint64_t blk;
 
-	if (block == RGLIST_DUMMY_BLOCK)
-		blk = masterblock("rindex");
-	else
+	if (block == RGLIST_DUMMY_BLOCK) {
+		if (gfs1)
+			blk = sbd1->sb_rindex_di.no_addr;
+		else
+			blk = masterblock("rindex");
+	} else
 		blk = block;
 	if (termlines) {
 		display_title_lines();
@@ -1534,6 +1642,8 @@ uint64_t goto_block(void)
 					temp_blk = sbd1->sb_rindex_di.no_addr;
 				else if (!strcmp(string, "quota"))
 					temp_blk = gfs1_quota_di.no_addr;
+				else if (!strcmp(string, "rgs"))
+					temp_blk = RGLIST_DUMMY_BLOCK;
 			}
 			else {
 				if (!strcmp(string, "rgs"))
@@ -2183,6 +2293,7 @@ void usage(void)
 	fprintf(stderr,"savemeta <file_system> <file> - save off your metadata for analysis and debugging.\n");
 	fprintf(stderr,"   (The intelligent way: assume bitmap is correct).\n");
 	fprintf(stderr,"savemetaslow - save off your metadata for analysis and debugging.  The SLOW way (block by block).\n");
+	fprintf(stderr,"savergs - save off only the resource group information (rindex and rgs).\n");
 	fprintf(stderr,"restoremeta - restore metadata for debugging (DANGEROUS).\n");
 	fprintf(stderr,"rgcount - print how many RGs in the file system.\n");
 	fprintf(stderr,"rgflags rgnum [new flags] - print or modify flags for rg #rgnum (0 - X)\n");
@@ -2261,6 +2372,8 @@ void process_parameters(int argc, char *argv[], int pass)
 				termlines = 0;
 			else if (!strcasecmp(argv[i], "savemetaslow"))
 				termlines = 0;
+			else if (!strcasecmp(argv[i], "savergs"))
+				termlines = 0;
 			else if (!strcasecmp(argv[i], "printsavedmeta"))
 				restoremeta(argv[i+1], argv[i+2],
 					    TRUE);
@@ -2318,8 +2431,7 @@ void process_parameters(int argc, char *argv[], int pass)
 						push_block(masterblock("rindex"));
 				}
 				else if (!strcmp(argv[i], "rgs")) {
-					if (!gfs1)
-						push_block(RGLIST_DUMMY_BLOCK);
+					push_block(RGLIST_DUMMY_BLOCK);
 				}
 				else if (!strcmp(argv[i], "quota")) {
 					if (gfs1)
@@ -2379,9 +2491,11 @@ void process_parameters(int argc, char *argv[], int pass)
 					exit(EXIT_SUCCESS);
 				}
 				else if (!strcasecmp(argv[i], "savemeta"))
-					savemeta(argv[i+2], FALSE);
+					savemeta(argv[i+2], 0);
 				else if (!strcasecmp(argv[i], "savemetaslow"))
-					savemeta(argv[i+2], TRUE);
+					savemeta(argv[i+2], 1);
+				else if (!strcasecmp(argv[i], "savergs"))
+					savemeta(argv[i+2], 2);
 				else if (argv[i][0]=='0' && argv[i][1]=='x') { /* hex addr */
 					sscanf(argv[i], "%"SCNx64, &temp_blk);/* retrieve in hex */
 					push_block(temp_blk);
@@ -2457,6 +2571,8 @@ int main(int argc, char *argv[])
 	max_block = lseek(fd, 0, SEEK_END) / bufsize;
 
 	read_superblock(fd);
+	max_block = lseek(fd, 0, SEEK_END) / bufsize;
+	blockstack[0].block = 0x10 * (4096 / bufsize);
 	strcpy(sbd.device_name, device);
 	if (!gfs1)
 		read_master_dir();
diff --git a/gfs2/edit/hexedit.h b/gfs2/edit/hexedit.h
index 4778ab1..40cf47c 100644
--- a/gfs2/edit/hexedit.h
+++ b/gfs2/edit/hexedit.h
@@ -135,6 +135,38 @@ struct gfs_log_header {
 	char lh_reserved[64];
 };
 
+struct gfs_rindex {
+	uint64_t ri_addr;     /* block # of 1st block (header) in rgrp */
+	uint32_t ri_length;   /* # fs blocks containing rgrp header & bitmap */
+	uint32_t ri_pad;
+
+	uint64_t ri_data1;    /* block # of first data/meta block in rgrp */
+	uint32_t ri_data;     /* number (qty) of data/meta blocks in rgrp */
+
+	uint32_t ri_bitbytes; /* total # bytes used by block alloc bitmap */
+
+	char ri_reserved[64];
+};
+
+struct gfs_rgrp {
+	struct gfs2_meta_header rg_header;
+
+	uint32_t rg_flags;      /* ?? */
+
+	uint32_t rg_free;       /* Number (qty) of free data blocks */
+
+	/* Dinodes are USEDMETA, but are handled separately from other METAs */
+	uint32_t rg_useddi;     /* Number (qty) of dinodes (used or free) */
+	uint32_t rg_freedi;     /* Number (qty) of unused (free) dinodes */
+	struct gfs2_inum rg_freedi_list; /* 1st block in chain of free dinodes */
+
+	/* These META statistics do not include dinodes (used or free) */
+	uint32_t rg_usedmeta;   /* Number (qty) of used metadata blocks */
+	uint32_t rg_freemeta;   /* Number (qty) of unused metadata blocks */
+
+	char rg_reserved[64];
+};
+
 EXTERN int block_is_jindex(void);
 EXTERN int block_is_rindex(void);
 EXTERN int block_is_inum_file(void);
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index c73dc09..d582304 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -631,7 +631,7 @@ void save_inode_data(int out_fd)
 	/* Process directory exhash inodes */
 	if (S_ISDIR(inode->i_di.di_mode)) {
 		if (inode->i_di.di_flags & GFS2_DIF_EXHASH) {
-			save_indirect_blocks(out_fd, cur_list, mybh,
+			save_indirect_blocks(out_fd, cur_list, metabh,
 					     height, 0);
 		}
 	}
@@ -701,7 +701,9 @@ void get_journal_inode_blocks(void)
 			struct gfs_jindex ji;
 			char jbuf[sizeof(struct gfs_jindex)];
 
+			bh = bread(&sbd, sbd1->sb_jindex_di.no_addr);
 			j_inode = inode_get(&sbd, bh);
+			brelse(bh, not_updated);
 			amt = gfs2_readi(j_inode, (void *)&jbuf,
 					 journal * sizeof(struct gfs_jindex),
 					 sizeof(struct gfs_jindex));
@@ -709,7 +711,6 @@ void get_journal_inode_blocks(void)
 				break;
 			gfs_jindex_in(&ji, jbuf);
 			jblock = ji.ji_addr;
-			inode_put(j_inode, not_updated);
 		} else {
 			if (journal > indirect->ii[0].dirents - 3)
 				break;
@@ -723,15 +724,17 @@ void get_journal_inode_blocks(void)
 	}
 }
 
-void savemeta(const char *out_fn, int slow)
+void savemeta(const char *out_fn, int saveoption)
 {
 	int out_fd;
+	int slow;
 	osi_list_t *tmp;
 	uint64_t memreq;
 	int rgcount;
 	uint64_t jindex_block;
 	struct gfs2_buffer_head *bh;
 
+	slow = (saveoption == 1);
 	sbd.md.journals = 1;
 
 	if (!out_fn)
@@ -760,7 +763,7 @@ void savemeta(const char *out_fn, int slow)
 			osi_list_init(&sbd.buf_hash[i]);
 		sbd.sd_sb.sb_bsize = GFS2_DEFAULT_BSIZE;
 		compute_constants(&sbd);
-		if(read_sb(&sbd) < 0)
+		if(!gfs1 && read_sb(&sbd) < 0)
 			slow = TRUE;
 		else
 			bufsize = sbd.bsize = sbd.sd_sb.sb_bsize;
@@ -808,6 +811,13 @@ void savemeta(const char *out_fn, int slow)
 	if (!slow) {
 		/* Save off the superblock */
 		save_block(sbd.device_fd, out_fd, 0x10 * (4096 / bufsize));
+		/* If this is gfs1, save off the rindex because it's not
+		   part of the file system as it is in gfs2. */
+		if (gfs1) {
+			block = sbd1->sb_rindex_di.no_addr;
+			save_block(sbd.device_fd, out_fd, block);
+			save_inode_data(out_fd);
+		}
 		/* Walk through the resource groups saving everything within */
 		for (tmp = sbd.rglist.next; tmp != &sbd.rglist;
 		     tmp = tmp->next){
@@ -834,15 +844,17 @@ void savemeta(const char *out_fn, int slow)
 				save_block(sbd.device_fd, out_fd, block);
 			}
 			/* Save off the other metadata: inodes, etc. */
-			while (!gfs2_next_rg_meta(rgd, &block, first)) {
-				int blktype;
-
-				warm_fuzzy_stuff(block, FALSE, TRUE);
-				blktype = save_block(sbd.device_fd, out_fd,
-						     block);
-				if (blktype == GFS2_METATYPE_DI)
-					save_inode_data(out_fd);
-				first = 0;
+			if (saveoption != 2) {
+				while (!gfs2_next_rg_meta(rgd, &block, first)) {
+					int blktype;
+
+					warm_fuzzy_stuff(block, FALSE, TRUE);
+					blktype = save_block(sbd.device_fd,
+							     out_fd, block);
+					if (blktype == GFS2_METATYPE_DI)
+						save_inode_data(out_fd);
+					first = 0;
+				}
 			}
 			gfs2_rgrp_relse(rgd, not_updated);
 		}


hooks/post-receive
--
Cluster Project


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

only message in thread, other threads:[~2008-04-11 14:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-11 14:02 Cluster Project branch, master, updated. gfs-kernel_0_1_22-155-g56e13f4 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).