All of lore.kernel.org
 help / color / mirror / Atom feed
From: Valerie Clement <valerie.clement@bull.net>
To: Theodore Tso <tytso@mit.edu>
Cc: ext4 development <linux-ext4@vger.kernel.org>
Subject: [RFC][PATCH 1/12] new ext4 group desc struct in e2fsprogs
Date: Mon, 11 Jun 2007 18:42:08 +0200	[thread overview]
Message-ID: <466D7B60.3050108@bull.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]

A different groups descriptor structure was introduced for ext4 filesystems.
This patch handles that.

  debugfs/debugfs.c    |    9 +++++++++
  debugfs/set_fields.c |    4 ++++
  e2fsck/super.c       |    4 ++++
  lib/ext2fs/closefs.c |    5 +++++
  lib/ext2fs/ext2fs.h  |    8 ++++++++
  lib/ext2fs/openfs.c  |    7 ++++++-
  lib/ext2fs/swapfs.c  |    4 ++++
  misc/mke2fs.c        |    4 ++++
  resize/resize2fs.c   |    2 +-
  9 files changed, 45 insertions(+), 2 deletions(-)



[-- Attachment #2: 01-handle-new-ext4-group-desc-struct --]
[-- Type: text/plain, Size: 6737 bytes --]

Index: e2fsprogs-1.39-tyt3-v6/lib/ext2fs/ext2fs.h
===================================================================
--- e2fsprogs-1.39-tyt3-v6.orig/lib/ext2fs/ext2fs.h	2007-06-08 12:40:04.000000000 +0200
+++ e2fsprogs-1.39-tyt3-v6/lib/ext2fs/ext2fs.h	2007-06-08 12:40:21.000000000 +0200
@@ -213,7 +213,11 @@ struct struct_ext2_filsys {
 	int				fragsize;
 	dgrp_t				group_desc_count;
 	unsigned long			desc_blocks;
+#ifdef _EXT4FS_
+	struct ext4_group_desc *	group_desc;
+#else
 	struct ext2_group_desc *	group_desc;
+#endif
 	int				inode_blocks_per_group;
 	ext2fs_inode_bitmap		inode_map;
 	ext2fs_block_bitmap		block_map;
@@ -1003,7 +1007,11 @@ extern errcode_t ext2fs_copy_bitmap(ext2
 extern void ext2fs_swap_ext_attr(char *to, char *from, int bufsize, 
 				 int has_header);
 extern void ext2fs_swap_super(struct ext2_super_block * super);
+#ifdef _EXT4FS_
+extern void ext2fs_swap_group_desc(struct ext4_group_desc *gdp);
+#else
 extern void ext2fs_swap_group_desc(struct ext2_group_desc *gdp);
+#endif
 extern void ext2fs_swap_extent_header(struct ext3_extent_header *eh);
 extern void ext2fs_swap_extent_index(struct ext3_extent_idx *ix);
 extern void ext2fs_swap_extent(struct ext3_extent *ex);
Index: e2fsprogs-1.39-tyt3-v6/debugfs/set_fields.c
===================================================================
--- e2fsprogs-1.39-tyt3-v6.orig/debugfs/set_fields.c	2007-06-08 12:40:04.000000000 +0200
+++ e2fsprogs-1.39-tyt3-v6/debugfs/set_fields.c	2007-06-08 12:40:21.000000000 +0200
@@ -31,7 +31,11 @@
 
 static struct ext2_super_block set_sb;
 static struct ext2_inode set_inode;
+#ifdef _EXT4FS_
+static struct ext4_group_desc set_gd;
+#else
 static struct ext2_group_desc set_gd;
+#endif
 static ext2_ino_t set_ino;
 static int array_idx;
 
Index: e2fsprogs-1.39-tyt3-v6/resize/resize2fs.c
===================================================================
--- e2fsprogs-1.39-tyt3-v6.orig/resize/resize2fs.c	2007-06-08 12:40:04.000000000 +0200
+++ e2fsprogs-1.39-tyt3-v6/resize/resize2fs.c	2007-06-08 12:40:21.000000000 +0200
@@ -365,7 +365,7 @@ retry:
 	for (i = old_fs->group_desc_count;
 	     i < fs->group_desc_count; i++) {
 		memset(&fs->group_desc[i], 0,
-		       sizeof(struct ext2_group_desc));
+		       sizeof(fs->group_desc[0]));
 		adjblocks = 0;
 
 		if (i == fs->group_desc_count-1) {
Index: e2fsprogs-1.39-tyt3-v6/misc/mke2fs.c
===================================================================
--- e2fsprogs-1.39-tyt3-v6.orig/misc/mke2fs.c	2007-06-08 12:40:04.000000000 +0200
+++ e2fsprogs-1.39-tyt3-v6/misc/mke2fs.c	2007-06-08 12:40:21.000000000 +0200
@@ -449,7 +449,11 @@ static void setup_lazy_bg(ext2_filsys fs
 	dgrp_t i;
 	int blks;
 	struct ext2_super_block *sb = fs->super;
+#ifdef _EXT4FS_
+	struct ext4_group_desc *bg = fs->group_desc;
+#else
 	struct ext2_group_desc *bg = fs->group_desc;
+#endif
 
 	if (EXT2_HAS_COMPAT_FEATURE(fs->super, 
 				    EXT2_FEATURE_COMPAT_LAZY_BG)) {
Index: e2fsprogs-1.39-tyt3-v6/debugfs/debugfs.c
===================================================================
--- e2fsprogs-1.39-tyt3-v6.orig/debugfs/debugfs.c	2007-06-08 12:40:04.000000000 +0200
+++ e2fsprogs-1.39-tyt3-v6/debugfs/debugfs.c	2007-06-08 12:40:21.000000000 +0200
@@ -267,8 +267,13 @@ static void print_features(struct ext2_s
 	fputs("\n", f);
 }
 
+#ifdef _EXT4FS_
+static void print_bg_opts(struct ext4_group_desc *gdp, int mask,
+			  const char *str, int *first, FILE *f)
+#else
 static void print_bg_opts(struct ext2_group_desc *gdp, int mask,
 			  const char *str, int *first, FILE *f)
+#endif
 {
 	if (gdp->bg_flags & mask) {
 		if (*first) {
@@ -284,7 +289,11 @@ void do_show_super_stats(int argc, char 
 {
 	dgrp_t	i;
 	FILE 	*out;
+#ifdef _EXT4FS_
+	struct ext4_group_desc *gdp;
+#else
 	struct ext2_group_desc *gdp;
+#endif
 	int	c, header_only = 0;
 	int	numdirs = 0, first;
 
Index: e2fsprogs-1.39-tyt3-v6/e2fsck/super.c
===================================================================
--- e2fsprogs-1.39-tyt3-v6.orig/e2fsck/super.c	2007-06-08 12:40:04.000000000 +0200
+++ e2fsprogs-1.39-tyt3-v6/e2fsck/super.c	2007-06-08 12:40:21.000000000 +0200
@@ -470,7 +470,11 @@ void check_super_block(e2fsck_t ctx)
 	ext2_filsys fs = ctx->fs;
 	blk_t	first_block, last_block;
 	struct ext2_super_block *sb = fs->super;
+#ifdef _EXT4FS_
+	struct ext4_group_desc *gd;
+#else
 	struct ext2_group_desc *gd;
+#endif
 	blk_t	blocks_per_group = fs->super->s_blocks_per_group;
 	blk_t	bpg_max;
 	int	inodes_per_block;
Index: e2fsprogs-1.39-tyt3-v6/lib/ext2fs/swapfs.c
===================================================================
--- e2fsprogs-1.39-tyt3-v6.orig/lib/ext2fs/swapfs.c	2007-06-08 12:40:04.000000000 +0200
+++ e2fsprogs-1.39-tyt3-v6/lib/ext2fs/swapfs.c	2007-06-08 12:40:21.000000000 +0200
@@ -77,7 +77,11 @@ void ext2fs_swap_super(struct ext2_super
 
 }
 
+#ifdef _EXT4FS_
+void ext2fs_swap_group_desc(struct ext4_group_desc *gdp)
+#else
 void ext2fs_swap_group_desc(struct ext2_group_desc *gdp)
+#endif
 {
 	gdp->bg_block_bitmap = ext2fs_swab32(gdp->bg_block_bitmap);
 	gdp->bg_inode_bitmap = ext2fs_swab32(gdp->bg_inode_bitmap);
Index: e2fsprogs-1.39-tyt3-v6/lib/ext2fs/openfs.c
===================================================================
--- e2fsprogs-1.39-tyt3-v6.orig/lib/ext2fs/openfs.c	2007-06-08 12:40:04.000000000 +0200
+++ e2fsprogs-1.39-tyt3-v6/lib/ext2fs/openfs.c	2007-06-08 12:40:21.000000000 +0200
@@ -90,7 +90,6 @@ errcode_t ext2fs_open2(const char *name,
 	int		j, groups_per_block, blocks_per_group, io_flags;
 	blk_t		group_block, blk;
 	char		*dest, *cp;
-	struct ext2_group_desc *gdp;
 	
 	EXT2_CHECK_MAGIC(manager, EXT2_ET_MAGIC_IO_MANAGER);
 
@@ -289,7 +288,13 @@ errcode_t ext2fs_open2(const char *name,
 			goto cleanup;
 #ifdef EXT2FS_ENABLE_SWAPFS
 		if (fs->flags & EXT2_FLAG_SWAP_BYTES) {
+#ifdef _EXT4FS_
+			struct ext4_group_desc *gdp;
+			gdp = (struct ext4_group_desc *) dest;
+#else
+			struct ext2_group_desc *gdp;
 			gdp = (struct ext2_group_desc *) dest;
+#endif
 			for (j=0; j < groups_per_block; j++)
 				ext2fs_swap_group_desc(gdp++);
 		}
Index: e2fsprogs-1.39-tyt3-v6/lib/ext2fs/closefs.c
===================================================================
--- e2fsprogs-1.39-tyt3-v6.orig/lib/ext2fs/closefs.c	2007-06-08 12:40:04.000000000 +0200
+++ e2fsprogs-1.39-tyt3-v6/lib/ext2fs/closefs.c	2007-06-08 12:40:21.000000000 +0200
@@ -209,8 +209,13 @@ errcode_t ext2fs_flush(ext2_filsys fs)
 	errcode_t	retval;
 	unsigned long	fs_state;
 	struct ext2_super_block *super_shadow = 0;
+#ifdef _EXT4FS_
+	struct ext4_group_desc *group_shadow = 0;
+	struct ext4_group_desc *s, *t;
+#else
 	struct ext2_group_desc *group_shadow = 0;
 	struct ext2_group_desc *s, *t;
+#endif
 	char	*group_ptr;
 	int	old_desc_blocks;
 	

             reply	other threads:[~2007-06-11 16:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-11 16:42 Valerie Clement [this message]
2007-06-11 23:21 ` [RFC][PATCH 1/12] new ext4 group desc struct in e2fsprogs Andreas Dilger
2007-06-12 11:44   ` Valerie Clement

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=466D7B60.3050108@bull.net \
    --to=valerie.clement@bull.net \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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.