VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / fs / hfs / btree.c
index 3e620ef..19f10cf 100644 (file)
@@ -19,7 +19,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
        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)
@@ -82,10 +82,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
                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;
 
        kunmap(page);