16 static int hfs_btree_inc_height(
struct hfs_btree *);
24 dataoff = node->
tree->node_size - (rec + 2) * 2;
40 retval = node->
tree->max_key_len + 2;
43 node->
tree->node_size - (rec + 1) * 2);
46 if (recoff > node->
tree->node_size - 2) {
52 if (retval > node->
tree->max_key_len + 2) {
67 int idx_rec_off, data_rec_off, end_rec_off;
73 hfs_btree_inc_height(tree);
75 if (IS_ERR(fd->
bnode))
76 return PTR_ERR(fd->
bnode);
84 size = key_len + entry_len;
93 rec, size, end_off, end_rec_off);
94 if (size > end_rec_off - end_off) {
96 panic(
"not enough room!\n");
97 new_node = hfs_bnode_split(fd);
99 return PTR_ERR(new_node);
104 mark_inode_dirty(tree->
inode);
113 data_rec_off = end_rec_off + 2;
114 idx_rec_off = tree->
node_size - (rec + 1) * 2;
115 if (idx_rec_off == data_rec_off)
122 }
while (data_rec_off < idx_rec_off);
137 if (!rec && new_node != node)
138 hfs_brec_update_parent(fd);
142 hfs_btree_inc_height(tree);
150 entry_len =
sizeof(cnid);
170 hfs_brec_update_parent(fd);
189 mark_inode_dirty(tree->
inode);
200 return PTR_ERR(parent);
211 if (rec_off == end_off)
219 }
while (rec_off >= end_off);
227 hfs_brec_update_parent(fd);
236 int num_recs, new_rec_off, new_off, old_rec_off;
242 if (IS_ERR(new_node))
258 if (IS_ERR(next_node)) {
269 if (data_start > size)
272 if (++num_recs < node->num_recs)
282 if (fd->
record + 1 < num_recs) {
292 fd->
bnode = new_node;
302 size = data_start - new_off;
304 data_end = data_start;
310 new_off = data_end -
size;
314 hfs_bnode_copy(new_node, 14, node, data_start, data_end - data_start);
342 mark_inode_dirty(tree->
inode);
357 int rec, rec_off, end_rec_off;
358 int start_off, end_off;
369 return PTR_ERR(parent);
382 rec_off = tree->
node_size - (rec + 2) * 2;
389 if (end_rec_off - end_off < diff) {
393 new_node = hfs_bnode_split(fd);
394 if (IS_ERR(new_node))
395 return PTR_ERR(new_node);
398 rec_off = tree->
node_size - (rec + 2) * 2;
408 while (rec_off > end_rec_off) {
414 end_off - start_off);
436 if (new_node == node)
450 static int hfs_btree_inc_height(
struct hfs_btree *tree)
461 return PTR_ERR(node);
464 if (IS_ERR(new_node)) {
466 return PTR_ERR(new_node);
517 mark_inode_dirty(tree->
inode);