Lines Matching refs:fd
88 struct hfs_find_data *fd) in __hfsplus_ext_write_extent() argument
95 hfsplus_ext_build_key(fd->search_key, inode->i_ino, hip->cached_start, in __hfsplus_ext_write_extent()
99 res = hfs_brec_find(fd, hfs_find_rec_by_key); in __hfsplus_ext_write_extent()
104 res = hfs_bmap_reserve(fd->tree, fd->tree->depth + 1); in __hfsplus_ext_write_extent()
107 hfs_brec_insert(fd, hip->cached_extents, in __hfsplus_ext_write_extent()
113 hfs_bnode_write(fd->bnode, hip->cached_extents, in __hfsplus_ext_write_extent()
114 fd->entryoffset, fd->entrylength); in __hfsplus_ext_write_extent()
134 struct hfs_find_data fd; in hfsplus_ext_write_extent_locked() local
136 res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->ext_tree, &fd); in hfsplus_ext_write_extent_locked()
139 res = __hfsplus_ext_write_extent(inode, &fd); in hfsplus_ext_write_extent_locked()
140 hfs_find_exit(&fd); in hfsplus_ext_write_extent_locked()
156 static inline int __hfsplus_ext_read_extent(struct hfs_find_data *fd, in __hfsplus_ext_read_extent() argument
162 hfsplus_ext_build_key(fd->search_key, cnid, block, type); in __hfsplus_ext_read_extent()
163 fd->key->ext.cnid = 0; in __hfsplus_ext_read_extent()
164 res = hfs_brec_find(fd, hfs_find_rec_by_key); in __hfsplus_ext_read_extent()
167 if (fd->key->ext.cnid != fd->search_key->ext.cnid || in __hfsplus_ext_read_extent()
168 fd->key->ext.fork_type != fd->search_key->ext.fork_type) in __hfsplus_ext_read_extent()
170 if (fd->entrylength != sizeof(hfsplus_extent_rec)) in __hfsplus_ext_read_extent()
172 hfs_bnode_read(fd->bnode, extent, fd->entryoffset, in __hfsplus_ext_read_extent()
177 static inline int __hfsplus_ext_cache_extent(struct hfs_find_data *fd, in __hfsplus_ext_cache_extent() argument
186 res = __hfsplus_ext_write_extent(inode, fd); in __hfsplus_ext_cache_extent()
191 res = __hfsplus_ext_read_extent(fd, hip->cached_extents, inode->i_ino, in __hfsplus_ext_cache_extent()
196 hip->cached_start = be32_to_cpu(fd->key->ext.start_block); in __hfsplus_ext_cache_extent()
209 struct hfs_find_data fd; in hfsplus_ext_read_extent() local
216 res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->ext_tree, &fd); in hfsplus_ext_read_extent()
218 res = __hfsplus_ext_cache_extent(&fd, inode, block); in hfsplus_ext_read_extent()
219 hfs_find_exit(&fd); in hfsplus_ext_read_extent()
399 struct hfs_find_data fd; in hfsplus_free_fork() local
418 res = hfs_find_init(HFSPLUS_SB(sb)->ext_tree, &fd); in hfsplus_free_fork()
422 res = __hfsplus_ext_read_extent(&fd, ext_entry, cnid, in hfsplus_free_fork()
426 start = be32_to_cpu(fd.key->ext.start_block); in hfsplus_free_fork()
427 hfs_brec_remove(&fd); in hfsplus_free_fork()
429 mutex_unlock(&fd.tree->tree_lock); in hfsplus_free_fork()
433 mutex_lock(&fd.tree->tree_lock); in hfsplus_free_fork()
435 hfs_find_exit(&fd); in hfsplus_free_fork()
547 struct hfs_find_data fd; in hfsplus_file_truncate() local
582 res = hfs_find_init(HFSPLUS_SB(sb)->ext_tree, &fd); in hfsplus_file_truncate()
590 mutex_unlock(&fd.tree->tree_lock); in hfsplus_file_truncate()
595 mutex_lock(&fd.tree->tree_lock); in hfsplus_file_truncate()
598 res = __hfsplus_ext_cache_extent(&fd, inode, alloc_cnt); in hfsplus_file_truncate()
604 hfs_brec_remove(&fd); in hfsplus_file_truncate()
605 mutex_unlock(&fd.tree->tree_lock); in hfsplus_file_truncate()
609 mutex_lock(&fd.tree->tree_lock); in hfsplus_file_truncate()
618 hfs_find_exit(&fd); in hfsplus_file_truncate()