Home
last modified time | relevance | path

Searched refs:leaf (Results 1 – 25 of 62) sorted by relevance

123

/fs/btrfs/
Dtree-checker.c100 #define CHECK_FE_ALIGNED(leaf, slot, fi, name, alignment) \ argument
102 if (!IS_ALIGNED(btrfs_file_extent_##name((leaf), (fi)), (alignment))) \
103 file_extent_err((leaf), (slot), \
105 (#name), btrfs_file_extent_##name((leaf), (fi)), \
107 (!IS_ALIGNED(btrfs_file_extent_##name((leaf), (fi)), (alignment))); \
110 static u64 file_extent_end(struct extent_buffer *leaf, in file_extent_end() argument
117 if (btrfs_file_extent_type(leaf, extent) == BTRFS_FILE_EXTENT_INLINE) { in file_extent_end()
118 len = btrfs_file_extent_ram_bytes(leaf, extent); in file_extent_end()
119 end = ALIGN(key->offset + len, leaf->fs_info->sectorsize); in file_extent_end()
121 len = btrfs_file_extent_num_bytes(leaf, extent); in file_extent_end()
[all …]
Ddir-item.c31 struct extent_buffer *leaf; in insert_with_overflow() local
43 leaf = path->nodes[0]; in insert_with_overflow()
45 ptr = btrfs_item_ptr(leaf, path->slots[0], char); in insert_with_overflow()
46 BUG_ON(data_size > btrfs_item_size(leaf, item)); in insert_with_overflow()
47 ptr += btrfs_item_size(leaf, item) - data_size; in insert_with_overflow()
66 struct extent_buffer *leaf; in btrfs_insert_xattr_item() local
83 leaf = path->nodes[0]; in btrfs_insert_xattr_item()
85 btrfs_set_dir_item_key(leaf, dir_item, &disk_key); in btrfs_insert_xattr_item()
86 btrfs_set_dir_type(leaf, dir_item, BTRFS_FT_XATTR); in btrfs_insert_xattr_item()
87 btrfs_set_dir_name_len(leaf, dir_item, name_len); in btrfs_insert_xattr_item()
[all …]
Dfile-item.c45 struct extent_buffer *leaf; in btrfs_insert_file_extent() local
60 leaf = path->nodes[0]; in btrfs_insert_file_extent()
61 item = btrfs_item_ptr(leaf, path->slots[0], in btrfs_insert_file_extent()
63 btrfs_set_file_extent_disk_bytenr(leaf, item, disk_offset); in btrfs_insert_file_extent()
64 btrfs_set_file_extent_disk_num_bytes(leaf, item, disk_num_bytes); in btrfs_insert_file_extent()
65 btrfs_set_file_extent_offset(leaf, item, offset); in btrfs_insert_file_extent()
66 btrfs_set_file_extent_num_bytes(leaf, item, num_bytes); in btrfs_insert_file_extent()
67 btrfs_set_file_extent_ram_bytes(leaf, item, ram_bytes); in btrfs_insert_file_extent()
68 btrfs_set_file_extent_generation(leaf, item, trans->transid); in btrfs_insert_file_extent()
69 btrfs_set_file_extent_type(leaf, item, BTRFS_FILE_EXTENT_REG); in btrfs_insert_file_extent()
[all …]
Dinode-item.c11 struct btrfs_inode_ref *btrfs_find_name_in_backref(struct extent_buffer *leaf, in btrfs_find_name_in_backref() argument
22 item_size = btrfs_item_size_nr(leaf, slot); in btrfs_find_name_in_backref()
23 ptr = btrfs_item_ptr_offset(leaf, slot); in btrfs_find_name_in_backref()
26 len = btrfs_inode_ref_name_len(leaf, ref); in btrfs_find_name_in_backref()
31 if (memcmp_extent_buffer(leaf, name, name_ptr, name_len) == 0) in btrfs_find_name_in_backref()
38 struct extent_buffer *leaf, int slot, u64 ref_objectid, in btrfs_find_name_in_ext_backref() argument
48 item_size = btrfs_item_size_nr(leaf, slot); in btrfs_find_name_in_ext_backref()
49 ptr = btrfs_item_ptr_offset(leaf, slot); in btrfs_find_name_in_ext_backref()
60 ref_name_len = btrfs_inode_extref_name_len(leaf, extref); in btrfs_find_name_in_ext_backref()
63 btrfs_inode_extref_parent(leaf, extref) == ref_objectid && in btrfs_find_name_in_ext_backref()
[all …]
Dxattr.c29 struct extent_buffer *leaf; in btrfs_getxattr() local
48 leaf = path->nodes[0]; in btrfs_getxattr()
51 ret = btrfs_dir_data_len(leaf, di); in btrfs_getxattr()
56 if (btrfs_dir_data_len(leaf, di) > size) { in btrfs_getxattr()
69 btrfs_dir_name_len(leaf, di)); in btrfs_getxattr()
70 read_extent_buffer(leaf, buffer, data_ptr, in btrfs_getxattr()
71 btrfs_dir_data_len(leaf, di)); in btrfs_getxattr()
72 ret = btrfs_dir_data_len(leaf, di); in btrfs_getxattr()
169 struct extent_buffer *leaf = path->nodes[0]; in btrfs_setxattr() local
170 const u16 old_data_len = btrfs_dir_data_len(leaf, di); in btrfs_setxattr()
[all …]
Dfile.c756 struct extent_buffer *leaf; in __btrfs_drop_extents() local
793 leaf = path->nodes[0]; in __btrfs_drop_extents()
794 btrfs_item_key_to_cpu(leaf, &key, path->slots[0] - 1); in __btrfs_drop_extents()
802 leaf = path->nodes[0]; in __btrfs_drop_extents()
803 if (path->slots[0] >= btrfs_header_nritems(leaf)) { in __btrfs_drop_extents()
813 leaf = path->nodes[0]; in __btrfs_drop_extents()
817 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in __btrfs_drop_extents()
830 fi = btrfs_item_ptr(leaf, path->slots[0], in __btrfs_drop_extents()
832 extent_type = btrfs_file_extent_type(leaf, fi); in __btrfs_drop_extents()
836 disk_bytenr = btrfs_file_extent_disk_bytenr(leaf, fi); in __btrfs_drop_extents()
[all …]
Dextent-tree.c46 struct extent_buffer *leaf,
159 struct extent_buffer *leaf; in btrfs_lookup_extent_info() local
209 leaf = path->nodes[0]; in btrfs_lookup_extent_info()
210 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in btrfs_lookup_extent_info()
212 ei = btrfs_item_ptr(leaf, path->slots[0], in btrfs_lookup_extent_info()
214 num_refs = btrfs_extent_refs(leaf, ei); in btrfs_lookup_extent_info()
215 extent_flags = btrfs_extent_flags(leaf, ei); in btrfs_lookup_extent_info()
457 static u64 hash_extent_data_ref_item(struct extent_buffer *leaf, in hash_extent_data_ref_item() argument
460 return hash_extent_data_ref(btrfs_extent_data_ref_root(leaf, ref), in hash_extent_data_ref_item()
461 btrfs_extent_data_ref_objectid(leaf, ref), in hash_extent_data_ref_item()
[all …]
Dctree.c3143 struct extent_buffer *leaf; in btrfs_search_slot_for_read() local
3156 leaf = p->nodes[0]; in btrfs_search_slot_for_read()
3159 if (p->slots[0] >= btrfs_header_nritems(leaf)) { in btrfs_search_slot_for_read()
3180 leaf = p->nodes[0]; in btrfs_search_slot_for_read()
3181 if (p->slots[0] == btrfs_header_nritems(leaf)) in btrfs_search_slot_for_read()
3656 noinline int btrfs_leaf_free_space(struct extent_buffer *leaf) in btrfs_leaf_free_space() argument
3658 struct btrfs_fs_info *fs_info = leaf->fs_info; in btrfs_leaf_free_space()
3659 int nritems = btrfs_header_nritems(leaf); in btrfs_leaf_free_space()
3662 ret = BTRFS_LEAF_DATA_SIZE(fs_info) - leaf_space_used(leaf, 0, nritems); in btrfs_leaf_free_space()
3668 leaf_space_used(leaf, 0, nritems), nritems); in btrfs_leaf_free_space()
[all …]
Droot-tree.c212 struct extent_buffer *leaf; in btrfs_find_orphan_roots() local
238 leaf = path->nodes[0]; in btrfs_find_orphan_roots()
239 if (path->slots[0] >= btrfs_header_nritems(leaf)) { in btrfs_find_orphan_roots()
245 leaf = path->nodes[0]; in btrfs_find_orphan_roots()
248 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_find_orphan_roots()
359 struct extent_buffer *leaf; in btrfs_del_root_ref() local
378 leaf = path->nodes[0]; in btrfs_del_root_ref()
379 ref = btrfs_item_ptr(leaf, path->slots[0], in btrfs_del_root_ref()
382 if ((btrfs_root_ref_dirid(leaf, ref) != dirid) || in btrfs_del_root_ref()
383 (btrfs_root_ref_name_len(leaf, ref) != name_len) || in btrfs_del_root_ref()
[all …]
Dfree-space-tree.c54 struct extent_buffer *leaf; in add_new_free_space_info() local
65 leaf = path->nodes[0]; in add_new_free_space_info()
66 info = btrfs_item_ptr(leaf, path->slots[0], in add_new_free_space_info()
68 btrfs_set_free_space_extent_count(leaf, info, 0); in add_new_free_space_info()
69 btrfs_set_free_space_flags(leaf, info, 0); in add_new_free_space_info()
70 btrfs_mark_buffer_dirty(leaf); in add_new_free_space_info()
190 struct extent_buffer *leaf; in convert_free_space_to_bitmaps() local
220 leaf = path->nodes[0]; in convert_free_space_to_bitmaps()
224 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0] - 1); in convert_free_space_to_bitmaps()
263 leaf = path->nodes[0]; in convert_free_space_to_bitmaps()
[all …]
Dinode.c174 struct extent_buffer *leaf; in insert_inline_extent() local
206 leaf = path->nodes[0]; in insert_inline_extent()
207 ei = btrfs_item_ptr(leaf, path->slots[0], in insert_inline_extent()
209 btrfs_set_file_extent_generation(leaf, ei, trans->transid); in insert_inline_extent()
210 btrfs_set_file_extent_type(leaf, ei, BTRFS_FILE_EXTENT_INLINE); in insert_inline_extent()
211 btrfs_set_file_extent_encryption(leaf, ei, 0); in insert_inline_extent()
212 btrfs_set_file_extent_other_encoding(leaf, ei, 0); in insert_inline_extent()
213 btrfs_set_file_extent_ram_bytes(leaf, ei, size); in insert_inline_extent()
225 write_extent_buffer(leaf, kaddr, ptr, cur_size); in insert_inline_extent()
232 btrfs_set_file_extent_compression(leaf, ei, in insert_inline_extent()
[all …]
Dexport.c161 struct extent_buffer *leaf; in btrfs_get_parent() local
200 leaf = path->nodes[0]; in btrfs_get_parent()
202 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_get_parent()
209 ref = btrfs_item_ptr(leaf, path->slots[0], in btrfs_get_parent()
211 key.objectid = btrfs_root_ref_dirid(leaf, ref); in btrfs_get_parent()
240 struct extent_buffer *leaf; in btrfs_get_name() local
280 leaf = path->nodes[0]; in btrfs_get_name()
283 rref = btrfs_item_ptr(leaf, path->slots[0], in btrfs_get_name()
286 name_len = btrfs_root_ref_name_len(leaf, rref); in btrfs_get_name()
288 iref = btrfs_item_ptr(leaf, path->slots[0], in btrfs_get_name()
[all …]
Dtree-log.c644 struct extent_buffer *leaf; in replay_one_extent() local
646 leaf = path->nodes[0]; in replay_one_extent()
647 existing = btrfs_item_ptr(leaf, path->slots[0], in replay_one_extent()
652 read_extent_buffer(leaf, &cmp2, (unsigned long)existing, in replay_one_extent()
865 struct extent_buffer *leaf; in drop_one_dir_item() local
869 leaf = path->nodes[0]; in drop_one_dir_item()
871 btrfs_dir_item_key_to_cpu(leaf, di, &location); in drop_one_dir_item()
872 name_len = btrfs_dir_name_len(leaf, di); in drop_one_dir_item()
877 read_extent_buffer(leaf, name, (unsigned long)(di + 1), name_len); in drop_one_dir_item()
1025 struct extent_buffer *leaf; in __add_inode_ref() local
[all …]
Dvolumes.c1855 struct extent_buffer *leaf = NULL; in btrfs_free_dev_extent() local
1872 leaf = path->nodes[0]; in btrfs_free_dev_extent()
1873 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_free_dev_extent()
1874 extent = btrfs_item_ptr(leaf, path->slots[0], in btrfs_free_dev_extent()
1877 btrfs_dev_extent_length(leaf, extent) < start); in btrfs_free_dev_extent()
1882 leaf = path->nodes[0]; in btrfs_free_dev_extent()
1883 extent = btrfs_item_ptr(leaf, path->slots[0], in btrfs_free_dev_extent()
1890 *dev_extent_len = btrfs_dev_extent_length(leaf, extent); in btrfs_free_dev_extent()
1913 struct extent_buffer *leaf; in btrfs_alloc_dev_extent() local
1930 leaf = path->nodes[0]; in btrfs_alloc_dev_extent()
[all …]
Dprops.c132 struct extent_buffer *leaf; in iterate_object_props() local
138 leaf = path->nodes[0]; in iterate_object_props()
140 if (slot >= btrfs_header_nritems(leaf)) { in iterate_object_props()
149 btrfs_item_key_to_cpu(leaf, &key, slot); in iterate_object_props()
159 di = btrfs_item_ptr(leaf, slot, struct btrfs_dir_item); in iterate_object_props()
161 total_len = btrfs_item_size_nr(leaf, slot); in iterate_object_props()
164 u32 name_len = btrfs_dir_name_len(leaf, di); in iterate_object_props()
165 u32 data_len = btrfs_dir_data_len(leaf, di); in iterate_object_props()
174 memcmp_extent_buffer(leaf, XATTR_BTRFS_PREFIX, in iterate_object_props()
188 read_extent_buffer(leaf, name_buf, name_ptr, name_len); in iterate_object_props()
[all …]
Dref-verify.c384 struct extent_buffer *leaf, in add_extent_data_ref() argument
391 u64 ref_root = btrfs_extent_data_ref_root(leaf, dref); in add_extent_data_ref()
392 u64 owner = btrfs_extent_data_ref_objectid(leaf, dref); in add_extent_data_ref()
393 u64 offset = btrfs_extent_data_ref_offset(leaf, dref); in add_extent_data_ref()
394 u32 num_refs = btrfs_extent_data_ref_count(leaf, dref); in add_extent_data_ref()
437 struct extent_buffer *leaf = path->nodes[0]; in process_extent_item() local
438 u32 item_size = btrfs_item_size_nr(leaf, slot); in process_extent_item()
443 ei = btrfs_item_ptr(leaf, slot, struct btrfs_extent_item); in process_extent_item()
444 flags = btrfs_extent_flags(leaf, ei); in process_extent_item()
451 *tree_block_level = btrfs_tree_block_level(leaf, info); in process_extent_item()
[all …]
/fs/xfs/libxfs/
Dxfs_iext_tree.c142 return &cur->leaf->recs[cur->pos]; in cur_rec()
148 if (!cur->leaf) in xfs_iext_valid()
202 cur->leaf = xfs_iext_find_first_leaf(ifp); in xfs_iext_first()
212 cur->leaf = xfs_iext_find_last_leaf(ifp); in xfs_iext_last()
213 if (!cur->leaf) { in xfs_iext_last()
219 if (xfs_iext_rec_is_empty(&cur->leaf->recs[i])) in xfs_iext_last()
230 if (!cur->leaf) { in xfs_iext_next()
241 cur->leaf->next) { in xfs_iext_next()
242 cur->leaf = cur->leaf->next; in xfs_iext_next()
252 if (!cur->leaf) { in xfs_iext_prev()
[all …]
Dxfs_dir2_leaf.c43 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf1_check() local
46 dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); in xfs_dir3_leaf1_check()
55 return xfs_dir3_leaf_check_int(dp->i_mount, dp, &leafhdr, leaf); in xfs_dir3_leaf1_check()
82 struct xfs_dir2_leaf *leaf) in xfs_dir3_leaf_check_int() argument
99 ops->leaf_hdr_from_disk(&leafhdr, leaf); in xfs_dir3_leaf_check_int()
103 ents = ops->leaf_ents_p(leaf); in xfs_dir3_leaf_check_int()
104 ltp = xfs_dir2_leaf_tail_p(geo, leaf); in xfs_dir3_leaf_check_int()
145 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf_verify() local
152 return xfs_dir3_leaf_check_int(mp, NULL, NULL, leaf); in xfs_dir3_leaf_verify()
259 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf_init() local
[all …]
Dxfs_attr_leaf.c73 STATIC int xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index);
241 struct xfs_attr_leafblock *leaf = bp->b_addr; in xfs_attr3_leaf_verify() local
247 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf); in xfs_attr3_leaf_verify()
259 if (ichdr.firstused < xfs_attr3_leaf_hdr_size(leaf)) in xfs_attr3_leaf_verify()
881 struct xfs_attr_leafblock *leaf; in xfs_attr_shortform_allfit() local
889 leaf = bp->b_addr; in xfs_attr_shortform_allfit()
890 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &leafhdr, leaf); in xfs_attr_shortform_allfit()
891 entry = xfs_attr3_leaf_entryp(leaf); in xfs_attr_shortform_allfit()
899 name_loc = xfs_attr3_leaf_name_local(leaf, i); in xfs_attr_shortform_allfit()
1000 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_to_shortform() local
[all …]
Dxfs_dir2_node.c45 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leafn_check() local
48 dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); in xfs_dir3_leafn_check()
57 return xfs_dir3_leaf_check_int(dp->i_mount, dp, &leafhdr, leaf); in xfs_dir3_leafn_check()
346 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leaf_to_node() local
374 leaf = lbp->b_addr; in xfs_dir2_leaf_to_node()
375 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_leaf_to_node()
410 if (leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC)) in xfs_dir2_leaf_to_node()
411 leaf->hdr.info.magic = cpu_to_be16(XFS_DIR2_LEAFN_MAGIC); in xfs_dir2_leaf_to_node()
413 leaf->hdr.info.magic = cpu_to_be16(XFS_DIR3_LEAFN_MAGIC); in xfs_dir2_leaf_to_node()
433 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir2_leafn_add() local
[all …]
/fs/unicode/
Dutf8-norm.c408 utf8leaf_t *leaf; in utf8agemax() local
417 leaf = utf8lookup(data, hangul, s); in utf8agemax()
418 if (!leaf) in utf8agemax()
421 leaf_age = utf8agetab[LEAF_GEN(leaf)]; in utf8agemax()
437 utf8leaf_t *leaf; in utf8agemin() local
446 leaf = utf8lookup(data, hangul, s); in utf8agemin()
447 if (!leaf) in utf8agemin()
449 leaf_age = utf8agetab[LEAF_GEN(leaf)]; in utf8agemin()
464 utf8leaf_t *leaf; in utf8nagemax() local
473 leaf = utf8nlookup(data, hangul, s, len); in utf8nagemax()
[all …]
Dmkutf8data.c383 void *leaf = NULL; in lookup() local
386 while (!leaf && node) { in lookup()
394 leaf = node->right; in lookup()
403 leaf = node->left; in lookup()
410 return leaf; in lookup()
533 static int insert(struct tree *tree, char *key, int keylen, void *leaf) in insert() argument
559 *cursor = leaf; in insert()
577 leaf = node->left; in insert()
582 tree->root = leaf; in insert()
585 parent->left = leaf; in insert()
[all …]
/fs/xfs/scrub/
Dattr.c246 struct xfs_attr_leafblock *leaf, in xchk_xattr_entry() argument
278 lentry = xfs_attr3_leaf_name_local(leaf, idx); in xchk_xattr_entry()
285 rentry = xfs_attr3_leaf_name_remote(leaf, idx); in xchk_xattr_entry()
311 struct xfs_attr_leafblock *leaf = bp->b_addr; in xchk_xattr_block() local
339 struct xfs_attr3_leafblock *leaf = bp->b_addr; in xchk_xattr_block() local
341 if (leaf->hdr.pad1 != 0 || leaf->hdr.pad2 != 0 || in xchk_xattr_block()
342 leaf->hdr.info.hdr.pad != 0) in xchk_xattr_block()
345 if (leaf->hdr.pad1 != 0 || leaf->hdr.info.pad != 0) in xchk_xattr_block()
350 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &leafhdr, leaf); in xchk_xattr_block()
351 hdrsize = xfs_attr3_leaf_hdr_size(leaf); in xchk_xattr_block()
[all …]
/fs/gfs2/
Ddir.c821 struct gfs2_leaf *leaf; in gfs2_dirent_search() local
839 leaf = (struct gfs2_leaf *)bh->b_data; in gfs2_dirent_search()
840 ln = be64_to_cpu(leaf->lf_next); in gfs2_dirent_search()
872 struct gfs2_leaf *leaf; in new_leaf() local
886 leaf = (struct gfs2_leaf *)bh->b_data; in new_leaf()
887 leaf->lf_depth = cpu_to_be16(depth); in new_leaf()
888 leaf->lf_entries = 0; in new_leaf()
889 leaf->lf_dirent_format = cpu_to_be32(GFS2_FORMAT_DE); in new_leaf()
890 leaf->lf_next = 0; in new_leaf()
891 leaf->lf_inode = cpu_to_be64(ip->i_no_addr); in new_leaf()
[all …]
/fs/btrfs/tests/
Dqgroup-tests.c22 struct extent_buffer *leaf; in insert_normal_tree_ref() local
47 leaf = path->nodes[0]; in insert_normal_tree_ref()
48 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_extent_item); in insert_normal_tree_ref()
49 btrfs_set_extent_refs(leaf, item, 1); in insert_normal_tree_ref()
50 btrfs_set_extent_generation(leaf, item, 1); in insert_normal_tree_ref()
51 btrfs_set_extent_flags(leaf, item, BTRFS_EXTENT_FLAG_TREE_BLOCK); in insert_normal_tree_ref()
53 btrfs_set_tree_block_level(leaf, block_info, 0); in insert_normal_tree_ref()
56 btrfs_set_extent_inline_ref_type(leaf, iref, in insert_normal_tree_ref()
58 btrfs_set_extent_inline_ref_offset(leaf, iref, parent); in insert_normal_tree_ref()
60 btrfs_set_extent_inline_ref_type(leaf, iref, BTRFS_TREE_BLOCK_REF_KEY); in insert_normal_tree_ref()
[all …]

123