Commit f7c43950 authored by Theodore Ts'o's avatar Theodore Ts'o

ext4: Use is_power_of_2() for clarity

Signed-off-by: default avatarRobert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent c5ca7c76
...@@ -1483,7 +1483,7 @@ set_qf_format: ...@@ -1483,7 +1483,7 @@ set_qf_format:
return 0; return 0;
if (option < 0 || option > (1 << 30)) if (option < 0 || option > (1 << 30))
return 0; return 0;
if (option & (option - 1)) { if (!is_power_of_2(option)) {
printk(KERN_ERR "EXT4-fs: inode_readahead_blks" printk(KERN_ERR "EXT4-fs: inode_readahead_blks"
" must be a power of 2\n"); " must be a power of 2\n");
return 0; return 0;
...@@ -2101,8 +2101,7 @@ static ssize_t inode_readahead_blks_store(struct ext4_attr *a, ...@@ -2101,8 +2101,7 @@ static ssize_t inode_readahead_blks_store(struct ext4_attr *a,
if (parse_strtoul(buf, 0x40000000, &t)) if (parse_strtoul(buf, 0x40000000, &t))
return -EINVAL; return -EINVAL;
/* inode_readahead_blks must be a power of 2 */ if (!is_power_of_2(t))
if (t & (t-1))
return -EINVAL; return -EINVAL;
sbi->s_inode_readahead_blks = t; sbi->s_inode_readahead_blks = t;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment