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)
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);