This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / fs / hfsplus / btree.c
index b071364..84870a1 100644 (file)
@@ -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 size;
+       unsigned int shift, size;
 
        tree = kmalloc(sizeof(*tree), GFP_KERNEL);
        if (!tree)
@@ -69,7 +69,9 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
                goto fail_page;
        if (!tree->node_count)
                goto fail_page;
-       tree->node_size_shift = ffs(size) - 1;
+       for (shift = 0; size >>= 1; shift += 1)
+               ;
+       tree->node_size_shift = shift;
 
        tree->pages_per_bnode = (tree->node_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;