Skip to contentSkip to conversation

sb_set_blocksize cleanup

PATCH New Coywolf Qi Hunt 1 participant 1 message Feb 9, 2006 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sb_set_blocksize cleanup

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

---

fs/block_dev.c +1 -5
index 6e50346..ee78af5 100644
@@ -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;
 }
 
Signature · 1 line
Coywolf Qi Hunt