Lines Matching refs:node
261 struct hfs_bnode *node; in hfs_btree_close() local
268 while ((node = tree->node_hash[i])) { in hfs_btree_close()
269 tree->node_hash[i] = node->next_hash; in hfs_btree_close()
270 if (atomic_read(&node->refcnt)) in hfs_btree_close()
273 node->tree->cnid, node->this, in hfs_btree_close()
274 atomic_read(&node->refcnt)); in hfs_btree_close()
275 hfs_bnode_free(node); in hfs_btree_close()
286 struct hfs_bnode *node; in hfs_btree_write() local
289 node = hfs_bnode_find(tree, 0); in hfs_btree_write()
290 if (IS_ERR(node)) in hfs_btree_write()
294 page = node->page[0]; in hfs_btree_write()
309 hfs_bnode_put(node); in hfs_btree_write()
316 struct hfs_bnode *node; in hfs_bmap_new_bmap() local
320 node = hfs_bnode_create(tree, idx); in hfs_bmap_new_bmap()
321 if (IS_ERR(node)) in hfs_bmap_new_bmap()
322 return node; in hfs_bmap_new_bmap()
329 node->type = HFS_NODE_MAP; in hfs_bmap_new_bmap()
330 node->num_recs = 1; in hfs_bmap_new_bmap()
331 hfs_bnode_clear(node, 0, tree->node_size); in hfs_bmap_new_bmap()
338 hfs_bnode_write(node, &desc, 0, sizeof(desc)); in hfs_bmap_new_bmap()
339 hfs_bnode_write_u16(node, 14, 0x8000); in hfs_bmap_new_bmap()
340 hfs_bnode_write_u16(node, tree->node_size - 2, 14); in hfs_bmap_new_bmap()
341 hfs_bnode_write_u16(node, tree->node_size - 4, tree->node_size - 6); in hfs_bmap_new_bmap()
343 return node; in hfs_bmap_new_bmap()
376 struct hfs_bnode *node, *next_node; in hfs_bmap_alloc() local
390 node = hfs_bnode_find(tree, nidx); in hfs_bmap_alloc()
391 if (IS_ERR(node)) in hfs_bmap_alloc()
392 return node; in hfs_bmap_alloc()
393 len = hfs_brec_lenoff(node, 2, &off16); in hfs_bmap_alloc()
396 off += node->page_offset; in hfs_bmap_alloc()
397 pagep = node->page + (off >> PAGE_SHIFT); in hfs_bmap_alloc()
414 hfs_bnode_put(node); in hfs_bmap_alloc()
429 nidx = node->next; in hfs_bmap_alloc()
432 next_node = hfs_bmap_new_bmap(node, idx); in hfs_bmap_alloc()
435 hfs_bnode_put(node); in hfs_bmap_alloc()
438 node = next_node; in hfs_bmap_alloc()
440 len = hfs_brec_lenoff(node, 0, &off16); in hfs_bmap_alloc()
442 off += node->page_offset; in hfs_bmap_alloc()
443 pagep = node->page + (off >> PAGE_SHIFT); in hfs_bmap_alloc()
449 void hfs_bmap_free(struct hfs_bnode *node) in hfs_bmap_free() argument
457 hfs_dbg(BNODE_MOD, "btree_free_node: %u\n", node->this); in hfs_bmap_free()
458 BUG_ON(!node->this); in hfs_bmap_free()
459 tree = node->tree; in hfs_bmap_free()
460 nidx = node->this; in hfs_bmap_free()
461 node = hfs_bnode_find(tree, 0); in hfs_bmap_free()
462 if (IS_ERR(node)) in hfs_bmap_free()
464 len = hfs_brec_lenoff(node, 2, &off); in hfs_bmap_free()
469 i = node->next; in hfs_bmap_free()
474 node->this); in hfs_bmap_free()
475 hfs_bnode_put(node); in hfs_bmap_free()
478 hfs_bnode_put(node); in hfs_bmap_free()
479 node = hfs_bnode_find(tree, i); in hfs_bmap_free()
480 if (IS_ERR(node)) in hfs_bmap_free()
482 if (node->type != HFS_NODE_MAP) { in hfs_bmap_free()
486 node->this, node->type); in hfs_bmap_free()
487 hfs_bnode_put(node); in hfs_bmap_free()
490 len = hfs_brec_lenoff(node, 0, &off); in hfs_bmap_free()
492 off += node->page_offset + nidx / 8; in hfs_bmap_free()
493 page = node->page[off >> PAGE_SHIFT]; in hfs_bmap_free()
501 node->this, node->type); in hfs_bmap_free()
503 hfs_bnode_put(node); in hfs_bmap_free()
509 hfs_bnode_put(node); in hfs_bmap_free()