public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* ext4 kernel patches against linux-2.6.18-rc7-mm1
@ 2006-09-20 15:56 Dave Kleikamp
  2006-09-20 16:32 ` Eric Sandeen
  2006-09-21 15:15 ` Johann Lombardi
  0 siblings, 2 replies; 7+ messages in thread
From: Dave Kleikamp @ 2006-09-20 15:56 UTC (permalink / raw)
  To: ext4 development

I have ported the ext4 kernel patches to linux-2.6.18-rc7-mm1.  They
have been compile-tested, but I haven't done any run-time testing yet.

I expect that the rc7-mm1 ext3 that these patches are based off will be
close to 2.6.19-rc1, which is the target for merging ext4 into the
mainline tree.

The patches can be found here:
ftp://kernel.org/pub/linux/kernel/people/shaggy/ext4

Here's the series file:

# These patches were build against linux-2.6.18-rc7-mm1
#
# These first 3 patches create a clone of ext3 into ext4
ext4-copy.patch
ext4-rename.patch
ext4-enable.patch
#
# These next 4 copy clone jdb2 from jbd and modify ext4 to use it
jbd2-copy.patch
jbd2-rename.patch
jbd2-enable.patch
# ext4_jbd.h is no longer used
jbd2-cleanup.patch
#
# Shaggy made some minor changes to fix whitespace, sparse errors, etc.
# in many of the following patches
#
# From Alex Tomas
ext4-extents.patch
#
# From Mingming Cao
ext4_fsblk_sector_t.patch
#
# From Alex Tomas
ext4-extents-48bit.patch
#
# From Suparna Bhattacharya
ext4-unitialized-extent-handling.patch
#
# From Randy Dunlap
extents_comment_fix.patch
#
# From Zach Brown and Badari Pulavarty
64bit_jbd2_core.patch
#
# From Mingming Cao
sector_t-jbd2.patch
#
# From Badari Pulavarty
ext4_48bit_i_file_acl.patch
#
# From Laurent Vivier
64bit-metadata.patch
#
# From Avantika Mathur
64bitmetadata_inline_funcs_fix.patch
#
# From Mingming Cao
ext4_blk_type_from_sector_t_to_ulonglong.patch
ext4_remove_sector_t_bits_check.patch
jbd2_blks_type_from_sector_t_to_ull.patch
#
# From Alexandre Ratchov
ext4_remove_relative_block_numbers.patch
ext4_allow_larger_descriptor_size.patch
ext4_move_block_number_hi_bits.patch
-- 
David Kleikamp
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ext4 kernel patches against linux-2.6.18-rc7-mm1
  2006-09-20 15:56 ext4 kernel patches against linux-2.6.18-rc7-mm1 Dave Kleikamp
@ 2006-09-20 16:32 ` Eric Sandeen
  2006-09-20 17:38   ` Eric Sandeen
  2006-09-21 15:15 ` Johann Lombardi
  1 sibling, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2006-09-20 16:32 UTC (permalink / raw)
  To: Dave Kleikamp; +Cc: ext4 development

Dave Kleikamp wrote:

> # From Mingming Cao
> sector_t-jbd2.patch

I think this one needs to address the first, last variables in
journal_fail_superblock():

 static int journal_reset(journal_t *journal)
 {
        journal_superblock_t *sb = journal->j_superblock;
-       unsigned int first, last;
+       sector_t first, last;

        first = be32_to_cpu(sb->s_first);
        last = be32_to_cpu(sb->s_maxlen);

(and then later change that back to unsigned long long, in the spirit of
the patch series)

-Eric

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ext4 kernel patches against linux-2.6.18-rc7-mm1
  2006-09-20 16:32 ` Eric Sandeen
@ 2006-09-20 17:38   ` Eric Sandeen
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Sandeen @ 2006-09-20 17:38 UTC (permalink / raw)
  To: Dave Kleikamp; +Cc: ext4 development

Eric Sandeen wrote:
> Dave Kleikamp wrote:
> 
>> # From Mingming Cao
>> sector_t-jbd2.patch
> 
> I think this one needs to address the first, last variables in
> journal_fail_superblock():
> 
>  static int journal_reset(journal_t *journal)
>  {
>         journal_superblock_t *sb = journal->j_superblock;
> -       unsigned int first, last;
> +       sector_t first, last;
> 
>         first = be32_to_cpu(sb->s_first);
>         last = be32_to_cpu(sb->s_maxlen);
> 
> (and then later change that back to unsigned long long, in the spirit of
> the patch series)

Hm, and looking further, I think this change:

 journal_t * jbd2_journal_init_dev(struct block_device *bdev,
                        struct block_device *fs_dev,
-                       int start, int len, int blocksize)
+                       sector_t start, int len, int blocksize)

is unnecessary; this is initializing the journal on an external device,
and start is in the first few blocks of the disk:

        sb_block = EXT3_MIN_BLOCK_SIZE / blocksize;
        start = sb_block + 1;

and len is also constrained by the maximum log size.

-Eric

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ext4 kernel patches against linux-2.6.18-rc7-mm1
  2006-09-20 15:56 ext4 kernel patches against linux-2.6.18-rc7-mm1 Dave Kleikamp
  2006-09-20 16:32 ` Eric Sandeen
@ 2006-09-21 15:15 ` Johann Lombardi
  1 sibling, 0 replies; 7+ messages in thread
From: Johann Lombardi @ 2006-09-21 15:15 UTC (permalink / raw)
  To: Dave Kleikamp; +Cc: ext4 development

On Wed, Sep 20, 2006 at 10:56:39AM -0500, Dave Kleikamp wrote:
> # These next 4 copy clone jdb2 from jbd and modify ext4 to use it
> jbd2-copy.patch
> jbd2-rename.patch

jbd and jbd2 currently use the same slab names which must be unique.
The patch below just renames jbd2's slabs.

Signed-off-by: Johann Lombardi <johann.lombardi@bull.net>

Index: linux-2.6.18-rc7-mm1/fs/jbd2/journal.c
===================================================================
--- linux-2.6.18-rc7-mm1.orig/fs/jbd2/journal.c	2006-09-21 16:37:49.566959224 +0200
+++ linux-2.6.18-rc7-mm1/fs/jbd2/journal.c	2006-09-21 16:38:19.145462608 +0200
@@ -1643,7 +1643,7 @@
 
 static kmem_cache_t *jbd_slab[JBD_MAX_SLABS];
 static const char *jbd_slab_names[JBD_MAX_SLABS] = {
-	"jbd_1k", "jbd_2k", "jbd_4k", NULL, "jbd_8k"
+	"jbd2_1k", "jbd2_2k", "jbd2_4k", NULL, "jbd2_8k"
 };
 
 static void jbd2_journal_destroy_jbd_slabs(void)
@@ -1714,7 +1714,7 @@
 	int retval;
 
 	J_ASSERT(jbd2_journal_head_cache == 0);
-	jbd2_journal_head_cache = kmem_cache_create("journal_head",
+	jbd2_journal_head_cache = kmem_cache_create("jbd2_journal_head",
 				sizeof(struct journal_head),
 				0,		/* offset */
 				0,		/* flags */
@@ -2019,7 +2019,7 @@
 
 static int __init journal_init_handle_cache(void)
 {
-	jbd2_handle_cache = kmem_cache_create("journal_handle",
+	jbd2_handle_cache = kmem_cache_create("jbd2_journal_handle",
 				sizeof(handle_t),
 				0,		/* offset */
 				0,		/* flags */
Index: linux-2.6.18-rc7-mm1/fs/jbd2/revoke.c
===================================================================
--- linux-2.6.18-rc7-mm1.orig/fs/jbd2/revoke.c	2006-09-21 16:38:28.044109808 +0200
+++ linux-2.6.18-rc7-mm1/fs/jbd2/revoke.c	2006-09-21 16:38:40.978143536 +0200
@@ -169,13 +169,13 @@
 
 int __init jbd2_journal_init_revoke_caches(void)
 {
-	jbd2_revoke_record_cache = kmem_cache_create("revoke_record",
+	jbd2_revoke_record_cache = kmem_cache_create("jbd2_revoke_record",
 					   sizeof(struct jbd2_revoke_record_s),
 					   0, SLAB_HWCACHE_ALIGN, NULL, NULL);
 	if (jbd2_revoke_record_cache == 0)
 		return -ENOMEM;
 
-	jbd2_revoke_table_cache = kmem_cache_create("revoke_table",
+	jbd2_revoke_table_cache = kmem_cache_create("jbd2_revoke_table",
 					   sizeof(struct jbd2_revoke_table_s),
 					   0, 0, NULL, NULL);
 	if (jbd2_revoke_table_cache == 0) {

^ permalink raw reply	[flat|nested] 7+ messages in thread

* ext4 kernel patches against linux-2.6.18-rc7-mm1
@ 2006-09-26 16:43 Alexandre Ratchov
  2006-09-26 16:55 ` Alexandre Ratchov
  2006-09-29 20:28 ` ext4 kernel patches against linux-2.6.18-mm1 Dave Kleikamp
  0 siblings, 2 replies; 7+ messages in thread
From: Alexandre Ratchov @ 2006-09-26 16:43 UTC (permalink / raw)
  To: linux-ext4; +Cc: Jean-Pierre Dion

hi,

i've updated the ext4 kernel patches to 2.6.18-mm1. I've just done some
reordering/simplifications and fixed some minor bugs:

 - merge all 64bit "metadata" patches together

 - fix false-positive format warnings in balloc.c and resize.c because of
   arithmetic with 'unsigned long' variables:

   the following snippet:

	unsigned long x;
	unsigned long long long y;
	printf("%llu", x + y);
	
   triggers a warning on 64bit archs because gcc doen't
   seem to promote x + y to unsigned long long since long and long long
   have the same size and signedness. So we avoid the warning by:

	printf("%llu", (unsigned long long)(x + y));

 - fix ext4_blocks_count_set() and ext4_r_blocks_count_set() to use 64bit
   block numbers (ie ext4_fsblk_t) instead of __u32

 - coding style fixes: remove misplaced spaces, wrap some lines to 80 cols

 - fix ext4_check_descriptors() and ext4_group_add() to use 
   ext4_blocks_count() (returns full 64bit value) instead of just reading
   sbi->s_es->s_blocks_count (32bit low bits)

 - include fix for JBD2 not to use the same slab naming than JBD (fix from
   Johann Lomabardi)

 - remove unused EXT4_FREE_BLOCKS_COUNT() macro
   
 - update missing %u -> %llu replacements in resize.c

 - make 64bit ext4_super_block getters and setters inline C functions

Just to "summarize" the changes, here is attached a diff between results of
the old patch set and the updated patch set. The new patch set can be found
here:

http://www.bullopensource.org/ext4/20060926/

there are also patches for e2fsprogs-1.39 in sync with the kernel patch set;
both are tested on x86_64 with an 20TB devices.

cheers,

-- Alexandre


diff -ur verif/linux-2.6.18-mm1/fs/ext4/balloc.c linux-2.6.18-mm1/fs/ext4/balloc.c
--- verif/linux-2.6.18-mm1/fs/ext4/balloc.c	2006-09-26 19:59:00.000000000 +0200
+++ linux-2.6.18-mm1/fs/ext4/balloc.c	2006-09-26 19:49:10.000000000 +0200
@@ -554,8 +554,8 @@
 						bit + i, bitmap_bh->b_data)) {
 			jbd_unlock_bh_state(bitmap_bh);
 			ext4_error(sb, __FUNCTION__,
-				"bit already cleared for block %llu",
-				 block + i);
+				   "bit already cleared for block %llu",
+				   (ext4_fsblk_t)(block + i));
 			jbd_lock_bh_state(bitmap_bh);
 			BUFFER_TRACE(bitmap_bh, "bit already cleared");
 		} else {
diff -ur verif/linux-2.6.18-mm1/fs/ext4/resize.c linux-2.6.18-mm1/fs/ext4/resize.c
--- verif/linux-2.6.18-mm1/fs/ext4/resize.c	2006-09-26 19:59:04.000000000 +0200
+++ linux-2.6.18-mm1/fs/ext4/resize.c	2006-09-26 19:49:10.000000000 +0200
@@ -286,17 +286,6 @@
 	return err;
 }
 
-static void ext4_blocks_count_set(struct ext4_super_block *es, __u32 v)
-{
-	es->s_blocks_count = cpu_to_le32(v);
-	es->s_blocks_count_hi = cpu_to_le32(((__u64) v) >> 32);
-}
-
-static void ext4_r_blocks_count_set(struct ext4_super_block *es, __u32 v)
-{
-	es->s_r_blocks_count = cpu_to_le32(v);
-	es->s_r_blocks_count_hi = cpu_to_le32(((__u64) v) >> 32);
-}
 
 /*
  * Iterate through the groups which hold BACKUP superblock/GDT copies in an
@@ -352,12 +341,15 @@
 	int gdbackups = 0;
 
 	while ((grp = ext4_list_backups(sb, &three, &five, &seven)) < end) {
-		if (le32_to_cpu(*p++) != grp * EXT4_BLOCKS_PER_GROUP(sb) + blk){
+		if (le32_to_cpu(*p++) != 
+		    grp * EXT4_BLOCKS_PER_GROUP(sb) + blk){
 			ext4_warning(sb, __FUNCTION__,
 				     "reserved GDT %llu"
 				     " missing grp %d (%llu)",
 				     blk, grp,
-				     grp * EXT4_BLOCKS_PER_GROUP(sb) + blk);
+				     grp * 
+				     (ext4_fsblk_t)EXT4_BLOCKS_PER_GROUP(sb) + 
+				     blk);
 			return -EINVAL;
 		}
 		if (++gdbackups > EXT4_ADDR_PER_BLOCK(sb))
@@ -743,8 +735,8 @@
 		return -EPERM;
 	}
 
-	if (le32_to_cpu(es->s_blocks_count) + input->blocks_count <
-	    le32_to_cpu(es->s_blocks_count)) {
+	if (ext4_blocks_count(es) + input->blocks_count < 
+	    ext4_blocks_count(es)) {
 		ext4_warning(sb, __FUNCTION__, "blocks_count overflow\n");
 		return -EINVAL;
 	}
diff -ur verif/linux-2.6.18-mm1/fs/ext4/super.c linux-2.6.18-mm1/fs/ext4/super.c
--- verif/linux-2.6.18-mm1/fs/ext4/super.c	2006-09-26 19:59:04.000000000 +0200
+++ linux-2.6.18-mm1/fs/ext4/super.c	2006-09-26 19:49:10.000000000 +0200
@@ -62,17 +62,6 @@
 static void ext4_write_super (struct super_block * sb);
 static void ext4_write_super_lockfs(struct super_block *sb);
 
-ext4_fsblk_t ext4_blocks_count(struct ext4_super_block *es)
-{
-	return (ext4_fsblk_t) ((__u64)le32_to_cpu(es->s_blocks_count_hi) << 32 |
-				(__u64)le32_to_cpu(es->s_blocks_count));
-}
-
-ext4_fsblk_t ext4_r_blocks_count(struct ext4_super_block *es)
-{
-	return (ext4_fsblk_t) ((__u64)le32_to_cpu(es->s_r_blocks_count_hi) << 32 |
-				(__u64)le32_to_cpu(es->s_r_blocks_count));
-}
 
 ext4_fsblk_t ext4_block_bitmap(struct super_block *sb,
 			       struct ext4_group_desc *bg)
@@ -101,7 +90,7 @@
 void ext4_block_bitmap_set(struct super_block *sb,
 			   struct ext4_group_desc *bg, ext4_fsblk_t blk)
 {
-	bg->bg_block_bitmap    = cpu_to_le32((u32)blk);
+	bg->bg_block_bitmap = cpu_to_le32((u32)blk);
 	if (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT)
 		bg->bg_block_bitmap_hi = cpu_to_le32(blk >> 32);
 }
@@ -109,7 +98,7 @@
 void ext4_inode_bitmap_set(struct super_block *sb,
 			   struct ext4_group_desc *bg, ext4_fsblk_t blk)
 {
-	bg->bg_inode_bitmap    = cpu_to_le32((u32)blk);
+	bg->bg_inode_bitmap  = cpu_to_le32((u32)blk);
 	if (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT)
 		bg->bg_inode_bitmap_hi = cpu_to_le32(blk >> 32);
 }
@@ -117,18 +106,11 @@
 void ext4_inode_table_set(struct super_block *sb,
 			  struct ext4_group_desc *bg, ext4_fsblk_t blk)
 {
-	bg->bg_inode_table    = cpu_to_le32((u32)blk);
+	bg->bg_inode_table = cpu_to_le32((u32)blk);
 	if (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT)
 		bg->bg_inode_table_hi = cpu_to_le32(blk >> 32);
 }
 
-
-static void ext4_free_blocks_count_set(struct ext4_super_block *es, __u32 v)
-{
-	es->s_free_blocks_count = cpu_to_le32(v);
-	es->s_free_blocks_count_hi = cpu_to_le32(((__u64) v) >> 32);
-}
-
 /*
  * Wrappers for jbd2_journal_start/end.
  *
@@ -1261,7 +1243,7 @@
 	for (i = 0; i < sbi->s_groups_count; i++)
 	{
 		if (i == sbi->s_groups_count - 1)
-			last_block = le32_to_cpu(sbi->s_es->s_blocks_count) - 1;
+			last_block = ext4_blocks_count(sbi->s_es) - 1;
 		else
 			last_block = first_block +
 				(EXT4_BLOCKS_PER_GROUP(sb) - 1);
diff -ur verif/linux-2.6.18-mm1/fs/jbd2/journal.c linux-2.6.18-mm1/fs/jbd2/journal.c
--- verif/linux-2.6.18-mm1/fs/jbd2/journal.c	2006-09-26 19:58:58.000000000 +0200
+++ linux-2.6.18-mm1/fs/jbd2/journal.c	2006-09-26 19:49:09.000000000 +0200
@@ -1643,7 +1643,7 @@
 
 static kmem_cache_t *jbd_slab[JBD_MAX_SLABS];
 static const char *jbd_slab_names[JBD_MAX_SLABS] = {
-	"jbd_1k", "jbd_2k", "jbd_4k", NULL, "jbd_8k"
+	"jbd2_1k", "jbd2_2k", "jbd2_4k", NULL, "jbd2_8k"
 };
 
 static void jbd2_journal_destroy_jbd_slabs(void)
@@ -1714,7 +1714,7 @@
 	int retval;
 
 	J_ASSERT(jbd2_journal_head_cache == 0);
-	jbd2_journal_head_cache = kmem_cache_create("journal_head",
+	jbd2_journal_head_cache = kmem_cache_create("jbd2_journal_head",
 				sizeof(struct journal_head),
 				0,		/* offset */
 				0,		/* flags */
@@ -2019,7 +2019,7 @@
 
 static int __init journal_init_handle_cache(void)
 {
-	jbd2_handle_cache = kmem_cache_create("journal_handle",
+	jbd2_handle_cache = kmem_cache_create("jbd2_journal_handle",
 				sizeof(handle_t),
 				0,		/* offset */
 				0,		/* flags */
diff -ur verif/linux-2.6.18-mm1/fs/jbd2/revoke.c linux-2.6.18-mm1/fs/jbd2/revoke.c
--- verif/linux-2.6.18-mm1/fs/jbd2/revoke.c	2006-09-26 19:58:58.000000000 +0200
+++ linux-2.6.18-mm1/fs/jbd2/revoke.c	2006-09-26 19:49:09.000000000 +0200
@@ -169,13 +169,13 @@
 
 int __init jbd2_journal_init_revoke_caches(void)
 {
-	jbd2_revoke_record_cache = kmem_cache_create("revoke_record",
+	jbd2_revoke_record_cache = kmem_cache_create("jbd2_revoke_record",
 					   sizeof(struct jbd2_revoke_record_s),
 					   0, SLAB_HWCACHE_ALIGN, NULL, NULL);
 	if (jbd2_revoke_record_cache == 0)
 		return -ENOMEM;
 
-	jbd2_revoke_table_cache = kmem_cache_create("revoke_table",
+	jbd2_revoke_table_cache = kmem_cache_create("jbd2_revoke_table",
 					   sizeof(struct jbd2_revoke_table_s),
 					   0, 0, NULL, NULL);
 	if (jbd2_revoke_table_cache == 0) {
diff -ur verif/linux-2.6.18-mm1/include/linux/ext4_fs.h linux-2.6.18-mm1/include/linux/ext4_fs.h
--- verif/linux-2.6.18-mm1/include/linux/ext4_fs.h	2006-09-26 19:59:04.000000000 +0200
+++ linux-2.6.18-mm1/include/linux/ext4_fs.h	2006-09-26 19:49:10.000000000 +0200
@@ -516,10 +516,6 @@
 	__u32	s_reserved[169];	/* Padding to the end of the block */
 };
 
-#define EXT4_FREE_BLOCKS_COUNT(s)					\
-	(ext4_fsblk_t)(((__u64)le32_to_cpu((s)->s_free_blocks_count_hi) << 32) | \
-		 (__u64)le32_to_cpu((s)->s_free_blocks_count))
-
 #ifdef __KERNEL__
 static inline struct ext4_sb_info * EXT4_SB(struct super_block *sb)
 {
@@ -909,8 +905,6 @@
 extern void ext4_warning (struct super_block *, const char *, const char *, ...)
 	__attribute__ ((format (printf, 3, 4)));
 extern void ext4_update_dynamic_rev (struct super_block *sb);
-extern ext4_fsblk_t ext4_blocks_count(struct ext4_super_block *es);
-extern ext4_fsblk_t ext4_r_blocks_count(struct ext4_super_block *es);
 extern ext4_fsblk_t ext4_block_bitmap(struct super_block *sb,
 				      struct ext4_group_desc *bg);
 extern ext4_fsblk_t ext4_inode_bitmap(struct super_block *sb,
@@ -924,6 +918,47 @@
 extern void ext4_inode_table_set(struct super_block *sb,
 				 struct ext4_group_desc *bg, ext4_fsblk_t blk);
 
+static inline ext4_fsblk_t ext4_blocks_count(struct ext4_super_block *es)
+{
+	return ((ext4_fsblk_t)le32_to_cpu(es->s_blocks_count_hi) << 32) |
+		le32_to_cpu(es->s_blocks_count);
+}
+
+static inline ext4_fsblk_t ext4_r_blocks_count(struct ext4_super_block *es)
+{
+	return ((ext4_fsblk_t)le32_to_cpu(es->s_r_blocks_count_hi) << 32) |
+		le32_to_cpu(es->s_r_blocks_count);
+}
+
+static inline ext4_fsblk_t ext4_free_blocks_count(struct ext4_super_block *es)
+{
+	return ((ext4_fsblk_t)le32_to_cpu(es->s_free_blocks_count_hi) << 32) |
+		le32_to_cpu(es->s_free_blocks_count);
+}
+
+static inline void ext4_blocks_count_set(struct ext4_super_block *es,
+					 ext4_fsblk_t blk)
+{
+	es->s_blocks_count = cpu_to_le32((u32)blk);
+	es->s_blocks_count_hi = cpu_to_le32(blk >> 32);
+}
+
+static inline void ext4_free_blocks_count_set(struct ext4_super_block *es,
+					      ext4_fsblk_t blk)
+{
+	es->s_free_blocks_count = cpu_to_le32((u32)blk);
+	es->s_free_blocks_count_hi = cpu_to_le32(blk >> 32);
+}
+
+static inline void ext4_r_blocks_count_set(struct ext4_super_block *es,
+					   ext4_fsblk_t blk)
+{
+	es->s_r_blocks_count = cpu_to_le32((u32)blk);
+	es->s_r_blocks_count_hi = cpu_to_le32(blk >> 32);
+}
+
+
+
 #define ext4_std_error(sb, errno)				\
 do {								\
 	if ((errno))						\

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ext4 kernel patches against linux-2.6.18-rc7-mm1
  2006-09-26 16:43 ext4 kernel patches against linux-2.6.18-rc7-mm1 Alexandre Ratchov
@ 2006-09-26 16:55 ` Alexandre Ratchov
  2006-09-29 20:28 ` ext4 kernel patches against linux-2.6.18-mm1 Dave Kleikamp
  1 sibling, 0 replies; 7+ messages in thread
From: Alexandre Ratchov @ 2006-09-26 16:55 UTC (permalink / raw)
  To: linux-ext4; +Cc: Jean-Pierre Dion

On Tue, Sep 26, 2006 at 06:43:47PM +0200, Alexandre Ratchov wrote:
> hi,
> 
> i've updated the ext4 kernel patches to 2.6.18-mm1. I've just done some
> reordering/simplifications and fixed some minor bugs:
> 

the subject should have been: 

Subject: ext4 kernel patches against linux-2.6.18-mm1
					   ^^^^^^^^^^
oops...

-- Alexandre

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ext4 kernel patches against linux-2.6.18-mm1
  2006-09-26 16:43 ext4 kernel patches against linux-2.6.18-rc7-mm1 Alexandre Ratchov
  2006-09-26 16:55 ` Alexandre Ratchov
@ 2006-09-29 20:28 ` Dave Kleikamp
  1 sibling, 0 replies; 7+ messages in thread
From: Dave Kleikamp @ 2006-09-29 20:28 UTC (permalink / raw)
  To: Alexandre Ratchov; +Cc: linux-ext4, Jean-Pierre Dion

On Tue, 2006-09-26 at 18:43 +0200, Alexandre Ratchov wrote:
> hi,
> 
> i've updated the ext4 kernel patches to 2.6.18-mm1. I've just done some
> reordering/simplifications and fixed some minor bugs:
> 
>  - merge all 64bit "metadata" patches together
> 
>  - fix false-positive format warnings in balloc.c and resize.c because of
>    arithmetic with 'unsigned long' variables:
> 
>    the following snippet:
> 
> 	unsigned long x;
> 	unsigned long long long y;
> 	printf("%llu", x + y);
> 	
>    triggers a warning on 64bit archs because gcc doen't
>    seem to promote x + y to unsigned long long since long and long long
>    have the same size and signedness. So we avoid the warning by:
> 
> 	printf("%llu", (unsigned long long)(x + y));
> 
>  - fix ext4_blocks_count_set() and ext4_r_blocks_count_set() to use 64bit
>    block numbers (ie ext4_fsblk_t) instead of __u32
> 
>  - coding style fixes: remove misplaced spaces, wrap some lines to 80 cols
> 
>  - fix ext4_check_descriptors() and ext4_group_add() to use 
>    ext4_blocks_count() (returns full 64bit value) instead of just reading
>    sbi->s_es->s_blocks_count (32bit low bits)
> 
>  - include fix for JBD2 not to use the same slab naming than JBD (fix from
>    Johann Lomabardi)
> 
>  - remove unused EXT4_FREE_BLOCKS_COUNT() macro
>    
>  - update missing %u -> %llu replacements in resize.c
> 
>  - make 64bit ext4_super_block getters and setters inline C functions

I made a few cleanups on top of Alexandre's.  The updated patchset can
be found at:
http://www.kernel.org/pub/linux/kernel/people/shaggy/ext4/2.6.18-mm1/

So far, compile-tested only.

First, 2.6.18-mm1 contained a patch from Eric to change inode number
types from unsigned longs to unsigned ints, so I based the rebuilt the
patches against the updated ext3 source.

Also, a couple whitespace cleanups.

Changed the type of first and last from unsigned int to unsigned long
long as suggested by Eric.

Changed journal_brelse_array to a static to avoid renaming it to jbd2_*.

> Just to "summarize" the changes, here is attached a diff between results of
> the old patch set and the updated patch set.

Good idea.  I've done the same below.

> The new patch set can be found
> here:
> 
> http://www.bullopensource.org/ext4/20060926/
> 
> there are also patches for e2fsprogs-1.39 in sync with the kernel patch set;
> both are tested on x86_64 with an 20TB devices.

I didn't touch the e2fsprogs patches.

> 
> cheers,
> 
> -- Alexandre

Thanks,
Shaggy

diff -Nurp linux-bull/fs/ext4/ialloc.c linux-new/fs/ext4/ialloc.c
--- linux-bull/fs/ext4/ialloc.c	2006-09-29 15:07:38.000000000 -0500
+++ linux-new/fs/ext4/ialloc.c	2006-09-29 14:21:19.000000000 -0500
@@ -202,7 +202,7 @@ error_return:
 static int find_group_dir(struct super_block *sb, struct inode *parent)
 {
 	int ngroups = EXT4_SB(sb)->s_groups_count;
-	unsigned long freei, avefreei;
+	unsigned int freei, avefreei;
 	struct ext4_group_desc *desc, *best_desc = NULL;
 	struct buffer_head *bh;
 	int group, best_group = -1;
@@ -261,10 +261,10 @@ static int find_group_orlov(struct super
 	struct ext4_super_block *es = sbi->s_es;
 	int ngroups = sbi->s_groups_count;
 	int inodes_per_group = EXT4_INODES_PER_GROUP(sb);
-	unsigned long freei, avefreei;
+	unsigned int freei, avefreei;
 	ext4_fsblk_t freeb, avefreeb;
 	ext4_fsblk_t blocks_per_dir;
-	unsigned long ndirs;
+	unsigned int ndirs;
 	int max_debt, max_dirs, min_inodes;
 	ext4_grpblk_t min_blocks;
 	int group = -1, i;
diff -Nurp linux-bull/fs/ext4/resize.c linux-new/fs/ext4/resize.c
--- linux-bull/fs/ext4/resize.c	2006-09-29 15:07:38.000000000 -0500
+++ linux-new/fs/ext4/resize.c	2006-09-29 14:21:19.000000000 -0500
@@ -341,14 +341,14 @@ static int verify_reserved_gdb(struct su
 	int gdbackups = 0;
 
 	while ((grp = ext4_list_backups(sb, &three, &five, &seven)) < end) {
-		if (le32_to_cpu(*p++) != 
+		if (le32_to_cpu(*p++) !=
 		    grp * EXT4_BLOCKS_PER_GROUP(sb) + blk){
 			ext4_warning(sb, __FUNCTION__,
 				     "reserved GDT %llu"
 				     " missing grp %d (%llu)",
 				     blk, grp,
-				     grp * 
-				     (ext4_fsblk_t)EXT4_BLOCKS_PER_GROUP(sb) + 
+				     grp *
+				     (ext4_fsblk_t)EXT4_BLOCKS_PER_GROUP(sb) +
 				     blk);
 			return -EINVAL;
 		}
@@ -735,7 +735,7 @@ int ext4_group_add(struct super_block *s
 		return -EPERM;
 	}
 
-	if (ext4_blocks_count(es) + input->blocks_count < 
+	if (ext4_blocks_count(es) + input->blocks_count <
 	    ext4_blocks_count(es)) {
 		ext4_warning(sb, __FUNCTION__, "blocks_count overflow\n");
 		return -EINVAL;
diff -Nurp linux-bull/fs/ext4/super.c linux-new/fs/ext4/super.c
--- linux-bull/fs/ext4/super.c	2006-09-29 15:07:38.000000000 -0500
+++ linux-new/fs/ext4/super.c	2006-09-29 14:21:19.000000000 -0500
@@ -45,7 +45,7 @@
 static int ext4_load_journal(struct super_block *, struct ext4_super_block *,
 			     unsigned long journal_devnum);
 static int ext4_create_journal(struct super_block *, struct ext4_super_block *,
-			       unsigned long);
+			       unsigned int);
 static void ext4_commit_super (struct super_block * sb,
 			       struct ext4_super_block * es,
 			       int sync);
@@ -805,7 +805,7 @@ static ext4_fsblk_t get_sb_block(void **
 }
 
 static int parse_options (char *options, struct super_block *sb,
-			  unsigned long *inum, unsigned long *journal_devnum,
+			  unsigned int *inum, unsigned long *journal_devnum,
 			  ext4_fsblk_t *n_blocks_count, int is_remount)
 {
 	struct ext4_sb_info *sbi = EXT4_SB(sb);
@@ -1451,7 +1451,7 @@ static int ext4_fill_super (struct super
 	ext4_fsblk_t sb_block = get_sb_block(&data);
 	ext4_fsblk_t logic_sb_block;
 	unsigned long offset = 0;
-	unsigned long journal_inum = 0;
+	unsigned int journal_inum = 0;
 	unsigned long journal_devnum = 0;
 	unsigned long def_mount_opts;
 	struct inode *root;
@@ -1918,7 +1918,7 @@ static void ext4_init_journal_params(str
 }
 
 static journal_t *ext4_get_journal(struct super_block *sb,
-				   unsigned long journal_inum)
+				   unsigned int journal_inum)
 {
 	struct inode *journal_inode;
 	journal_t *journal;
@@ -2053,7 +2053,7 @@ static int ext4_load_journal(struct supe
 			     unsigned long journal_devnum)
 {
 	journal_t *journal;
-	unsigned long journal_inum = le32_to_cpu(es->s_journal_inum);
+	unsigned int journal_inum = le32_to_cpu(es->s_journal_inum);
 	dev_t journal_dev;
 	int err = 0;
 	int really_read_only;
@@ -2139,7 +2139,7 @@ static int ext4_load_journal(struct supe
 
 static int ext4_create_journal(struct super_block * sb,
 			       struct ext4_super_block * es,
-			       unsigned long journal_inum)
+			       unsigned int journal_inum)
 {
 	journal_t *journal;
 
@@ -2152,7 +2152,7 @@ static int ext4_create_journal(struct su
 	if (!(journal = ext4_get_journal(sb, journal_inum)))
 		return -EINVAL;
 
-	printk(KERN_INFO "EXT4-fs: creating new journal on inode %lu\n",
+	printk(KERN_INFO "EXT4-fs: creating new journal on inode %u\n",
 	       journal_inum);
 
 	if (jbd2_journal_create(journal)) {
diff -Nurp linux-bull/fs/jbd2/journal.c linux-new/fs/jbd2/journal.c
--- linux-bull/fs/jbd2/journal.c	2006-09-29 15:07:37.000000000 -0500
+++ linux-new/fs/jbd2/journal.c	2006-09-29 14:21:19.000000000 -0500
@@ -696,7 +696,7 @@ fail:
  *  @bdev: Block device on which to create the journal
  *  @fs_dev: Device which hold journalled filesystem for this journal.
  *  @start: Block nr Start of journal.
- *  @len:  Lenght of the journal in blocks.
+ *  @len:  Length of the journal in blocks.
  *  @blocksize: blocksize of journalling device
  *  @returns: a newly created journal_t *
  *
@@ -820,7 +820,7 @@ static void journal_fail_superblock (jou
 static int journal_reset(journal_t *journal)
 {
 	journal_superblock_t *sb = journal->j_superblock;
-	unsigned int first, last;
+	unsigned long long first, last;
 
 	first = be32_to_cpu(sb->s_first);
 	last = be32_to_cpu(sb->s_maxlen);
diff -Nurp linux-bull/fs/jbd2/recovery.c linux-new/fs/jbd2/recovery.c
--- linux-bull/fs/jbd2/recovery.c	2006-09-29 15:07:37.000000000 -0500
+++ linux-new/fs/jbd2/recovery.c	2006-09-29 14:21:19.000000000 -0500
@@ -46,7 +46,7 @@ static int scan_revoke_records(journal_t
 #ifdef __KERNEL__
 
 /* Release readahead buffers after use */
-void jbd2_journal_brelse_array(struct buffer_head *b[], int n)
+static void journal_brelse_array(struct buffer_head *b[], int n)
 {
 	while (--n >= 0)
 		brelse (b[n]);
@@ -104,7 +104,7 @@ static int do_readahead(journal_t *journ
 			bufs[nbufs++] = bh;
 			if (nbufs == MAXBUF) {
 				ll_rw_block(READ, nbufs, bufs);
-				jbd2_journal_brelse_array(bufs, nbufs);
+				journal_brelse_array(bufs, nbufs);
 				nbufs = 0;
 			}
 		} else
@@ -117,7 +117,7 @@ static int do_readahead(journal_t *journ
 
 failed:
 	if (nbufs)
-		jbd2_journal_brelse_array(bufs, nbufs);
+		journal_brelse_array(bufs, nbufs);
 	return err;
 }
 
diff -Nurp linux-bull/include/linux/jbd2.h linux-new/include/linux/jbd2.h
--- linux-bull/include/linux/jbd2.h	2006-09-29 15:07:37.000000000 -0500
+++ linux-new/include/linux/jbd2.h	2006-09-29 14:21:19.000000000 -0500
@@ -985,7 +985,6 @@ extern void	   jbd2_journal_write_revoke
 extern int	jbd2_journal_set_revoke(journal_t *, unsigned long long, tid_t);
 extern int	jbd2_journal_test_revoke(journal_t *, unsigned long long, tid_t);
 extern void	jbd2_journal_clear_revoke(journal_t *);
-extern void	jbd2_journal_brelse_array(struct buffer_head *b[], int n);
 extern void	jbd2_journal_switch_revoke_table(journal_t *journal);
 
 /*

-- 
David Kleikamp
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-09-29 20:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-26 16:43 ext4 kernel patches against linux-2.6.18-rc7-mm1 Alexandre Ratchov
2006-09-26 16:55 ` Alexandre Ratchov
2006-09-29 20:28 ` ext4 kernel patches against linux-2.6.18-mm1 Dave Kleikamp
  -- strict thread matches above, loose matches on Subject: below --
2006-09-20 15:56 ext4 kernel patches against linux-2.6.18-rc7-mm1 Dave Kleikamp
2006-09-20 16:32 ` Eric Sandeen
2006-09-20 17:38   ` Eric Sandeen
2006-09-21 15:15 ` Johann Lombardi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox