X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fhfsplus%2Fbtree.c;h=b07136490102519ee20ac9e3a86ce9f496aaf483;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=84870a169fc72705cb1a4f83b2d4309249fbb854;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/fs/hfsplus/btree.c b/fs/hfsplus/btree.c index 84870a169..b07136490 100644 --- a/fs/hfsplus/btree.c +++ b/fs/hfsplus/btree.c @@ -22,7 +22,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id) struct hfs_btree_header_rec *head; struct address_space *mapping; struct page *page; - unsigned int shift, size; + unsigned int size; tree = kmalloc(sizeof(*tree), GFP_KERNEL); if (!tree) @@ -69,9 +69,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id) goto fail_page; if (!tree->node_count) goto fail_page; - for (shift = 0; size >>= 1; shift += 1) - ; - tree->node_size_shift = shift; + tree->node_size_shift = ffs(size) - 1; tree->pages_per_bnode = (tree->node_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;