Lines Matching refs:bnode
20 fd->bnode = NULL;
46 hfs_bnode_put(fd->bnode);
54 int hfs_find_1st_rec_by_cnid(struct hfs_bnode *bnode,
63 if (bnode->tree->cnid == HFSPLUS_EXT_CNID) {
66 } else if (bnode->tree->cnid == HFSPLUS_CAT_CNID) {
69 } else if (bnode->tree->cnid == HFSPLUS_ATTR_CNID) {
92 int hfs_find_rec_by_key(struct hfs_bnode *bnode,
100 cmpval = bnode->tree->keycmp(fd->key, fd->search_key);
113 /* Find the record in bnode that best matches key (not greater than...)*/
114 int __hfs_brec_find(struct hfs_bnode *bnode, struct hfs_find_data *fd,
124 e = bnode->num_recs - 1;
128 len = hfs_brec_lenoff(bnode, rec, &off);
129 keylen = hfs_brec_keylen(bnode, rec);
134 hfs_bnode_read(bnode, fd->key, off, keylen);
135 if (rec_found(bnode, fd, &b, &e, &rec)) {
142 len = hfs_brec_lenoff(bnode, e, &off);
143 keylen = hfs_brec_keylen(bnode, e);
148 hfs_bnode_read(bnode, fd->key, off, keylen);
167 struct hfs_bnode *bnode;
173 if (fd->bnode)
174 hfs_bnode_put(fd->bnode);
175 fd->bnode = NULL;
183 bnode = hfs_bnode_find(tree, nidx);
184 if (IS_ERR(bnode)) {
185 res = PTR_ERR(bnode);
186 bnode = NULL;
189 if (bnode->height != height)
191 if (bnode->type != (--height ? HFS_NODE_INDEX : HFS_NODE_LEAF))
193 bnode->parent = parent;
195 res = __hfs_brec_find(bnode, fd, do_key_compare);
202 hfs_bnode_read(bnode, &data, fd->entryoffset, 4);
204 hfs_bnode_put(bnode);
206 fd->bnode = bnode;
211 height, bnode->height, bnode->type, nidx, parent);
214 hfs_bnode_put(bnode);
227 hfs_bnode_read(fd->bnode, rec, fd->entryoffset, fd->entrylength);
234 struct hfs_bnode *bnode;
238 bnode = fd->bnode;
239 tree = bnode->tree;
245 fd->record = bnode->num_recs - 1;
246 idx = bnode->prev;
251 hfs_bnode_put(bnode);
252 bnode = hfs_bnode_find(tree, idx);
253 if (IS_ERR(bnode)) {
254 res = PTR_ERR(bnode);
255 bnode = NULL;
261 while (cnt >= bnode->num_recs - fd->record) {
262 cnt -= bnode->num_recs - fd->record;
264 idx = bnode->next;
269 hfs_bnode_put(bnode);
270 bnode = hfs_bnode_find(tree, idx);
271 if (IS_ERR(bnode)) {
272 res = PTR_ERR(bnode);
273 bnode = NULL;
280 len = hfs_brec_lenoff(bnode, fd->record, &off);
281 keylen = hfs_brec_keylen(bnode, fd->record);
290 hfs_bnode_read(bnode, fd->key, off, keylen);
292 fd->bnode = bnode;