Lines Matching refs:node
260 struct hfs_bnode *node; in hfs_btree_close() local
267 while ((node = tree->node_hash[i])) { in hfs_btree_close()
268 tree->node_hash[i] = node->next_hash; in hfs_btree_close()
269 if (atomic_read(&node->refcnt)) in hfs_btree_close()
272 node->tree->cnid, node->this, in hfs_btree_close()
273 atomic_read(&node->refcnt)); in hfs_btree_close()
274 hfs_bnode_free(node); in hfs_btree_close()
285 struct hfs_bnode *node; in hfs_btree_write() local
288 node = hfs_bnode_find(tree, 0); in hfs_btree_write()
289 if (IS_ERR(node)) in hfs_btree_write()
293 page = node->page[0]; in hfs_btree_write()
308 hfs_bnode_put(node); in hfs_btree_write()
315 struct hfs_bnode *node; in hfs_bmap_new_bmap() local
319 node = hfs_bnode_create(tree, idx); in hfs_bmap_new_bmap()
320 if (IS_ERR(node)) in hfs_bmap_new_bmap()
321 return node; in hfs_bmap_new_bmap()
328 node->type = HFS_NODE_MAP; in hfs_bmap_new_bmap()
329 node->num_recs = 1; in hfs_bmap_new_bmap()
330 hfs_bnode_clear(node, 0, tree->node_size); in hfs_bmap_new_bmap()
337 hfs_bnode_write(node, &desc, 0, sizeof(desc)); in hfs_bmap_new_bmap()
338 hfs_bnode_write_u16(node, 14, 0x8000); in hfs_bmap_new_bmap()
339 hfs_bnode_write_u16(node, tree->node_size - 2, 14); in hfs_bmap_new_bmap()
340 hfs_bnode_write_u16(node, tree->node_size - 4, tree->node_size - 6); in hfs_bmap_new_bmap()
342 return node; in hfs_bmap_new_bmap()
375 struct hfs_bnode *node, *next_node; in hfs_bmap_alloc() local
389 node = hfs_bnode_find(tree, nidx); in hfs_bmap_alloc()
390 if (IS_ERR(node)) in hfs_bmap_alloc()
391 return node; in hfs_bmap_alloc()
392 len = hfs_brec_lenoff(node, 2, &off16); in hfs_bmap_alloc()
395 off += node->page_offset; in hfs_bmap_alloc()
396 pagep = node->page + (off >> PAGE_SHIFT); in hfs_bmap_alloc()
413 hfs_bnode_put(node); in hfs_bmap_alloc()
428 nidx = node->next; in hfs_bmap_alloc()
431 next_node = hfs_bmap_new_bmap(node, idx); in hfs_bmap_alloc()
434 hfs_bnode_put(node); in hfs_bmap_alloc()
437 node = next_node; in hfs_bmap_alloc()
439 len = hfs_brec_lenoff(node, 0, &off16); in hfs_bmap_alloc()
441 off += node->page_offset; in hfs_bmap_alloc()
442 pagep = node->page + (off >> PAGE_SHIFT); in hfs_bmap_alloc()
448 void hfs_bmap_free(struct hfs_bnode *node) in hfs_bmap_free() argument
456 hfs_dbg(BNODE_MOD, "btree_free_node: %u\n", node->this); in hfs_bmap_free()
457 BUG_ON(!node->this); in hfs_bmap_free()
458 tree = node->tree; in hfs_bmap_free()
459 nidx = node->this; in hfs_bmap_free()
460 node = hfs_bnode_find(tree, 0); in hfs_bmap_free()
461 if (IS_ERR(node)) in hfs_bmap_free()
463 len = hfs_brec_lenoff(node, 2, &off); in hfs_bmap_free()
468 i = node->next; in hfs_bmap_free()
473 node->this); in hfs_bmap_free()
474 hfs_bnode_put(node); in hfs_bmap_free()
477 hfs_bnode_put(node); in hfs_bmap_free()
478 node = hfs_bnode_find(tree, i); in hfs_bmap_free()
479 if (IS_ERR(node)) in hfs_bmap_free()
481 if (node->type != HFS_NODE_MAP) { in hfs_bmap_free()
485 node->this, node->type); in hfs_bmap_free()
486 hfs_bnode_put(node); in hfs_bmap_free()
489 len = hfs_brec_lenoff(node, 0, &off); in hfs_bmap_free()
491 off += node->page_offset + nidx / 8; in hfs_bmap_free()
492 page = node->page[off >> PAGE_SHIFT]; in hfs_bmap_free()
500 node->this, node->type); in hfs_bmap_free()
502 hfs_bnode_put(node); in hfs_bmap_free()
508 hfs_bnode_put(node); in hfs_bmap_free()