Lines Matching refs:fd
176 struct hfs_find_data *fd) in hfsplus_find_cat() argument
182 hfsplus_cat_build_key(sb, fd->search_key, cnid, NULL); in hfsplus_find_cat()
183 err = hfs_brec_read(fd, &tmp, sizeof(hfsplus_cat_entry)); in hfsplus_find_cat()
198 hfsplus_cat_build_key_uni(fd->search_key, in hfsplus_find_cat()
201 return hfs_brec_find(fd); in hfsplus_find_cat()
208 struct hfs_find_data fd; in hfsplus_create_cat() local
215 hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd); in hfsplus_create_cat()
217 hfsplus_cat_build_key(sb, fd.search_key, cnid, NULL); in hfsplus_create_cat()
222 err = hfs_brec_find(&fd); in hfsplus_create_cat()
228 err = hfs_brec_insert(&fd, &entry, entry_size); in hfsplus_create_cat()
232 hfsplus_cat_build_key(sb, fd.search_key, dir->i_ino, str); in hfsplus_create_cat()
234 err = hfs_brec_find(&fd); in hfsplus_create_cat()
241 err = hfs_brec_insert(&fd, &entry, entry_size); in hfsplus_create_cat()
249 hfs_find_exit(&fd); in hfsplus_create_cat()
253 hfsplus_cat_build_key(sb, fd.search_key, cnid, NULL); in hfsplus_create_cat()
254 if (!hfs_brec_find(&fd)) in hfsplus_create_cat()
255 hfs_brec_remove(&fd); in hfsplus_create_cat()
257 hfs_find_exit(&fd); in hfsplus_create_cat()
264 struct hfs_find_data fd; in hfsplus_delete_cat() local
272 hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd); in hfsplus_delete_cat()
277 hfsplus_cat_build_key(sb, fd.search_key, cnid, NULL); in hfsplus_delete_cat()
278 err = hfs_brec_find(&fd); in hfsplus_delete_cat()
282 off = fd.entryoffset + in hfsplus_delete_cat()
284 fd.search_key->cat.parent = cpu_to_be32(dir->i_ino); in hfsplus_delete_cat()
285 hfs_bnode_read(fd.bnode, in hfsplus_delete_cat()
286 &fd.search_key->cat.name.length, off, 2); in hfsplus_delete_cat()
287 len = be16_to_cpu(fd.search_key->cat.name.length) * 2; in hfsplus_delete_cat()
288 hfs_bnode_read(fd.bnode, in hfsplus_delete_cat()
289 &fd.search_key->cat.name.unicode, in hfsplus_delete_cat()
291 fd.search_key->key_len = cpu_to_be16(6 + len); in hfsplus_delete_cat()
293 hfsplus_cat_build_key(sb, fd.search_key, dir->i_ino, str); in hfsplus_delete_cat()
295 err = hfs_brec_find(&fd); in hfsplus_delete_cat()
299 type = hfs_bnode_read_u16(fd.bnode, fd.entryoffset); in hfsplus_delete_cat()
302 off = fd.entryoffset + offsetof(hfsplus_cat_file, data_fork); in hfsplus_delete_cat()
303 hfs_bnode_read(fd.bnode, &fork, off, sizeof(fork)); in hfsplus_delete_cat()
307 off = fd.entryoffset + in hfsplus_delete_cat()
309 hfs_bnode_read(fd.bnode, &fork, off, sizeof(fork)); in hfsplus_delete_cat()
316 if (fd.tree->keycmp(fd.search_key, (void *)&rd->key) < 0) in hfsplus_delete_cat()
320 err = hfs_brec_remove(&fd); in hfsplus_delete_cat()
324 hfsplus_cat_build_key(sb, fd.search_key, cnid, NULL); in hfsplus_delete_cat()
325 err = hfs_brec_find(&fd); in hfsplus_delete_cat()
329 err = hfs_brec_remove(&fd); in hfsplus_delete_cat()
337 hfs_find_exit(&fd); in hfsplus_delete_cat()