Lines Matching defs:node
129 struct hfs_bnode *node;
136 while ((node = tree->node_hash[i])) {
137 tree->node_hash[i] = node->next_hash;
138 if (atomic_read(&node->refcnt))
139 printk(KERN_ERR "hfs: node %d:%d still has %d user(s)!\n",
140 node->tree->cnid, node->this, atomic_read(&node->refcnt));
141 hfs_bnode_free(node);
152 struct hfs_bnode *node;
155 node = hfs_bnode_find(tree, 0);
156 if (IS_ERR(node))
160 page = node->page[0];
174 hfs_bnode_put(node);
180 struct hfs_bnode *node;
184 node = hfs_bnode_create(tree, idx);
185 if (IS_ERR(node))
186 return node;
195 node->type = HFS_NODE_MAP;
196 node->num_recs = 1;
197 hfs_bnode_clear(node, 0, tree->node_size);
204 hfs_bnode_write(node, &desc, 0, sizeof(desc));
205 hfs_bnode_write_u16(node, 14, 0x8000);
206 hfs_bnode_write_u16(node, tree->node_size - 2, 14);
207 hfs_bnode_write_u16(node, tree->node_size - 4, tree->node_size - 6);
209 return node;
214 struct hfs_bnode *node, *next_node;
249 node = hfs_bnode_find(tree, nidx);
250 if (IS_ERR(node))
251 return node;
252 len = hfs_brec_lenoff(node, 2, &off16);
255 off += node->page_offset;
256 pagep = node->page + (off >> PAGE_CACHE_SHIFT);
273 hfs_bnode_put(node);
287 nidx = node->next;
289 printk(KERN_DEBUG "hfs: create new bmap node...\n");
290 next_node = hfs_bmap_new_bmap(node, idx);
293 hfs_bnode_put(node);
296 node = next_node;
298 len = hfs_brec_lenoff(node, 0, &off16);
300 off += node->page_offset;
301 pagep = node->page + (off >> PAGE_CACHE_SHIFT);
307 void hfs_bmap_free(struct hfs_bnode *node)
315 dprint(DBG_BNODE_MOD, "btree_free_node: %u\n", node->this);
316 tree = node->tree;
317 nidx = node->this;
318 node = hfs_bnode_find(tree, 0);
319 if (IS_ERR(node))
321 len = hfs_brec_lenoff(node, 2, &off);
326 i = node->next;
327 hfs_bnode_put(node);
330 printk(KERN_CRIT "hfs: unable to free bnode %u. bmap not found!\n", node->this);
333 node = hfs_bnode_find(tree, i);
334 if (IS_ERR(node))
336 if (node->type != HFS_NODE_MAP) {
338 printk(KERN_CRIT "hfs: invalid bmap found! (%u,%d)\n", node->this, node->type);
339 hfs_bnode_put(node);
342 len = hfs_brec_lenoff(node, 0, &off);
344 off += node->page_offset + nidx / 8;
345 page = node->page[off >> PAGE_CACHE_SHIFT];
351 printk(KERN_CRIT "hfs: trying to free free bnode %u(%d)\n", node->this, node->type);
353 hfs_bnode_put(node);
359 hfs_bnode_put(node);