[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

NEEDS_RECOVERY flag



Hi,

I tried Andreas' patch (attached)  and it works great. 

- Peter -

-- 
diff -ru linux-2.2.18-pre21.orig/fs/ext3/balloc.c linux-2.2.18-pre21/fs/ext3/balloc.c
--- linux-2.2.18-pre21.orig/fs/ext3/balloc.c	Sat Nov 18 17:42:58 2000
+++ linux-2.2.18-pre21/fs/ext3/balloc.c	Sat Nov 18 08:49:16 2000
@@ -778,7 +778,7 @@
 			 EXT3_BLOCKS_PER_GROUP(sb), map);
 }
 
-static int test_root(int a, int b)
+static inline int test_root(int a, int b)
 {
 	if (a == 0)
 		return 1;
@@ -791,12 +791,45 @@
 	}
 }
 
-int ext3_group_sparse(int group)
+static inline int ext3_group_sparse(int group)
 {
 	return (test_root(group, 3) || test_root(group, 5) ||
 		test_root(group, 7));
 }
 
+/**
+ *	ext3_bg_has_super - number of blocks used by the superblock in group
+ *	@sb: superblock for filesystem
+ *	@group: group number to check
+ *
+ *	Return the number of blocks used by the superblock (primary or backup)
+ *	in this group.  Currently this will be only 0 or 1.
+ */
+int ext3_bg_has_super(struct super_block * sb, int group)
+{
+	if (EXT3_HAS_RO_COMPAT_FEATURE(sb,EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER)&&
+	    !ext3_group_sparse(group))
+		return 0;
+	return 1;
+}
+
+/**
+ *	ext3_bg_num_gdb - number of blocks used by the group table in group
+ *	@sb: superblock for filesystem
+ *	@group: group number to check
+ *
+ *	Return the number of blocks used by the group descriptor table
+ *	(primary or backup) in this group.  In the future there may be a
+ *	different number of descriptor blocks in each group.
+ */
+unsigned long ext3_bg_num_gdb(struct super_block * sb, int group)
+{
+	if (EXT3_HAS_RO_COMPAT_FEATURE(sb,EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER)&&
+	    !ext3_group_sparse(group))
+		return 0;
+	return EXT3_SB(sb)->s_gdb_count;
+}
+
 void ext3_check_blocks_bitmap (struct super_block * sb)
 {
 	struct buffer_head * bh;
@@ -812,8 +845,6 @@
 	desc_count = 0;
 	bitmap_count = 0;
 	gdp = NULL;
-	desc_blocks = (sb->u.ext3_sb.s_groups_count + EXT3_DESC_PER_BLOCK(sb) - 1) /
-		      EXT3_DESC_PER_BLOCK(sb);
 	for (i = 0; i < sb->u.ext3_sb.s_groups_count; i++) {
 		gdp = ext3_get_group_desc (sb, i, NULL);
 		if (!gdp)
@@ -822,24 +853,19 @@
 		bitmap_nr = load_block_bitmap (sb, i);
 		if (bitmap_nr < 0)
 			continue;
-		
-		bh = sb->u.ext3_sb.s_block_bitmap[bitmap_nr];
 
-		if (!(sb->u.ext3_sb.s_feature_ro_compat &
-		     EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER) ||
-		    ext3_group_sparse(i)) {
-			if (!ext3_test_bit (0, bh->b_data))
-				ext3_error (sb, "ext3_check_blocks_bitmap",
-					    "Superblock in group %d "
-					    "is marked free", i);
+		bh = EXT3_SB(sb)->s_block_bitmap[bitmap_nr];
 
-			for (j = 0; j < desc_blocks; j++)
-				if (!ext3_test_bit (j + 1, bh->b_data))
-					ext3_error (sb,
-					    "ext3_check_blocks_bitmap",
-					    "Descriptor block #%d in group "
-					    "%d is marked free", j, i);
-		}
+		if (ext3_bg_has_super(sb, i) && !ext3_test_bit(0, bh->b_data))
+			ext3_error(sb, __FUNCTION__,
+				   "Superblock in group %d is marked free", i);
+
+		desc_blocks = ext3_bg_num_gdb(sb, i);
+		for (j = 0; j < ext3_bg_num_gdb(sb, i); j++)
+			if (!ext3_test_bit(j + 1, bh->b_data))
+				ext3_error(sb, __FUNCTION__,
+					   "Descriptor block #%d in group "
+					   "%d is marked free", j, i);
 
 		if (!block_in_use (le32_to_cpu(gdp->bg_block_bitmap), sb, bh->b_data))
 			ext3_error (sb, "ext3_check_blocks_bitmap",
diff -ru linux-2.2.18-pre21.orig/fs/ext3/file.c linux-2.2.18-pre21/fs/ext3/file.c
--- linux-2.2.18-pre21.orig/fs/ext3/file.c	Sat Nov 18 17:42:58 2000
+++ linux-2.2.18-pre21/fs/ext3/file.c	Sat Nov 18 08:49:16 2000
@@ -265,14 +265,15 @@
 				goto error_out;
 			}
 		}
-		if (((pos + count) >> 31) && 
-		    !(sb->u.ext3_sb.s_es->s_feature_ro_compat &
-		      cpu_to_le32(EXT3_FEATURE_RO_COMPAT_LARGE_FILE))) {
+		if (((pos + count) >> 31) &&
+		    !EXT3_HAS_RO_COMPAT_FEATURE(sb,
+					EXT3_FEATURE_RO_COMPAT_LARGE_FILE)) {
 			/* If this is the first large file created, add a flag
 			   to the superblock */
 			journal_get_write_access(handle, sb->u.ext3_sb.s_sbh);
-			sb->u.ext3_sb.s_es->s_feature_ro_compat |=
-				cpu_to_le32(EXT3_FEATURE_RO_COMPAT_LARGE_FILE);
+			ext3_update_fs_rev(sb);
+			EXT3_SET_INCOMPAT_FEATURE(sb,
+					EXT3_FEATURE_RO_COMPAT_LARGE_FILE);
 			journal_dirty_metadata(handle, sb->u.ext3_sb.s_sbh);
 		}
 	}
diff -ru linux-2.2.18-pre21.orig/fs/ext3/inode.c linux-2.2.18-pre21/fs/ext3/inode.c
--- linux-2.2.18-pre21.orig/fs/ext3/inode.c	Sat Nov 18 17:42:58 2000
+++ linux-2.2.18-pre21/fs/ext3/inode.c	Sat Nov 18 08:52:15 2000
@@ -857,18 +857,19 @@
 			struct super_block *sb = inode->i_sb;
 			struct ext3_super_block *es = sb->u.ext3_sb.s_es;
 
-			if (!(es->s_feature_ro_compat &
-			      cpu_to_le32(EXT3_FEATURE_RO_COMPAT_LARGE_FILE))){
+			if (!EXT3_HAS_INCOMPAT_FEATURE(sb,
+					EXT3_FEATURE_RO_COMPAT_LARGE_FILE)) {
 				struct buffer_head *bh = sb->u.ext3_sb.s_sbh;
-				
+
 				handle = ext3_journal_start(inode, 1);
 				if (IS_ERR(handle))
 					return PTR_ERR(handle);
 
 				/* If this is the first large file
 				 * created, add a flag to the superblock */
-				es->s_feature_ro_compat |=
-				cpu_to_le32(EXT3_FEATURE_RO_COMPAT_LARGE_FILE);
+				ext3_update_fs_rev(sb);
+				EXT3_SET_RO_COMPAT_FEATURE(sb,
+					EXT3_FEATURE_RO_COMPAT_LARGE_FILE);
 				journal_dirty_metadata(handle, bh); /*@@@err*/
 				ext3_journal_stop(handle, inode);
 			}
diff -ru linux-2.2.18-pre21.orig/fs/ext3/super.c linux-2.2.18-pre21/fs/ext3/super.c
--- linux-2.2.18-pre21.orig/fs/ext3/super.c	Sat Nov 18 17:42:58 2000
+++ linux-2.2.18-pre21/fs/ext3/super.c	Sat Nov 18 17:13:56 2000
@@ -159,6 +159,31 @@
 		bdevname(sb->s_dev), function, error_buf);
 }
 
+void ext3_update_fs_rev(struct super_block *sb)
+{
+	struct ext3_super_block *es = EXT3_SB(sb)->s_es;
+
+	if (le32_to_cpu(es->s_rev_level) > EXT3_GOOD_OLD_REV)
+		return;
+
+	ext3_warning(sb, __FUNCTION__,
+		     "updating to rev %d because of new feature flag, "
+		     "running e2fsck is recommended",
+		     EXT3_DYNAMIC_REV);
+
+	es->s_rev_level = cpu_to_le32(EXT3_DYNAMIC_REV);
+	es->s_first_ino = cpu_to_le32(EXT3_FIRST_INO(sb));
+	es->s_inode_size = cpu_to_le16(EXT3_INODE_SIZE(sb));
+	/* leave es->s_feature_*compat flags alone */
+	/* es->s_uuid will be set by e2fsck if empty */
+
+	/*
+	 * the rest of the superblock fields should be zero, and if not it
+	 * means they are likely already in use, so leave them alone.  We
+	 * can leave it up to e2fsck to clean up any inconsistencies there.
+	 */
+}
+
 void ext3_put_super (struct super_block * sb)
 {
 	int db_count;
@@ -167,12 +192,12 @@
 
 	journal_release(EXT3_SB(sb)->s_journal);
 	if (!(sb->s_flags & MS_RDONLY)) {
-		es->s_feature_incompat &= cpu_to_le32(~EXT3_FEATURE_INCOMPAT_RECOVER);
+		EXT3_CLEAR_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER);
 		es->s_state = le16_to_cpu(EXT3_SB(sb)->s_mount_state);
 		mark_buffer_dirty(EXT3_SB(sb)->s_sbh, 1);
 	}
 
-	db_count = EXT3_SB(sb)->s_db_per_group;
+	db_count = EXT3_SB(sb)->s_gdb_count;
 	for (i = 0; i < db_count; i++)
 		if (EXT3_SB(sb)->s_group_desc[i])
 			brelse (EXT3_SB(sb)->s_group_desc[i]);
@@ -399,9 +424,9 @@
 			      struct ext3_super_block * es)
 {
 	if (le32_to_cpu(es->s_rev_level) > EXT3_MAX_SUPP_REV) {
-			printk ("EXT3-fs warning: revision level too high, "
-				"forcing read/only mode\n");
-			sb->s_flags |= MS_RDONLY;
+		printk ("EXT3-fs warning: revision level too high, "
+			"forcing read-only mode\n");
+		sb->s_flags |= MS_RDONLY;
 	}
 	if (!(sb->s_flags & MS_RDONLY)) {
 		if (!(sb->u.ext3_sb.s_mount_state & EXT3_VALID_FS))
@@ -431,7 +456,8 @@
 			es->s_max_mnt_count = (__s16) cpu_to_le16(EXT3_DFL_MAX_MNT_COUNT);
 		es->s_mnt_count=cpu_to_le16(le16_to_cpu(es->s_mnt_count) + 1);
 		es->s_mtime = cpu_to_le32(CURRENT_TIME);
-		es->s_feature_incompat |= cpu_to_le32(EXT3_FEATURE_INCOMPAT_RECOVER);
+		ext3_update_fs_rev(sb);
+		EXT3_SET_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER);
 		ext3_commit_super (sb, es, 1);
 		if (test_opt (sb, DEBUG))
 			printk ("[EXT II FS %s, %s, bs=%lu, fs=%lu, gc=%lu, "
@@ -653,22 +679,33 @@
 		MOD_DEC_USE_COUNT;
 		return NULL;
 	}
-	if (le32_to_cpu(es->s_rev_level) > EXT3_GOOD_OLD_REV) {
-		if (le32_to_cpu(es->s_feature_incompat) & ~EXT3_FEATURE_INCOMPAT_SUPP) {
-			printk("EXT3-fs: %s: couldn't mount because of "
-			       "unsupported optional features.\n",
-			       bdevname(dev));
-			goto failed_mount;
-		}
-		if (!(sb->s_flags & MS_RDONLY) &&
-		    (le32_to_cpu(es->s_feature_ro_compat) & ~EXT3_FEATURE_RO_COMPAT_SUPP)) {
-			printk("EXT3-fs: %s: couldn't mount RDWR because of "
-			       "unsupported optional features.\n",
-			       bdevname(dev));
-			goto failed_mount;
-		}
+
+	if (le32_to_cpu(es->s_rev_level) == EXT3_GOOD_OLD_REV &&
+	    (EXT3_HAS_COMPAT_FEATURE(sb, ~0U) ||
+	     EXT3_HAS_RO_COMPAT_FEATURE(sb, ~0U) ||
+	     EXT3_HAS_INCOMPAT_FEATURE(sb, ~0U)))
+		printk("EXT3-fs warning: feature flags set on rev 0 fs, "
+		       "running e2fsck is recommended\n");
+	/*
+	 * Check feature flags regardless of the revision level, since we
+	 * previously didn't change the revision level when setting the flags,
+	 * so there is a chance incompat flags are set on a rev 0 filesystem.
+	 */
+	if ((i = EXT3_HAS_INCOMPAT_FEATURE(sb, ~EXT3_FEATURE_INCOMPAT_SUPP))) {
+		printk("EXT3-fs: %s: couldn't mount because of "
+		       "unsupported optional features (%x).\n",
+		       bdevname(dev), i);
+		goto failed_mount;
+	}
+	if (!(sb->s_flags & MS_RDONLY) &&
+	    (i = EXT3_HAS_RO_COMPAT_FEATURE(sb, ~EXT3_FEATURE_RO_COMPAT_SUPP))){
+		printk("EXT3-fs: %s: couldn't mount RDWR because of "
+		       "unsupported optional features (%x).\n",
+		       bdevname(dev), i);
+		goto failed_mount;
 	}
-	sb->s_blocksize_bits = le32_to_cpu(sb->u.ext3_sb.s_es->s_log_block_size) + 10;
+	sb->s_blocksize_bits =
+		le32_to_cpu(EXT3_SB(sb)->s_es->s_log_block_size) + 10;
 	sb->s_blocksize = 1 << sb->s_blocksize_bits;
 	if (sb->s_blocksize != BLOCK_SIZE &&
 	    (sb->s_blocksize == 1024 || sb->s_blocksize == 2048 ||
@@ -714,9 +751,6 @@
 			goto failed_mount;
 		}
 	}
-	sb->u.ext3_sb.s_feature_compat = le32_to_cpu(es->s_feature_compat);
-	sb->u.ext3_sb.s_feature_incompat = le32_to_cpu(es->s_feature_incompat);
-	sb->u.ext3_sb.s_feature_ro_compat = le32_to_cpu(es->s_feature_ro_compat);
 	sb->u.ext3_sb.s_frag_size = EXT3_MIN_FRAG_SIZE <<
 				   le32_to_cpu(es->s_log_frag_size);
 	if (sb->u.ext3_sb.s_frag_size)
@@ -822,7 +856,7 @@
 	}
 	sb->u.ext3_sb.s_loaded_inode_bitmaps = 0;
 	sb->u.ext3_sb.s_loaded_block_bitmaps = 0;
-	sb->u.ext3_sb.s_db_per_group = db_count;
+	sb->u.ext3_sb.s_gdb_count = db_count;
 	/*
 	 * set up enough so that it can read an inode
 	 */
@@ -839,7 +873,7 @@
 	 * root first: it may be modified in the journal!
 	 */
 	if (!test_opt(sb, NOLOAD) &&
-	    (sb->u.ext3_sb.s_feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL)) {
+	    EXT3_HAS_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_HAS_JOURNAL)) {
 		if (ext3_load_journal(sb, es))
 			goto error_out;
 	} else if (journal_inum) {
@@ -969,7 +1004,7 @@
 	 * can get read-write access to the device.
 	 */
 
-	if (es->s_feature_incompat & cpu_to_le32(EXT3_FEATURE_INCOMPAT_RECOVER)) {
+	if (EXT3_HAS_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER)) {
 		if (sb->s_flags & MS_RDONLY) {
 			printk(KERN_ERR "EXT3-fs: WARNING: recovery required on readonly filesystem.\n");
 			if (is_read_only(sb->s_dev)) {
@@ -1027,13 +1064,11 @@
 	EXT3_SB(sb)->s_journal = journal;
 	if (sb->s_flags & MS_SYNCHRONOUS)
 		journal->j_flags |= JFS_SYNC;
-	
-	sb->u.ext3_sb.s_feature_incompat |= EXT3_FEATURE_INCOMPAT_RECOVER;
-	es->s_feature_incompat = cpu_to_le32(sb->u.ext3_sb.s_feature_incompat);
-	
-	sb->u.ext3_sb.s_feature_compat |= EXT3_FEATURE_COMPAT_HAS_JOURNAL;
-	es->s_feature_compat = cpu_to_le32(sb->u.ext3_sb.s_feature_compat);
-	
+
+	ext3_update_fs_rev(sb);
+	EXT3_SET_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER);
+	EXT3_SET_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_HAS_JOURNAL);
+
 	es->s_journal_inum = cpu_to_le32(journal_inum);
 	sb->s_dirt = 1;
 
@@ -1065,14 +1100,12 @@
 					struct ext3_super_block * es)
 {
 	journal_flush(EXT3_SB(sb)->s_journal);
-	if (EXT3_HAS_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER)) {
-		if (sb->s_flags & MS_RDONLY) {
-			EXT3_SB(sb)->s_feature_incompat &= ~EXT3_FEATURE_INCOMPAT_RECOVER;
-			es->s_feature_incompat = cpu_to_le32(EXT3_SB(sb)->s_feature_incompat);
-			es->s_mtime = cpu_to_le32(CURRENT_TIME);
-			ext3_commit_super(sb, es, 1);
-			sb->s_dirt = 0;
-		}
+	if (EXT3_HAS_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER) &&
+	    sb->s_flags & MS_RDONLY) {
+		EXT3_CLEAR_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER);
+		ext3_commit_super(sb, es, 1);
+		jfs_debug(0, "past commit\n");
+		sb->s_dirt = 0;
 	}
 }
 
@@ -1181,13 +1214,21 @@
 		 * rdonly, and if so set the rdonly flag and then mark the
 		 * partition as valid again.  
 		 */
-		if (!(le16_to_cpu(es->s_state) & EXT3_VALID_FS) &&
+		if (!(es->s_state & cpu_to_le16(EXT3_VALID_FS)) &&
 		    (sb->u.ext3_sb.s_mount_state & EXT3_VALID_FS))
 			es->s_state = cpu_to_le16(sb->u.ext3_sb.s_mount_state);
 
 		ext3_mark_recovery_complete(sb, es);
 	}
 	else {
+		int ret;
+		if ((ret = EXT3_HAS_RO_COMPAT_FEATURE(sb,
+					       ~EXT3_FEATURE_RO_COMPAT_SUPP))) {
+			printk("EXT3-fs: %s: couldn't remount RDWR because of "
+			       "unsupported optional features (%x).\n",
+			       bdevname(sb->s_dev), ret);
+			return -EROFS;
+		}
 		/*
 		 * Mounting a RDONLY partition read-write, so reread and
 		 * store the current valid flag.  (It may have been changed
@@ -1233,7 +1274,7 @@
 {
 	unsigned long overhead;
 	struct statfs tmp;
-	int	ngroups, i;
+	int i;
 
 	if (test_opt (sb, MINIX_DF))
 		overhead = 0;
@@ -1250,19 +1291,12 @@
 
 		/*
 		 * Add the overhead attributed to the superblock and
-		 * block group descriptors.  If this is sparse
-		 * superblocks is turned on, then not all groups have
-		 * this.
+		 * block group descriptors.  If the sparse superblocks
+		 * feature is turned on, then not all groups have this.
 		 */
-		if (sb->u.ext3_sb.s_feature_ro_compat &
-		    EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER) {
-			ngroups = 0;
-			for (i=0 ; i < sb->u.ext3_sb.s_groups_count; i++)
-				if (ext3_group_sparse(i))
-					ngroups++;
-		} else
-			ngroups = sb->u.ext3_sb.s_groups_count;
-		overhead += ngroups * (1 + sb->u.ext3_sb.s_db_per_group);
+		for (i = 0; i < EXT3_SB(sb)->s_groups_count; i++)
+			overhead += ext3_bg_has_super(sb, i) +
+				ext3_bg_num_gdb(sb, i);
 
 		/*
 		 * Every block group has an inode bitmap, a block
diff -ru linux-2.2.18-pre21.orig/include/linux/ext3_fs.h linux-2.2.18-pre21/include/linux/ext3_fs.h
--- linux-2.2.18-pre21.orig/include/linux/ext3_fs.h	Sat Nov 18 17:42:58 2000
+++ linux-2.2.18-pre21/include/linux/ext3_fs.h	Sat Nov 18 16:30:06 2000
@@ -410,13 +410,13 @@
 	__u32	s_algorithm_usage_bitmap; /* For compression */
 	/*
 	 * Performance hints.  Directory preallocation should only
-	 * happen if the EXT3_COMPAT_PREALLOC flag is on.
+	 * happen if the EXT3_FEATURE_COMPAT_DIR_PREALLOC flag is on.
 	 */
 	__u8	s_prealloc_blocks;	/* Nr of blocks to try to preallocate*/
 	__u8	s_prealloc_dir_blocks;	/* Nr to preallocate for dirs */
 	__u16	s_padding1;
 	/* 
-	 * Journaling support.
+	 * Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set.
 	 */
 	__u8	s_journal_uuid[16];	/* uuid of journal superblock */
 	__u32	s_journal_inum;		/* inode number of journal file */
@@ -462,11 +462,24 @@
  */
 
 #define EXT3_HAS_COMPAT_FEATURE(sb,mask)			\
-	( EXT3_SB(sb)->s_feature_compat & (mask) )
+	( EXT3_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) )
 #define EXT3_HAS_RO_COMPAT_FEATURE(sb,mask)			\
-	( EXT3_SB(sb)->s_feature_ro_compat & (mask) )
+	( EXT3_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) )
 #define EXT3_HAS_INCOMPAT_FEATURE(sb,mask)			\
-	( EXT3_SB(sb)->s_feature_incompat & (mask) )
+	( EXT3_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) )
+#define EXT3_SET_COMPAT_FEATURE(sb,mask)			\
+	EXT3_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask)
+#define EXT3_SET_RO_COMPAT_FEATURE(sb,mask)			\
+	EXT3_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32(mask)
+#define EXT3_SET_INCOMPAT_FEATURE(sb,mask)			\
+	EXT3_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(mask)
+#define EXT3_CLEAR_COMPAT_FEATURE(sb,mask)			\
+	EXT3_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(mask)
+#define EXT3_CLEAR_RO_COMPAT_FEATURE(sb,mask)			\
+	EXT3_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_le32(mask)
+#define EXT3_CLEAR_INCOMPAT_FEATURE(sb,mask)			\
+	EXT3_SB(sb)->s_es->s_feature_incompat &= ~cpu_to_le32(mask)
+
 
 #define EXT3_FEATURE_COMPAT_DIR_PREALLOC	0x0001
 /*      EXT3_FEATURE_COMPAT_<reserved for AFS>	0x0002 */
--- linux/include/linux/ext3_fs.h~	Sun Nov 19 22:57:59 2000
+++ linux/include/linux/ext3_fs.h	Sun Nov 19 23:00:23 2000
@@ -576,7 +576,8 @@
 extern int ext3_permission (struct inode *, int);
 
 /* balloc.c */
-extern int ext3_group_sparse(int group);
+extern int ext3_bg_has_super(struct super_block *sb, int group);
+extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group);
 extern int ext3_new_block (handle_t *, const struct inode *, unsigned long,
 			   __u32 *, __u32 *, int *);
 extern void ext3_free_blocks (handle_t *, const struct inode *, unsigned long,
@@ -655,7 +669,8 @@
 				   const char *, ...)
 	__attribute__ ((NORET_AND format (printf, 3, 4)));
 extern void ext3_warning (struct super_block *, const char *, const char *, ...)
-	__attribute__ ((format (printf, 3, 4)));
+ 	__attribute__ ((format (printf, 3, 4)));
+extern void ext3_update_fs_rev (struct super_block *sb);
 extern void ext3_put_super (struct super_block *);
 extern void ext3_write_super (struct super_block *);
 extern int ext3_remount (struct super_block *, int *, char *);
diff -ru linux-2.2.18-pre21.orig/include/linux/ext3_fs_sb.h linux-2.2.18-pre21/include/linux/ext3_fs_sb.h
--- linux-2.2.18-pre21.orig/include/linux/ext3_fs_sb.h	Sat Nov 18 17:42:58 2000
+++ linux-2.2.18-pre21/include/linux/ext3_fs_sb.h	Sat Nov 18 08:49:16 2000
@@ -35,7 +35,7 @@
 	unsigned long s_blocks_per_group;/* Number of blocks in a group */
 	unsigned long s_inodes_per_group;/* Number of inodes in a group */
 	unsigned long s_itb_per_group;	/* Number of inode table blocks per group */
-	unsigned long s_db_per_group;	/* Number of descriptor blocks per group */
+	unsigned long s_gdb_count;	/* Number of descriptor blocks */
 	unsigned long s_desc_per_block;	/* Number of group descriptors per block */
 	unsigned long s_groups_count;	/* Number of groups in the fs */
 	struct buffer_head * s_sbh;	/* Buffer containing the super block */
@@ -56,9 +56,6 @@
 	int s_desc_per_block_bits;
 	int s_inode_size;
 	int s_first_ino;
-	int s_feature_compat;
-	int s_feature_incompat;
-	int s_feature_ro_compat;
 
 	/* Journaling */
 	struct inode * s_journal_inode;
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]