Re: [PATCH] ext4: Fix spare warnings

Previous thread: [RFC][PATCH] make mis-configured cpu hotplug safer by KAMEZAWA Hiroyuki on Thursday, September 20, 2007 - 11:54 pm. (1 message)

Next thread: [PATCH] ahci: enable GHC.AE bit before set GHC.HR by Peer Chen on Friday, September 21, 2007 - 1:28 am. (12 messages)
To: <akpm@...>
Cc: <linux-ext4@...>, <linux-kernel@...>, Aneesh Kumar K.V <aneesh.kumar@...>
Date: Friday, September 21, 2007 - 1:25 am

Also add generic_find_next_le_bit

This gets used by the ext4 multi block allocator patches.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
include/asm-generic/bitops/ext2-non-atomic.h | 2 +
include/asm-generic/bitops/le.h | 4 ++
include/asm-powerpc/bitops.h | 4 ++
include/linux/ext4_fs.h | 1 +
lib/find_next_bit.c | 44 ++++++++++++++++++++++++++
5 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/bitops/ext2-non-atomic.h b/include/asm-generic/bitops/ext2-non-atomic.h
index 1697404..63cf822 100644
--- a/include/asm-generic/bitops/ext2-non-atomic.h
+++ b/include/asm-generic/bitops/ext2-non-atomic.h
@@ -14,5 +14,7 @@
generic_find_first_zero_le_bit((unsigned long *)(addr), (size))
#define ext2_find_next_zero_bit(addr, size, off) \
generic_find_next_zero_le_bit((unsigned long *)(addr), (size), (off))
+#define ext2_find_next_bit(addr, size, off) \
+ generic_find_next_le_bit((unsigned long *)(addr), (size), (off))

#endif /* _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_ */
diff --git a/include/asm-generic/bitops/le.h b/include/asm-generic/bitops/le.h
index b9c7e5d..80e3bf1 100644
--- a/include/asm-generic/bitops/le.h
+++ b/include/asm-generic/bitops/le.h
@@ -20,6 +20,8 @@
#define generic___test_and_clear_le_bit(nr, addr) __test_and_clear_bit(nr, addr)

#define generic_find_next_zero_le_bit(addr, size, offset) find_next_zero_bit(addr, size, offset)
+#define generic_find_next_le_bit(addr, size, offset) \
+ find_next_bit(addr, size, offset)

#elif defined(__BIG_ENDIAN)

@@ -42,6 +44,8 @@

extern unsigned long generic_find_next_zero_le_bit(const unsigned long *addr,
unsigned long size, unsigned long offset);
+extern unsigned long generic_find_next_le_bit(const unsigned long *addr,
+ unsigned long size, unsigned long offset);

#else
#error "Please fix <asm/byteorder.h>"
diff --git a/include/asm-powerpc...

To: Aneesh Kumar K.V <aneesh.kumar@...>
Cc: <linux-ext4@...>, <linux-kernel@...>
Date: Tuesday, November 13, 2007 - 3:59 am

arm allmodconfig:

fs/ext4/mballoc.c: In function `ext4_mb_generate_buddy':
fs/ext4/mballoc.c:836: error: implicit declaration of function `ext2_find_next_bit'

This patch makes my head spin.

Why did we declare generic_find_next_le_bit() in
include/asm-powerpc/bitops.h (wrong) as well as in
include/asm-generic/bitops/le.h (presumably correct)?

Why is it touching a powerpc file and no any other architectures?
Something screwed up in powerpc land?

And why did arm break?

Shudder. Anyway, please fix, and if that fix requires that various
braindamaged be repaired, please repair the braindamage rather than going
along with it.

Thanks.

-

To: Andrew Morton <akpm@...>
Cc: <linux-ext4@...>, <linux-kernel@...>
Date: Tuesday, November 13, 2007 - 3:11 pm

I was following the coding style used for rest of the APIs

arm and below list of arch doesn't include the asm-generic/bitops/ext2-non-atomic.h

I did a grep and that list the below architectures as also affected.

That should be a separate patch altogether. I wanted to do the cleanup
along with the usages such as but never got time to do the same.

#define ocfs2_set_bit ext2_set_bit
#define udf_set_bit(nr,addr) ext2_set_bit(nr,addr)
direct usage in mb
md/bitmap.c +799
md/dm-log.c +177

I will send a patch tomorrow that fix arm and other architectures. I guess the cleanup
can be a separate patch ?

-aneesh

-

To: Aneesh Kumar K.V <aneesh.kumar@...>
Cc: <linux-ext4@...>, <linux-kernel@...>
Date: Tuesday, November 13, 2007 - 4:43 pm

Well. There's quite a bit of cruft in there. If you do come across
something which isn't right, please do try to find the time to fix it up
first.

That might be non-trivial - powerpc does seem to have gone off on a strange

Yes, that's a separate work, thanks.

-

To: Aneesh Kumar K.V <aneesh.kumar@...>
Cc: <akpm@...>, <linux-ext4@...>, <linux-kernel@...>
Date: Friday, September 21, 2007 - 2:43 am

Looks like it's a straight forward on Little Endian Architectures.

--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
-

To: <balbir@...>
Cc: <akpm@...>, <linux-ext4@...>, <linux-kernel@...>
Date: Friday, September 21, 2007 - 5:08 am

All include/asm-<arch>/bitops.h except powerpc have

#include <asm-generic/bitops/ext2-non-atomic.h>

and ext2-non-atomic.h have #include <asm-generic/bitops/le.h>

-aneesh
-

To: <akpm@...>
Cc: <linux-ext4@...>, <linux-kernel@...>, Aneesh Kumar K.V <aneesh.kumar@...>
Date: Friday, September 21, 2007 - 1:25 am

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
fs/ext4/inode.c | 6 ++++--
include/linux/ext4_fs.h | 16 ++++++++--------
2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index a4848e0..307e240 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3177,12 +3177,14 @@ int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode)
iloc, handle);
if (ret) {
EXT4_I(inode)->i_state |= EXT4_STATE_NO_EXPAND;
- if (mnt_count != sbi->s_es->s_mnt_count) {
+ if (mnt_count !=
+ le16_to_cpu(sbi->s_es->s_mnt_count)) {
ext4_warning(inode->i_sb, __FUNCTION__,
"Unable to expand inode %lu. Delete"
" some EAs or run e2fsck.",
inode->i_ino);
- mnt_count = sbi->s_es->s_mnt_count;
+ mnt_count =
+ le16_to_cpu(sbi->s_es->s_mnt_count);
}
}
}
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index c7b9bb2..ab7edaa 100644
--- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -129,7 +129,7 @@ struct ext4_group_desc
__le16 bg_free_blocks_count; /* Free blocks count */
__le16 bg_free_inodes_count; /* Free inodes count */
__le16 bg_used_dirs_count; /* Directories count */
- __u16 bg_flags;
+ __le16 bg_flags;
__u32 bg_reserved[3];
__le32 bg_block_bitmap_hi; /* Blocks bitmap block MSB */
__le32 bg_inode_bitmap_hi; /* Inodes bitmap block MSB */
@@ -596,13 +596,13 @@ struct ext4_super_block {
/*150*/ __le32 s_blocks_count_hi; /* Blocks count */
__le32 s_r_blocks_count_hi; /* Reserved blocks count */
__le32 s_free_blocks_count_hi; /* Free blocks count */
- __u16 s_min_extra_isize; /* All inodes have at least # bytes */
- __u16 s_want_extra_isize; /* New inodes should reserve # bytes */
- __u32 s_flags; /* Miscellaneous flags */
- __u16 s_raid_stride; /* RAID stride */
- __u16 s_mmp_interval; /* # seconds to wait in MMP checking */
- __u64 s...

To: Aneesh Kumar K.V <aneesh.kumar@...>
Cc: <akpm@...>, <linux-ext4@...>, <linux-kernel@...>
Date: Friday, September 21, 2007 - 2:02 am

Aneesh,

The subject is a bit confusing, I presume you mean sparse warnings

Balbir
-

To: Balbir Singh <balbir@...>
Cc: <akpm@...>, <linux-ext4@...>, <linux-kernel@...>
Date: Friday, September 21, 2007 - 5:04 am

yes. I will send an updated patch. The group descriptor bg_flags -> le16 conversion
should actually go with the uninitialized block group patch.

-aneesh.
-

Previous thread: [RFC][PATCH] make mis-configured cpu hotplug safer by KAMEZAWA Hiroyuki on Thursday, September 20, 2007 - 11:54 pm. (1 message)

Next thread: [PATCH] ahci: enable GHC.AE bit before set GHC.HR by Peer Chen on Friday, September 21, 2007 - 1:28 am. (12 messages)