Commit 38885bd4 authored by Coywolf Qi Hunt's avatar Coywolf Qi Hunt Committed by Linus Torvalds

[PATCH] sb_set_blocksize cleanup

sb_set_blocksize() cleanup: make sb_set_blocksize() use blksize_bits().
Signed-off-by: default avatarCoywolf Qi Hunt <qiyong@fc-cn.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a94ddf3a
...@@ -86,16 +86,12 @@ EXPORT_SYMBOL(set_blocksize); ...@@ -86,16 +86,12 @@ EXPORT_SYMBOL(set_blocksize);
int sb_set_blocksize(struct super_block *sb, int size) int sb_set_blocksize(struct super_block *sb, int size)
{ {
int bits = 9; /* 2^9 = 512 */
if (set_blocksize(sb->s_bdev, size)) if (set_blocksize(sb->s_bdev, size))
return 0; return 0;
/* If we get here, we know size is power of two /* If we get here, we know size is power of two
* and it's value is between 512 and PAGE_SIZE */ * and it's value is between 512 and PAGE_SIZE */
sb->s_blocksize = size; sb->s_blocksize = size;
for (size >>= 10; size; size >>= 1) sb->s_blocksize_bits = blksize_bits(size);
++bits;
sb->s_blocksize_bits = bits;
return sb->s_blocksize; return sb->s_blocksize;
} }
......
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