public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] sb_set_blocksize cleanup
@ 2006-02-09  9:40 Coywolf Qi Hunt
  0 siblings, 0 replies; only message in thread
From: Coywolf Qi Hunt @ 2006-02-09  9:40 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

sb_set_blocksize() cleanup: make sb_set_blocksize() use blksize_bits().

Signed-off-by: Coywolf Qi Hunt <qiyong@fc-cn.com>
---

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 6e50346..ee78af5 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -86,16 +86,12 @@ EXPORT_SYMBOL(set_blocksize);
 
 int sb_set_blocksize(struct super_block *sb, int size)
 {
-	int bits = 9; /* 2^9 = 512 */
-
 	if (set_blocksize(sb->s_bdev, size))
 		return 0;
 	/* If we get here, we know size is power of two
 	 * and it's value is between 512 and PAGE_SIZE */
 	sb->s_blocksize = size;
-	for (size >>= 10; size; size >>= 1)
-		++bits;
-	sb->s_blocksize_bits = bits;
+	sb->s_blocksize_bits = blksize_bits(size);
 	return sb->s_blocksize;
 }
 

-- 
Coywolf Qi Hunt

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

only message in thread, other threads:[~2006-02-09  9:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-09  9:40 [patch] sb_set_blocksize cleanup Coywolf Qi Hunt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox