/fs/hfs/ |
D | btree.c | 19 struct hfs_btree *tree; in hfs_btree_open() local 25 tree = kzalloc(sizeof(*tree), GFP_KERNEL); in hfs_btree_open() 26 if (!tree) in hfs_btree_open() 29 init_MUTEX(&tree->tree_lock); in hfs_btree_open() 30 spin_lock_init(&tree->hash_lock); in hfs_btree_open() 32 tree->sb = sb; in hfs_btree_open() 33 tree->cnid = id; in hfs_btree_open() 34 tree->keycmp = keycmp; in hfs_btree_open() 36 tree->inode = iget_locked(sb, id); in hfs_btree_open() 37 if (!tree->inode) in hfs_btree_open() [all …]
|
D | brec.c | 15 static int hfs_btree_inc_height(struct hfs_btree *tree); 23 dataoff = node->tree->node_size - (rec + 2) * 2; in hfs_brec_lenoff() 38 !(node->tree->attributes & HFS_TREE_VARIDXKEYS)) { in hfs_brec_keylen() 39 if (node->tree->attributes & HFS_TREE_BIGKEYS) in hfs_brec_keylen() 40 retval = node->tree->max_key_len + 2; in hfs_brec_keylen() 42 retval = node->tree->max_key_len + 1; in hfs_brec_keylen() 44 recoff = hfs_bnode_read_u16(node, node->tree->node_size - (rec + 1) * 2); in hfs_brec_keylen() 47 if (node->tree->attributes & HFS_TREE_BIGKEYS) { in hfs_brec_keylen() 49 if (retval > node->tree->max_key_len + 2) { in hfs_brec_keylen() 56 if (retval > node->tree->max_key_len + 1) { in hfs_brec_keylen() [all …]
|
D | bnode.c | 46 struct hfs_btree *tree; in hfs_bnode_read_key() local 49 tree = node->tree; in hfs_bnode_read_key() 51 tree->attributes & HFS_TREE_VARIDXKEYS) in hfs_bnode_read_key() 54 key_len = tree->max_key_len + 1; in hfs_bnode_read_key() 99 struct hfs_btree *tree; in hfs_bnode_copy() local 105 tree = src_node->tree; in hfs_bnode_copy() 146 off = node->tree->node_size - 2; in hfs_bnode_dump() 153 if (node->tree->attributes & HFS_TREE_VARIDXKEYS) in hfs_bnode_dump() 156 tmp = node->tree->max_key_len + 1; in hfs_bnode_dump() 172 struct hfs_btree *tree; in hfs_bnode_unlink() local [all …]
|
D | bfind.c | 14 int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd) in hfs_find_init() argument 18 fd->tree = tree; in hfs_find_init() 20 ptr = kmalloc(tree->max_key_len * 2 + 4, GFP_KERNEL); in hfs_find_init() 24 fd->key = ptr + tree->max_key_len + 2; in hfs_find_init() 25 dprint(DBG_BNODE_REFS, "find_init: %d (%p)\n", tree->cnid, __builtin_return_address(0)); in hfs_find_init() 26 down(&tree->tree_lock); in hfs_find_init() 34 dprint(DBG_BNODE_REFS, "find_exit: %d (%p)\n", fd->tree->cnid, __builtin_return_address(0)); in hfs_find_exit() 35 up(&fd->tree->tree_lock); in hfs_find_exit() 36 fd->tree = NULL; in hfs_find_exit() 60 cmpval = bnode->tree->keycmp(fd->key, fd->search_key); in __hfs_brec_find() [all …]
|
D | inode.c | 57 struct hfs_btree *tree; in hfs_releasepage() local 64 tree = HFS_SB(sb)->ext_tree; in hfs_releasepage() 67 tree = HFS_SB(sb)->cat_tree; in hfs_releasepage() 73 if (tree->node_size >= PAGE_CACHE_SIZE) { in hfs_releasepage() 74 nidx = page->index >> (tree->node_size_shift - PAGE_CACHE_SHIFT); in hfs_releasepage() 75 spin_lock(&tree->hash_lock); in hfs_releasepage() 76 node = hfs_bnode_findhash(tree, nidx); in hfs_releasepage() 85 spin_unlock(&tree->hash_lock); in hfs_releasepage() 87 nidx = page->index << (PAGE_CACHE_SHIFT - tree->node_size_shift); in hfs_releasepage() 88 i = 1 << (PAGE_CACHE_SHIFT - tree->node_size_shift); in hfs_releasepage() [all …]
|
D | btree.h | 46 struct hfs_btree *tree; member 72 struct hfs_btree *tree; member
|
/fs/hfsplus/ |
D | btree.c | 22 struct hfs_btree *tree; in hfs_btree_open() local 29 tree = kzalloc(sizeof(*tree), GFP_KERNEL); in hfs_btree_open() 30 if (!tree) in hfs_btree_open() 33 init_MUTEX(&tree->tree_lock); in hfs_btree_open() 34 spin_lock_init(&tree->hash_lock); in hfs_btree_open() 35 tree->sb = sb; in hfs_btree_open() 36 tree->cnid = id; in hfs_btree_open() 40 tree->inode = inode; in hfs_btree_open() 42 mapping = tree->inode->i_mapping; in hfs_btree_open() 49 tree->root = be32_to_cpu(head->root); in hfs_btree_open() [all …]
|
D | brec.c | 24 dataoff = node->tree->node_size - (rec + 2) * 2; in hfs_brec_lenoff() 39 !(node->tree->attributes & HFS_TREE_VARIDXKEYS)) { in hfs_brec_keylen() 40 retval = node->tree->max_key_len + 2; in hfs_brec_keylen() 42 recoff = hfs_bnode_read_u16(node, node->tree->node_size - (rec + 1) * 2); in hfs_brec_keylen() 45 if (node->tree->attributes & HFS_TREE_BIGKEYS) in hfs_brec_keylen() 55 struct hfs_btree *tree; in hfs_brec_insert() local 62 tree = fd->tree; in hfs_brec_insert() 64 if (!tree->root) in hfs_brec_insert() 65 hfs_btree_inc_height(tree); in hfs_brec_insert() 66 fd->bnode = hfs_bnode_find(tree, tree->leaf_head); in hfs_brec_insert() [all …]
|
D | bnode.c | 60 struct hfs_btree *tree; in hfs_bnode_read_key() local 63 tree = node->tree; in hfs_bnode_read_key() 65 tree->attributes & HFS_TREE_VARIDXKEYS) in hfs_bnode_read_key() 68 key_len = tree->max_key_len + 2; in hfs_bnode_read_key() 128 struct hfs_btree *tree; in hfs_bnode_copy() local 135 tree = src_node->tree; in hfs_bnode_copy() 306 off = node->tree->node_size - 2; in hfs_bnode_dump() 313 if (node->tree->attributes & HFS_TREE_VARIDXKEYS) in hfs_bnode_dump() 316 tmp = node->tree->max_key_len + 2; in hfs_bnode_dump() 332 struct hfs_btree *tree; in hfs_bnode_unlink() local [all …]
|
D | bfind.c | 14 int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd) in hfs_find_init() argument 18 fd->tree = tree; in hfs_find_init() 20 ptr = kmalloc(tree->max_key_len * 2 + 4, GFP_KERNEL); in hfs_find_init() 24 fd->key = ptr + tree->max_key_len + 2; in hfs_find_init() 25 dprint(DBG_BNODE_REFS, "find_init: %d (%p)\n", tree->cnid, __builtin_return_address(0)); in hfs_find_init() 26 down(&tree->tree_lock); in hfs_find_init() 34 dprint(DBG_BNODE_REFS, "find_exit: %d (%p)\n", fd->tree->cnid, __builtin_return_address(0)); in hfs_find_exit() 35 up(&fd->tree->tree_lock); in hfs_find_exit() 36 fd->tree = NULL; in hfs_find_exit() 56 cmpval = bnode->tree->keycmp(fd->key, fd->search_key); in __hfs_brec_find() [all …]
|
D | inode.c | 49 struct hfs_btree *tree; in hfsplus_releasepage() local 56 tree = HFSPLUS_SB(sb).ext_tree; in hfsplus_releasepage() 59 tree = HFSPLUS_SB(sb).cat_tree; in hfsplus_releasepage() 62 tree = HFSPLUS_SB(sb).attr_tree; in hfsplus_releasepage() 68 if (!tree) in hfsplus_releasepage() 70 if (tree->node_size >= PAGE_CACHE_SIZE) { in hfsplus_releasepage() 71 nidx = page->index >> (tree->node_size_shift - PAGE_CACHE_SHIFT); in hfsplus_releasepage() 72 spin_lock(&tree->hash_lock); in hfsplus_releasepage() 73 node = hfs_bnode_findhash(tree, nidx); in hfsplus_releasepage() 82 spin_unlock(&tree->hash_lock); in hfsplus_releasepage() [all …]
|
/fs/btrfs/ |
D | ref-cache.c | 123 struct btrfs_leaf_ref_tree *tree = root->ref_tree; in btrfs_remove_leaf_refs() local 126 tree = &root->fs_info->shared_ref_tree; in btrfs_remove_leaf_refs() 127 if (!tree) in btrfs_remove_leaf_refs() 130 spin_lock(&tree->lock); in btrfs_remove_leaf_refs() 131 while (!list_empty(&tree->list)) { in btrfs_remove_leaf_refs() 132 ref = list_entry(tree->list.next, struct btrfs_leaf_ref, list); in btrfs_remove_leaf_refs() 133 BUG_ON(ref->tree != tree); in btrfs_remove_leaf_refs() 137 cond_resched_lock(&tree->lock); in btrfs_remove_leaf_refs() 141 rb_erase(&ref->rb_node, &tree->root); in btrfs_remove_leaf_refs() 144 spin_unlock(&tree->lock); in btrfs_remove_leaf_refs() [all …]
|
D | extent_io.c | 47 struct extent_io_tree *tree; member 87 state->state, state->tree, atomic_read(&state->refs)); in extent_io_exit() 107 void extent_io_tree_init(struct extent_io_tree *tree, in extent_io_tree_init() argument 110 tree->state.rb_node = NULL; in extent_io_tree_init() 111 tree->buffer.rb_node = NULL; in extent_io_tree_init() 112 tree->ops = NULL; in extent_io_tree_init() 113 tree->dirty_bytes = 0; in extent_io_tree_init() 114 spin_lock_init(&tree->lock); in extent_io_tree_init() 115 spin_lock_init(&tree->buffer_lock); in extent_io_tree_init() 116 tree->mapping = mapping; in extent_io_tree_init() [all …]
|
D | extent_io.h | 83 struct extent_io_tree *tree; member 134 void extent_io_tree_init(struct extent_io_tree *tree, 137 struct extent_io_tree *tree, struct page *page, 139 int try_release_extent_buffer(struct extent_io_tree *tree, struct page *page); 141 struct extent_io_tree *tree, struct page *page, 143 int lock_extent(struct extent_io_tree *tree, u64 start, u64 end, gfp_t mask); 144 int unlock_extent(struct extent_io_tree *tree, u64 start, u64 end, gfp_t mask); 145 int try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end, 147 int extent_read_full_page(struct extent_io_tree *tree, struct page *page, 152 u64 count_range_bits(struct extent_io_tree *tree, [all …]
|
D | ordered-data.c | 132 static inline struct rb_node *tree_search(struct btrfs_ordered_inode_tree *tree, in tree_search() argument 135 struct rb_root *root = &tree->tree; in tree_search() 140 if (tree->last) { in tree_search() 141 entry = rb_entry(tree->last, struct btrfs_ordered_extent, in tree_search() 144 return tree->last; in tree_search() 150 tree->last = ret; in tree_search() 170 struct btrfs_ordered_inode_tree *tree; in btrfs_add_ordered_extent() local 174 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_add_ordered_extent() 179 mutex_lock(&tree->mutex); in btrfs_add_ordered_extent() 194 node = tree_insert(&tree->tree, file_offset, in btrfs_add_ordered_extent() [all …]
|
D | ref-cache.h | 33 struct btrfs_leaf_ref_tree *tree; member 53 static inline void btrfs_leaf_ref_tree_init(struct btrfs_leaf_ref_tree *tree) in btrfs_leaf_ref_tree_init() argument 55 tree->root.rb_node = NULL; in btrfs_leaf_ref_tree_init() 56 INIT_LIST_HEAD(&tree->list); in btrfs_leaf_ref_tree_init() 57 spin_lock_init(&tree->lock); in btrfs_leaf_ref_tree_init() 60 static inline int btrfs_leaf_ref_tree_empty(struct btrfs_leaf_ref_tree *tree) in btrfs_leaf_ref_tree_empty() argument 62 return RB_EMPTY_ROOT(&tree->root); in btrfs_leaf_ref_tree_empty() 65 void btrfs_leaf_ref_tree_init(struct btrfs_leaf_ref_tree *tree);
|
D | extent_map.c | 41 void extent_map_tree_init(struct extent_map_tree *tree, gfp_t mask) in extent_map_tree_init() argument 43 tree->map.rb_node = NULL; in extent_map_tree_init() 44 spin_lock_init(&tree->lock); in extent_map_tree_init() 219 int add_extent_mapping(struct extent_map_tree *tree, in add_extent_mapping() argument 227 exist = lookup_extent_mapping(tree, em->start, em->len); in add_extent_mapping() 233 assert_spin_locked(&tree->lock); in add_extent_mapping() 234 rb = tree_insert(&tree->map, em->start, &em->rb_node); in add_extent_mapping() 251 rb_erase(&merge->rb_node, &tree->map); in add_extent_mapping() 261 rb_erase(&merge->rb_node, &tree->map); in add_extent_mapping() 289 struct extent_map *lookup_extent_mapping(struct extent_map_tree *tree, in lookup_extent_mapping() argument [all …]
|
D | Makefile | 5 btrfs-y := super.o ctree.o extent-tree.o print-tree.o root-tree.o dir-item.o \ 7 transaction.o inode.o file.o tree-defrag.o \ 10 ref-cache.o export.o tree-log.o acl.o free-space-cache.o zlib.o \
|
D | extent_map.h | 51 void extent_map_tree_init(struct extent_map_tree *tree, gfp_t mask); 52 struct extent_map *lookup_extent_mapping(struct extent_map_tree *tree, 54 int add_extent_mapping(struct extent_map_tree *tree, 56 int remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em);
|
D | compression.c | 167 struct extent_io_tree *tree; in end_compressed_bio_read() local 191 tree = &BTRFS_I(inode)->io_tree; in end_compressed_bio_read() 279 struct extent_io_tree *tree; in end_compressed_bio_write() local 298 tree = &BTRFS_I(inode)->io_tree; in end_compressed_bio_write() 300 tree->ops->writepage_end_io_hook(cb->compressed_pages[0], in end_compressed_bio_write() 451 struct extent_io_tree *tree; in add_ra_bio_pages() local 458 tree = &BTRFS_I(inode)->io_tree; in add_ra_bio_pages() 509 lock_extent(tree, last_offset, end, GFP_NOFS); in add_ra_bio_pages() 519 unlock_extent(tree, last_offset, end, GFP_NOFS); in add_ra_bio_pages() 547 unlock_extent(tree, last_offset, end, GFP_NOFS); in add_ra_bio_pages() [all …]
|
D | disk-io.c | 322 struct extent_io_tree *tree; in csum_dirty_buffer() local 330 tree = &BTRFS_I(page->mapping->host)->io_tree; in csum_dirty_buffer() 339 eb = alloc_extent_buffer(tree, start, len, page, GFP_NOFS); in csum_dirty_buffer() 396 struct extent_io_tree *tree; in btree_readpage_end_io_hook() local 404 tree = &BTRFS_I(page->mapping->host)->io_tree; in btree_readpage_end_io_hook() 413 eb = alloc_extent_buffer(tree, start, len, page, GFP_NOFS); in btree_readpage_end_io_hook() 670 struct extent_io_tree *tree; in btree_writepage() local 671 tree = &BTRFS_I(page->mapping->host)->io_tree; in btree_writepage() 678 return extent_write_full_page(tree, page, btree_get_extent, wbc); in btree_writepage() 684 struct extent_io_tree *tree; in btree_writepages() local [all …]
|
D | ordered-data.h | 25 struct rb_root tree; member 129 t->tree.rb_node = NULL; in btrfs_ordered_inode_tree_init()
|
D | volumes.h | 133 void btrfs_mapping_init(struct btrfs_mapping_tree *tree); 134 void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree);
|
/fs/ocfs2/ |
D | uptodate.c | 118 unsigned int tree, to_purge, purged; in ocfs2_metadata_cache_purge() local 123 tree = !(oi->ip_flags & OCFS2_INODE_CACHE_INLINE); in ocfs2_metadata_cache_purge() 127 tree ? "array" : "tree", (unsigned long long)oi->ip_blkno); in ocfs2_metadata_cache_purge() 132 if (tree) in ocfs2_metadata_cache_purge() 142 if (tree && purged != to_purge) in ocfs2_metadata_cache_purge() 308 struct ocfs2_meta_cache_item **tree) in ocfs2_expand_cache() argument 325 tree[i]->c_block = ci->ci_cache.ci_array[i]; in ocfs2_expand_cache() 333 __ocfs2_insert_cache_tree(ci, tree[i]); in ocfs2_expand_cache() 334 tree[i] = NULL; in ocfs2_expand_cache() 350 struct ocfs2_meta_cache_item *tree[OCFS2_INODE_MAX_CACHE_ARRAY] = in __ocfs2_set_buffer_uptodate() local [all …]
|
/fs/jfs/ |
D | jfs_dmap.c | 1129 if (dp->tree.leafidx != cpu_to_le32(LEAFIND)) { in dbAllocNext() 1137 leaf = dp->tree.stree + le32_to_cpu(dp->tree.leafidx); in dbAllocNext() 1260 if (dp->tree.leafidx != cpu_to_le32(LEAFIND)) { in dbAllocNear() 1266 leaf = dp->tree.stree + le32_to_cpu(dp->tree.leafidx); in dbAllocNear() 1787 if (dp->tree.stree[ROOT] != L2BPERDMAP) { in dbAllocCtl() 1903 if (dbFindLeaf((dmtree_t *) & dp->tree, l2nb, &leafidx)) in dbAllocDmapLev() 1915 if (dp->tree.stree[leafidx + LEAFIND] < BUDMIN) in dbAllocDmapLev() 1962 oldroot = dp->tree.stree[ROOT]; in dbAllocDmap() 1968 if (dp->tree.stree[ROOT] == oldroot) in dbAllocDmap() 1975 if ((rc = dbAdjCtl(bmp, blkno, dp->tree.stree[ROOT], 1, 0))) in dbAllocDmap() [all …]
|