All of lore.kernel.org
 help / color / mirror / Atom feed
From: rpeterso@sourceware.org <rpeterso@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/gfs/gfs_fsck block_list.c block_list.h
Date: 10 Aug 2006 20:10:50 -0000	[thread overview]
Message-ID: <20060810201050.30035.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	rpeterso at sourceware.org	2006-08-10 20:10:48

Modified files:
	gfs/gfs_fsck   : block_list.c block_list.h 

Log message:
	Make block_list use a consistent set of values rather than
	enum values in one place and #defines in another, and trying
	to keep them in sync.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs/gfs_fsck/block_list.c.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs/gfs_fsck/block_list.h.diff?cvsroot=cluster&r1=1.1&r2=1.2

--- cluster/gfs/gfs_fsck/block_list.c	2005/02/28 15:44:46	1.2
+++ cluster/gfs/gfs_fsck/block_list.c	2006/08/10 20:10:48	1.3
@@ -20,33 +20,12 @@
 #include "block_list.h"
 #include "fsck.h"
 
-#define FREE		(0x0)  /*   0000 */
-#define BLOCK_IN_USE	(0x1)  /*   0001 */
-
-#define DIR_INDIR_BLK	(0x2)  /*   0010 */
-#define DIR_INODE	(0x3)  /*   0011 */
-#define FILE_INODE	(0x4)  /*   0100 */
-#define LNK_INODE	(0x5)
-#define BLK_INODE	(0x6)
-#define CHR_INODE	(0x7)
-#define FIFO_INODE	(0x8)
-#define SOCK_INODE	(0x9)
-#define DIR_LEAF_INODE  (0xA)  /*   1010 */
-#define JOURNAL_BLK     (0xB)  /*   1011 */
-#define OTHER_META	(0xC)  /*   1100 */
-#define FREE_META	(0xD)  /*   1101 */
-#define EATTR_META	(0xE)  /*   1110 */
-
-#define INVALID_META	(0xF)  /*   1111 */
-
-
 /* Must be kept in sync with mark_block enum in block_list.h */
-/* FIXME: Fragile */
 static int mark_to_gbmap[16] = {
-	FREE, BLOCK_IN_USE, DIR_INDIR_BLK, DIR_INODE, FILE_INODE,
-	LNK_INODE, BLK_INODE, CHR_INODE, FIFO_INODE, SOCK_INODE,
-	DIR_LEAF_INODE, JOURNAL_BLK, OTHER_META, FREE_META,
-	EATTR_META, INVALID_META
+	block_free, block_used, indir_blk, inode_dir, inode_file,
+	inode_lnk, inode_blk, inode_chr, inode_fifo, inode_sock,
+	leaf_blk, journal_blk, meta_other, meta_free,
+	meta_eattr, meta_inval
 };
 
 struct block_list *block_list_create(uint64_t size, enum block_list_type type)
@@ -241,8 +220,7 @@
 
 			switch(m) {
 			case dup_block:
-				if(bitmap_get(&il->list.gbmap.dup_map, i,
-					      &val)) {
+				if(bitmap_get(&il->list.gbmap.dup_map, i, &val)) {
 					stack;
 					return -1;
 				}
@@ -251,8 +229,7 @@
 					found = 1;
 				break;
 			case eattr_block:
-				if(bitmap_get(&il->list.gbmap.eattr_map, i,
-					      &val)) {
+				if(bitmap_get(&il->list.gbmap.eattr_map, i, &val)) {
 					stack;
 					return -1;
 				}
--- cluster/gfs/gfs_fsck/block_list.h	2005/02/01 17:47:11	1.1
+++ cluster/gfs/gfs_fsck/block_list.h	2006/08/10 20:10:48	1.2
@@ -26,24 +26,25 @@
 /* Must be kept in sync with mark_to_bitmap array in block_list.c */
 enum mark_block {
 	block_free = 0,
-	block_used,
-	indir_blk,
-	inode_dir,
-	inode_file,
-	inode_lnk,
-	inode_blk,
-	inode_chr,
-	inode_fifo,
-	inode_sock,
-	leaf_blk,
-	journal_blk,
-	meta_other,
-	meta_free,
-	meta_eattr,
+	block_used = 1,
+	indir_blk = 2,
+	inode_dir = 3,
+	inode_file = 4,
+	inode_lnk = 5,
+	inode_blk = 6,
+	inode_chr = 7,
+	inode_fifo = 8,
+	inode_sock = 9,
+	leaf_blk = 10,
+	journal_blk = 11,
+	meta_other = 12,
+	meta_free = 13,
+	meta_eattr = 14,
 	meta_inval = 15,
-	bad_block,	/* Contains at least one bad block */
-	dup_block,	/* Contains at least one duplicate block */
-	eattr_block,	/* Contains an eattr */
+	/* above this are nibble-values 0x0-0xf */
+	bad_block = 16,	/* Contains at least one bad block */
+	dup_block = 17,	/* Contains at least one duplicate block */
+	eattr_block = 18,	/* Contains an eattr */
 };
 
 struct block_query {



                 reply	other threads:[~2006-08-10 20:10 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=20060810201050.30035.qmail@sourceware.org \
    --to=rpeterso@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.