12 #include <linux/slab.h>
101 struct page *src_page, *dst_page;
106 tree = src_node->
tree;
109 src_page = src_node->
page[0];
110 dst_page = dst_node->
page[0];
128 page = node->
page[0];
130 memmove(ptr + dst, ptr + src, len);
147 off = node->
tree->node_size - 2;
157 tmp = node->
tree->max_key_len + 1;
211 static inline int hfs_bnode_hash(
u32 num)
213 num = (num >> 16) + num;
223 printk(
KERN_ERR "hfs: request for non-existent node %d in B*Tree\n", cnid);
227 for (node = tree->
node_hash[hfs_bnode_hash(cnid)];
229 if (node->
this == cnid) {
246 printk(
KERN_ERR "hfs: request for non-existent node %d in B*Tree\n", cnid);
250 sb = tree->
inode->i_sb;
251 size =
sizeof(
struct hfs_bnode) + tree->pages_per_bnode *
252 sizeof(
struct page *);
266 hash = hfs_bnode_hash(cnid);
278 mapping = tree->
inode->i_mapping;
283 page = read_mapping_page(mapping, block++,
NULL);
286 if (PageError(page)) {
306 for (p = &node->
tree->node_hash[hfs_bnode_hash(node->
this)];
311 node->
tree->node_hash_cnt--;
319 int i, rec_off, off, next_off;
333 node = __hfs_bnode_create(tree, num);
349 switch (node->
type) {
371 for (i = 1; i <= node->
num_recs; off = next_off, i++) {
374 if (next_off <= off ||
378 entry_size = next_off - off;
383 if (key_size >= entry_size )
395 return ERR_PTR(-
EIO);
418 node = __hfs_bnode_create(tree, num);
423 return ERR_PTR(-
EIO);