Lines Matching defs:bnode
20 fd->bnode = NULL;
35 hfs_bnode_put(fd->bnode);
43 int hfs_find_1st_rec_by_cnid(struct hfs_bnode *bnode,
52 if (bnode->tree->cnid == HFSPLUS_EXT_CNID) {
55 } else if (bnode->tree->cnid == HFSPLUS_CAT_CNID) {
58 } else if (bnode->tree->cnid == HFSPLUS_ATTR_CNID) {
81 int hfs_find_rec_by_key(struct hfs_bnode *bnode,
89 cmpval = bnode->tree->keycmp(fd->key, fd->search_key);
102 /* Find the record in bnode that best matches key (not greater than...)*/
103 int __hfs_brec_find(struct hfs_bnode *bnode, struct hfs_find_data *fd,
113 e = bnode->num_recs - 1;
117 len = hfs_brec_lenoff(bnode, rec, &off);
118 keylen = hfs_brec_keylen(bnode, rec);
123 hfs_bnode_read(bnode, fd->key, off, keylen);
124 if (rec_found(bnode, fd, &b, &e, &rec)) {
131 len = hfs_brec_lenoff(bnode, e, &off);
132 keylen = hfs_brec_keylen(bnode, e);
137 hfs_bnode_read(bnode, fd->key, off, keylen);
156 struct hfs_bnode *bnode;
168 if (fd->bnode)
169 hfs_bnode_put(fd->bnode);
170 fd->bnode = NULL;
178 bnode = hfs_bnode_find(tree, nidx);
179 if (IS_ERR(bnode)) {
180 res = PTR_ERR(bnode);
181 bnode = NULL;
184 if (bnode->height != height)
186 if (bnode->type != (--height ? HFS_NODE_INDEX : HFS_NODE_LEAF))
188 bnode->parent = parent;
190 res = __hfs_brec_find(bnode, fd, do_key_compare);
197 hfs_bnode_read(bnode, &data, fd->entryoffset, 4);
199 hfs_bnode_put(bnode);
201 fd->bnode = bnode;
206 height, bnode->height, bnode->type, nidx, parent);
209 hfs_bnode_put(bnode);
222 hfs_bnode_read(fd->bnode, rec, fd->entryoffset, fd->entrylength);
229 struct hfs_bnode *bnode;
233 bnode = fd->bnode;
234 tree = bnode->tree;
240 fd->record = bnode->num_recs - 1;
241 idx = bnode->prev;
246 hfs_bnode_put(bnode);
247 bnode = hfs_bnode_find(tree, idx);
248 if (IS_ERR(bnode)) {
249 res = PTR_ERR(bnode);
250 bnode = NULL;
256 while (cnt >= bnode->num_recs - fd->record) {
257 cnt -= bnode->num_recs - fd->record;
259 idx = bnode->next;
264 hfs_bnode_put(bnode);
265 bnode = hfs_bnode_find(tree, idx);
266 if (IS_ERR(bnode)) {
267 res = PTR_ERR(bnode);
268 bnode = NULL;
275 len = hfs_brec_lenoff(bnode, fd->record, &off);
276 keylen = hfs_brec_keylen(bnode, fd->record);
285 hfs_bnode_read(bnode, fd->key, off, keylen);
287 fd->bnode = bnode;