linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [EXT4 set 9][PATCH 2/5]Morecleanups: use is_power_of_2 () in fill_super
@ 2007-07-01  7:38 Mingming Cao
  0 siblings, 0 replies; only message in thread
From: Mingming Cao @ 2007-07-01  7:38 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel, linux-ext4

Subject: is_power_of_2: ext4/super.c
From: vignesh babu <vignesh.babu@wipro.com>

Replace (n & (n-1)) in the context of power of 2 checks with is_power_of_2()

Signed-off-by: vignesh babu <vignesh.babu@wipro.com>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
---

 fs/ext4/super.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN fs/ext4/super.c~is_power_of_2-ext4-superc fs/ext4/super.c
--- a/fs/ext4/super.c~is_power_of_2-ext4-superc
+++ a/fs/ext4/super.c
@@ -36,6 +36,7 @@
 #include <linux/namei.h>
 #include <linux/quotaops.h>
 #include <linux/seq_file.h>
+#include <linux/log2.h>

 #include <asm/uaccess.h>

@@ -1662,7 +1663,7 @@ static int ext4_fill_super (struct super
 		sbi->s_inode_size = le16_to_cpu(es->s_inode_size);
 		sbi->s_first_ino = le32_to_cpu(es->s_first_ino);
 		if ((sbi->s_inode_size < EXT4_GOOD_OLD_INODE_SIZE) ||
-		    (sbi->s_inode_size & (sbi->s_inode_size - 1)) ||
+		    (!is_power_of_2(sbi->s_inode_size)) ||
 		    (sbi->s_inode_size > blocksize)) {
 			printk (KERN_ERR
 				"EXT4-fs: unsupported inode size: %d\n",
_

Patches currently in -mm which might be from vignesh.babu@wipro.com are

git-ubi.patch
use-is_power_of_2-in-cxgb3-cxgb3_mainc.patch
use-is_power_of_2-in-myri10ge-myri10gec.patch
is_power_of_2-ext3-superc.patch
is_power_of_2-ext4-superc.patch
is_pwoer_of_2-jbd.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-01  7:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-01  7:38 [EXT4 set 9][PATCH 2/5]Morecleanups: use is_power_of_2 () in fill_super Mingming Cao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).