Lines Matching defs:node
136 struct hfs_bnode *node;
143 while ((node = tree->node_hash[i])) {
144 tree->node_hash[i] = node->next_hash;
145 if (atomic_read(&node->refcnt))
146 printk(KERN_CRIT "hfs: node %d:%d still has %d user(s)!\n",
147 node->tree->cnid, node->this, atomic_read(&node->refcnt));
148 hfs_bnode_free(node);
159 struct hfs_bnode *node;
162 node = hfs_bnode_find(hfsplus_handle, tree, 0);
163 if (IS_ERR(node))
167 page = node->page[0];
181 hfs_bnode_put(hfsplus_handle, node);
188 struct hfs_bnode *node;
192 node = hfs_bnode_create(hfsplus_handle, tree, idx);
193 if (IS_ERR(node))
194 return node;
201 node->type = HFS_NODE_MAP;
202 node->num_recs = 1;
203 hfs_bnode_clear(hfsplus_handle, node, 0, tree->node_size);
210 hfs_bnode_write(hfsplus_handle, node, &desc, 0, sizeof(desc));
211 hfs_bnode_write_u16(hfsplus_handle, node, 14, 0x8000);
212 hfs_bnode_write_u16(hfsplus_handle, node, tree->node_size - 2, 14);
213 hfs_bnode_write_u16(hfsplus_handle, node, tree->node_size - 4, tree->node_size - 6);
215 return node;
220 struct hfs_bnode *node, *next_node;
255 node = hfs_bnode_find(hfsplus_handle, tree, nidx);
256 if (IS_ERR(node))
257 return node;
258 len = hfs_brec_lenoff(node, 2, &off16);
261 off += node->page_offset;
262 pagep = node->page + (off >> PAGE_CACHE_SHIFT);
280 hfs_bnode_put(hfsplus_handle, node);
294 nidx = node->next;
296 printk(KERN_DEBUG "hfs: create new bmap node...\n");
297 next_node = hfs_bmap_new_bmap(hfsplus_handle, node, idx);
300 hfs_bnode_put(hfsplus_handle, node);
303 node = next_node;
305 len = hfs_brec_lenoff(node, 0, &off16);
307 off += node->page_offset;
308 pagep = node->page + (off >> PAGE_CACHE_SHIFT);
314 void hfs_bmap_free(hfsplus_handle_t *hfsplus_handle, struct hfs_bnode *node)
322 dprint(DBG_BNODE_MOD, "btree_free_node: %u\n", node->this);
323 BUG_ON(!node->this);
324 tree = node->tree;
325 nidx = node->this;
326 node = hfs_bnode_find(hfsplus_handle, tree, 0);
327 if (IS_ERR(node))
329 len = hfs_brec_lenoff(node, 2, &off);
334 i = node->next;
335 hfs_bnode_put(hfsplus_handle, node);
338 printk(KERN_CRIT "hfs: unable to free bnode %u. bmap not found!\n", node->this);
341 node = hfs_bnode_find(hfsplus_handle, tree, i);
342 if (IS_ERR(node))
344 if (node->type != HFS_NODE_MAP) {
346 printk(KERN_CRIT "hfs: invalid bmap found! (%u,%d)\n", node->this, node->type);
347 hfs_bnode_put(hfsplus_handle, node);
350 len = hfs_brec_lenoff(node, 0, &off);
352 off += node->page_offset + nidx / 8;
353 page = node->page[off >> PAGE_CACHE_SHIFT];
359 printk(KERN_CRIT "hfs: trying to free free bnode %u(%d)\n", node->this, node->type);
361 hfs_bnode_put(hfsplus_handle, node);
367 hfs_bnode_put(hfsplus_handle, node);