Lines Matching refs:bnode

20 	fd->bnode = NULL;
46 hfs_bnode_put(fd->bnode);
54 /* Find the record in bnode that best matches key (not greater than...)*/
55 int __hfs_brec_find(struct hfs_bnode *bnode, struct hfs_find_data *fd)
64 e = bnode->num_recs - 1;
68 len = hfs_brec_lenoff(bnode, rec, &off);
69 keylen = hfs_brec_keylen(bnode, rec);
74 hfs_bnode_read(bnode, fd->key, off, keylen);
75 cmpval = bnode->tree->keycmp(fd->key, fd->search_key);
87 len = hfs_brec_lenoff(bnode, e, &off);
88 keylen = hfs_brec_keylen(bnode, e);
93 hfs_bnode_read(bnode, fd->key, off, keylen);
110 struct hfs_bnode *bnode;
116 if (fd->bnode)
117 hfs_bnode_put(fd->bnode);
118 fd->bnode = NULL;
126 bnode = hfs_bnode_find(tree, nidx);
127 if (IS_ERR(bnode)) {
128 res = PTR_ERR(bnode);
129 bnode = NULL;
132 if (bnode->height != height)
134 if (bnode->type != (--height ? HFS_NODE_INDEX : HFS_NODE_LEAF))
136 bnode->parent = parent;
138 res = __hfs_brec_find(bnode, fd);
145 hfs_bnode_read(bnode, &data, fd->entryoffset, 4);
147 hfs_bnode_put(bnode);
149 fd->bnode = bnode;
154 height, bnode->height, bnode->type, nidx, parent);
157 hfs_bnode_put(bnode);
170 hfs_bnode_read(fd->bnode, rec, fd->entryoffset, fd->entrylength);
177 struct hfs_bnode *bnode;
181 bnode = fd->bnode;
182 tree = bnode->tree;
188 fd->record = bnode->num_recs - 1;
189 idx = bnode->prev;
194 hfs_bnode_put(bnode);
195 bnode = hfs_bnode_find(tree, idx);
196 if (IS_ERR(bnode)) {
197 res = PTR_ERR(bnode);
198 bnode = NULL;
204 while (cnt >= bnode->num_recs - fd->record) {
205 cnt -= bnode->num_recs - fd->record;
207 idx = bnode->next;
212 hfs_bnode_put(bnode);
213 bnode = hfs_bnode_find(tree, idx);
214 if (IS_ERR(bnode)) {
215 res = PTR_ERR(bnode);
216 bnode = NULL;
223 len = hfs_brec_lenoff(bnode, fd->record, &off);
224 keylen = hfs_brec_keylen(bnode, fd->record);
233 hfs_bnode_read(bnode, fd->key, off, keylen);
235 fd->bnode = bnode;