Commit 38885bd4c2a4b59ddb22271d3e6c621859c76f02
Committed by
Linus Torvalds
1 parent
a94ddf3ab8
Exists in
master
and in
4 other branches
[PATCH] sb_set_blocksize cleanup
sb_set_blocksize() cleanup: make sb_set_blocksize() use blksize_bits(). Signed-off-by: Coywolf Qi Hunt <qiyong@fc-cn.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 1 changed file with 1 additions and 5 deletions Side-by-side Diff
fs/block_dev.c
... | ... | @@ -86,16 +86,12 @@ |
86 | 86 | |
87 | 87 | int sb_set_blocksize(struct super_block *sb, int size) |
88 | 88 | { |
89 | - int bits = 9; /* 2^9 = 512 */ | |
90 | - | |
91 | 89 | if (set_blocksize(sb->s_bdev, size)) |
92 | 90 | return 0; |
93 | 91 | /* If we get here, we know size is power of two |
94 | 92 | * and it's value is between 512 and PAGE_SIZE */ |
95 | 93 | sb->s_blocksize = size; |
96 | - for (size >>= 10; size; size >>= 1) | |
97 | - ++bits; | |
98 | - sb->s_blocksize_bits = bits; | |
94 | + sb->s_blocksize_bits = blksize_bits(size); | |
99 | 95 | return sb->s_blocksize; |
100 | 96 | } |
101 | 97 |