From 3f2399ef6b40be0b4a8079f6514056e3f5a5e7ac Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 24 Apr 2009 23:31:59 -0400 Subject: [PATCH] --- yaml --- r: 146361 b: refs/heads/master c: f7c439504ccba0cca43271e651013ab97a221c62 h: refs/heads/master i: 146359: bc216a165c0013fabffe8b407c42bddcb4adfa68 v: v3 --- [refs] | 2 +- trunk/fs/ext4/super.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index ed7acfbe49e6..73957cd0903f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c5ca7c7636fa689a9746b6032f83aa7fffec31c6 +refs/heads/master: f7c439504ccba0cca43271e651013ab97a221c62 diff --git a/trunk/fs/ext4/super.c b/trunk/fs/ext4/super.c index 3f4475daa66d..3e509bc647e3 100644 --- a/trunk/fs/ext4/super.c +++ b/trunk/fs/ext4/super.c @@ -1483,7 +1483,7 @@ static int parse_options(char *options, struct super_block *sb, return 0; if (option < 0 || option > (1 << 30)) return 0; - if (option & (option - 1)) { + if (!is_power_of_2(option)) { printk(KERN_ERR "EXT4-fs: inode_readahead_blks" " must be a power of 2\n"); return 0; @@ -2101,8 +2101,7 @@ static ssize_t inode_readahead_blks_store(struct ext4_attr *a, if (parse_strtoul(buf, 0x40000000, &t)) return -EINVAL; - /* inode_readahead_blks must be a power of 2 */ - if (t & (t-1)) + if (!is_power_of_2(t)) return -EINVAL; sbi->s_inode_readahead_blks = t;