Lines Matching refs:fd
195 struct hfs_find_data *fd) in hfsplus_find_cat() argument
201 hfsplus_cat_build_key_with_cnid(sb, fd->search_key, cnid); in hfsplus_find_cat()
202 err = hfs_brec_read(fd, &tmp, sizeof(hfsplus_cat_entry)); in hfsplus_find_cat()
217 hfsplus_cat_build_key_uni(fd->search_key, in hfsplus_find_cat()
220 return hfs_brec_find(fd, hfs_find_rec_by_key); in hfsplus_find_cat()
257 struct hfs_find_data fd; in hfsplus_create_cat() local
264 err = hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd); in hfsplus_create_cat()
272 err = hfs_bmap_reserve(fd.tree, 2 * fd.tree->depth); in hfsplus_create_cat()
276 hfsplus_cat_build_key_with_cnid(sb, fd.search_key, cnid); in hfsplus_create_cat()
286 err = hfs_brec_find(&fd, hfs_find_rec_by_key); in hfsplus_create_cat()
292 err = hfs_brec_insert(&fd, &entry, entry_size); in hfsplus_create_cat()
296 err = hfsplus_cat_build_key(sb, fd.search_key, dir->i_ino, str); in hfsplus_create_cat()
301 err = hfs_brec_find(&fd, hfs_find_rec_by_key); in hfsplus_create_cat()
308 err = hfs_brec_insert(&fd, &entry, entry_size); in hfsplus_create_cat()
318 hfs_find_exit(&fd); in hfsplus_create_cat()
322 hfsplus_cat_build_key_with_cnid(sb, fd.search_key, cnid); in hfsplus_create_cat()
323 if (!hfs_brec_find(&fd, hfs_find_rec_by_key)) in hfsplus_create_cat()
324 hfs_brec_remove(&fd); in hfsplus_create_cat()
326 hfs_find_exit(&fd); in hfsplus_create_cat()
333 struct hfs_find_data fd; in hfsplus_delete_cat() local
340 err = hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd); in hfsplus_delete_cat()
348 err = hfs_bmap_reserve(fd.tree, 2 * (int)fd.tree->depth - 2); in hfsplus_delete_cat()
355 hfsplus_cat_build_key_with_cnid(sb, fd.search_key, cnid); in hfsplus_delete_cat()
356 err = hfs_brec_find(&fd, hfs_find_rec_by_key); in hfsplus_delete_cat()
360 off = fd.entryoffset + in hfsplus_delete_cat()
362 fd.search_key->cat.parent = cpu_to_be32(dir->i_ino); in hfsplus_delete_cat()
363 hfs_bnode_read(fd.bnode, in hfsplus_delete_cat()
364 &fd.search_key->cat.name.length, off, 2); in hfsplus_delete_cat()
365 len = be16_to_cpu(fd.search_key->cat.name.length) * 2; in hfsplus_delete_cat()
366 hfs_bnode_read(fd.bnode, in hfsplus_delete_cat()
367 &fd.search_key->cat.name.unicode, in hfsplus_delete_cat()
369 fd.search_key->key_len = cpu_to_be16(6 + len); in hfsplus_delete_cat()
371 err = hfsplus_cat_build_key(sb, fd.search_key, dir->i_ino, str); in hfsplus_delete_cat()
376 err = hfs_brec_find(&fd, hfs_find_rec_by_key); in hfsplus_delete_cat()
380 type = hfs_bnode_read_u16(fd.bnode, fd.entryoffset); in hfsplus_delete_cat()
383 off = fd.entryoffset + offsetof(hfsplus_cat_file, data_fork); in hfsplus_delete_cat()
384 hfs_bnode_read(fd.bnode, &fork, off, sizeof(fork)); in hfsplus_delete_cat()
388 off = fd.entryoffset + in hfsplus_delete_cat()
390 hfs_bnode_read(fd.bnode, &fork, off, sizeof(fork)); in hfsplus_delete_cat()
399 if (fd.tree->keycmp(fd.search_key, (void *)&rd->key) < 0) in hfsplus_delete_cat()
404 err = hfs_brec_remove(&fd); in hfsplus_delete_cat()
408 hfsplus_cat_build_key_with_cnid(sb, fd.search_key, cnid); in hfsplus_delete_cat()
409 err = hfs_brec_find(&fd, hfs_find_rec_by_key); in hfsplus_delete_cat()
413 err = hfs_brec_remove(&fd); in hfsplus_delete_cat()
429 hfs_find_exit(&fd); in hfsplus_delete_cat()