/fs/btrfs/ |
D | dir-item.c | 44 struct extent_buffer *leaf; in insert_with_overflow() local 56 leaf = path->nodes[0]; in insert_with_overflow() 57 item = btrfs_item_nr(leaf, path->slots[0]); in insert_with_overflow() 58 ptr = btrfs_item_ptr(leaf, path->slots[0], char); in insert_with_overflow() 59 BUG_ON(data_size > btrfs_item_size(leaf, item)); in insert_with_overflow() 60 ptr += btrfs_item_size(leaf, item) - data_size; in insert_with_overflow() 79 struct extent_buffer *leaf; in btrfs_insert_xattr_item() local 95 leaf = path->nodes[0]; in btrfs_insert_xattr_item() 97 btrfs_set_dir_item_key(leaf, dir_item, &disk_key); in btrfs_insert_xattr_item() 98 btrfs_set_dir_type(leaf, dir_item, BTRFS_FT_XATTR); in btrfs_insert_xattr_item() [all …]
|
D | root-tree.c | 144 struct extent_buffer *leaf; in btrfs_find_dead_roots() local 159 leaf = path->nodes[0]; in btrfs_find_dead_roots() 160 nritems = btrfs_header_nritems(leaf); in btrfs_find_dead_roots() 166 leaf = path->nodes[0]; in btrfs_find_dead_roots() 167 nritems = btrfs_header_nritems(leaf); in btrfs_find_dead_roots() 170 btrfs_item_key_to_cpu(leaf, &key, slot); in btrfs_find_dead_roots() 180 ri = btrfs_item_ptr(leaf, slot, struct btrfs_root_item); in btrfs_find_dead_roots() 181 if (btrfs_disk_root_refs(leaf, ri) != 0) in btrfs_find_dead_roots() 211 struct extent_buffer *leaf; in btrfs_find_orphan_roots() local 237 leaf = path->nodes[0]; in btrfs_find_orphan_roots() [all …]
|
D | file-item.c | 50 struct extent_buffer *leaf; in btrfs_insert_file_extent() local 65 leaf = path->nodes[0]; in btrfs_insert_file_extent() 66 item = btrfs_item_ptr(leaf, path->slots[0], in btrfs_insert_file_extent() 68 btrfs_set_file_extent_disk_bytenr(leaf, item, disk_offset); in btrfs_insert_file_extent() 69 btrfs_set_file_extent_disk_num_bytes(leaf, item, disk_num_bytes); in btrfs_insert_file_extent() 70 btrfs_set_file_extent_offset(leaf, item, offset); in btrfs_insert_file_extent() 71 btrfs_set_file_extent_num_bytes(leaf, item, num_bytes); in btrfs_insert_file_extent() 72 btrfs_set_file_extent_ram_bytes(leaf, item, ram_bytes); in btrfs_insert_file_extent() 73 btrfs_set_file_extent_generation(leaf, item, trans->transid); in btrfs_insert_file_extent() 74 btrfs_set_file_extent_type(leaf, item, BTRFS_FILE_EXTENT_REG); in btrfs_insert_file_extent() [all …]
|
D | ctree.c | 774 struct extent_buffer *leaf) in leaf_data_end() argument 776 u32 nr = btrfs_header_nritems(leaf); in leaf_data_end() 779 return btrfs_item_offset_nr(leaf, nr - 1); in leaf_data_end() 2328 struct extent_buffer *leaf) in btrfs_leaf_free_space() argument 2330 int nritems = btrfs_header_nritems(leaf); in btrfs_leaf_free_space() 2332 ret = BTRFS_LEAF_DATA_SIZE(root) - leaf_space_used(leaf, 0, nritems); in btrfs_leaf_free_space() 2337 leaf_space_used(leaf, 0, nritems), nritems); in btrfs_leaf_free_space() 3076 struct extent_buffer *leaf; in setup_leaf_for_split() local 3082 leaf = path->nodes[0]; in setup_leaf_for_split() 3083 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in setup_leaf_for_split() [all …]
|
D | file.c | 554 struct extent_buffer *leaf; in btrfs_drop_extents() local 589 leaf = path->nodes[0]; in btrfs_drop_extents() 590 btrfs_item_key_to_cpu(leaf, &key, path->slots[0] - 1); in btrfs_drop_extents() 597 leaf = path->nodes[0]; in btrfs_drop_extents() 598 if (path->slots[0] >= btrfs_header_nritems(leaf)) { in btrfs_drop_extents() 607 leaf = path->nodes[0]; in btrfs_drop_extents() 611 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_drop_extents() 616 fi = btrfs_item_ptr(leaf, path->slots[0], in btrfs_drop_extents() 618 extent_type = btrfs_file_extent_type(leaf, fi); in btrfs_drop_extents() 622 disk_bytenr = btrfs_file_extent_disk_bytenr(leaf, fi); in btrfs_drop_extents() [all …]
|
D | inode-item.c | 27 struct extent_buffer *leaf; in find_name_in_backref() local 35 leaf = path->nodes[0]; in find_name_in_backref() 36 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in find_name_in_backref() 37 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]); in find_name_in_backref() 40 len = btrfs_inode_ref_name_len(leaf, ref); in find_name_in_backref() 45 if (memcmp_extent_buffer(leaf, name, name_ptr, name_len) == 0) { in find_name_in_backref() 88 struct extent_buffer *leaf; in btrfs_del_inode_ref() local 117 leaf = path->nodes[0]; in btrfs_del_inode_ref() 118 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in btrfs_del_inode_ref() 121 *index = btrfs_inode_ref_index(leaf, ref); in btrfs_del_inode_ref() [all …]
|
D | xattr.c | 38 struct extent_buffer *leaf; in __btrfs_getxattr() local 57 leaf = path->nodes[0]; in __btrfs_getxattr() 60 ret = btrfs_dir_data_len(leaf, di); in __btrfs_getxattr() 65 if (btrfs_dir_data_len(leaf, di) > size) { in __btrfs_getxattr() 78 btrfs_dir_name_len(leaf, di)); in __btrfs_getxattr() 79 read_extent_buffer(leaf, buffer, data_ptr, in __btrfs_getxattr() 80 btrfs_dir_data_len(leaf, di)); in __btrfs_getxattr() 81 ret = btrfs_dir_data_len(leaf, di); in __btrfs_getxattr() 213 struct extent_buffer *leaf; in btrfs_listxattr() local 240 leaf = path->nodes[0]; in btrfs_listxattr() [all …]
|
D | extent-tree.c | 82 struct extent_buffer *leaf, 348 struct extent_buffer *leaf; in caching_thread() local 388 leaf = path->nodes[0]; in caching_thread() 389 nritems = btrfs_header_nritems(leaf); in caching_thread() 398 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in caching_thread() 413 leaf = path->nodes[0]; in caching_thread() 414 nritems = btrfs_header_nritems(leaf); in caching_thread() 753 struct extent_buffer *leaf; in btrfs_lookup_extent_info() local 778 leaf = path->nodes[0]; in btrfs_lookup_extent_info() 779 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in btrfs_lookup_extent_info() [all …]
|
D | volumes.c | 1018 struct extent_buffer *leaf = NULL; in btrfs_free_dev_extent() local 1035 leaf = path->nodes[0]; in btrfs_free_dev_extent() 1036 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_free_dev_extent() 1037 extent = btrfs_item_ptr(leaf, path->slots[0], in btrfs_free_dev_extent() 1040 btrfs_dev_extent_length(leaf, extent) < start); in btrfs_free_dev_extent() 1045 leaf = path->nodes[0]; in btrfs_free_dev_extent() 1046 extent = btrfs_item_ptr(leaf, path->slots[0], in btrfs_free_dev_extent() 1054 u64 len = btrfs_dev_extent_length(leaf, extent); in btrfs_free_dev_extent() 1079 struct extent_buffer *leaf; in btrfs_alloc_dev_extent() local 1095 leaf = path->nodes[0]; in btrfs_alloc_dev_extent() [all …]
|
D | inode.c | 125 struct extent_buffer *leaf; in insert_inline_extent() local 157 leaf = path->nodes[0]; in insert_inline_extent() 158 ei = btrfs_item_ptr(leaf, path->slots[0], in insert_inline_extent() 160 btrfs_set_file_extent_generation(leaf, ei, trans->transid); in insert_inline_extent() 161 btrfs_set_file_extent_type(leaf, ei, BTRFS_FILE_EXTENT_INLINE); in insert_inline_extent() 162 btrfs_set_file_extent_encryption(leaf, ei, 0); in insert_inline_extent() 163 btrfs_set_file_extent_other_encoding(leaf, ei, 0); in insert_inline_extent() 164 btrfs_set_file_extent_ram_bytes(leaf, ei, size); in insert_inline_extent() 176 write_extent_buffer(leaf, kaddr, ptr, cur_size); in insert_inline_extent() 183 btrfs_set_file_extent_compression(leaf, ei, in insert_inline_extent() [all …]
|
D | export.c | 171 struct extent_buffer *leaf; in btrfs_get_parent() local 203 leaf = path->nodes[0]; in btrfs_get_parent() 205 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_get_parent() 212 ref = btrfs_item_ptr(leaf, path->slots[0], in btrfs_get_parent() 214 key.objectid = btrfs_root_ref_dirid(leaf, ref); in btrfs_get_parent() 242 struct extent_buffer *leaf; in btrfs_get_name() local 285 leaf = path->nodes[0]; in btrfs_get_name() 288 rref = btrfs_item_ptr(leaf, path->slots[0], in btrfs_get_name() 291 name_len = btrfs_root_ref_name_len(leaf, rref); in btrfs_get_name() 293 iref = btrfs_item_ptr(leaf, path->slots[0], in btrfs_get_name() [all …]
|
D | backref.c | 402 struct extent_buffer *leaf; in __add_inline_refs() local 413 leaf = path->nodes[0]; in __add_inline_refs() 416 item_size = btrfs_item_size_nr(leaf, slot); in __add_inline_refs() 419 ei = btrfs_item_ptr(leaf, slot, struct btrfs_extent_item); in __add_inline_refs() 420 flags = btrfs_extent_flags(leaf, ei); in __add_inline_refs() 430 *info_level = btrfs_tree_block_level(leaf, info); in __add_inline_refs() 431 btrfs_tree_block_key(leaf, info, &disk_key); in __add_inline_refs() 445 type = btrfs_extent_inline_ref_type(leaf, iref); in __add_inline_refs() 446 offset = btrfs_extent_inline_ref_offset(leaf, iref); in __add_inline_refs() 459 count = btrfs_shared_data_ref_count(leaf, sdref); in __add_inline_refs() [all …]
|
D | relocation.c | 598 struct extent_buffer *leaf, in find_tree_root() argument 602 u64 root_objectid = btrfs_ref_root_v0(leaf, ref0); in find_tree_root() 603 u64 generation = btrfs_ref_generation_v0(leaf, ref0); in find_tree_root() 619 int find_inline_backref(struct extent_buffer *leaf, int slot, in find_inline_backref() argument 626 item_size = btrfs_item_size_nr(leaf, slot); in find_inline_backref() 633 ei = btrfs_item_ptr(leaf, slot, struct btrfs_extent_item); in find_inline_backref() 634 WARN_ON(!(btrfs_extent_flags(leaf, ei) & in find_inline_backref() 1501 struct extent_buffer *leaf; local 1518 leaf = path->nodes[0]; 1519 fi = btrfs_item_ptr(leaf, path->slots[0], [all …]
|
D | ioctl.c | 343 struct extent_buffer *leaf; in create_subvol() local 369 leaf = btrfs_alloc_free_block(trans, root, root->leafsize, in create_subvol() 371 if (IS_ERR(leaf)) { in create_subvol() 372 ret = PTR_ERR(leaf); in create_subvol() 376 memset_extent_buffer(leaf, 0, 0, sizeof(struct btrfs_header)); in create_subvol() 377 btrfs_set_header_bytenr(leaf, leaf->start); in create_subvol() 378 btrfs_set_header_generation(leaf, trans->transid); in create_subvol() 379 btrfs_set_header_backref_rev(leaf, BTRFS_MIXED_BACKREF_REV); in create_subvol() 380 btrfs_set_header_owner(leaf, objectid); in create_subvol() 382 write_extent_buffer(leaf, root->fs_info->fsid, in create_subvol() [all …]
|
D | free-space-cache.c | 45 struct extent_buffer *leaf; in __lookup_free_space_inode() local 61 leaf = path->nodes[0]; in __lookup_free_space_inode() 62 header = btrfs_item_ptr(leaf, path->slots[0], in __lookup_free_space_inode() 64 btrfs_free_space_key(leaf, header, &disk_key); in __lookup_free_space_inode() 127 struct extent_buffer *leaf; in __create_free_space_inode() local 139 leaf = path->nodes[0]; in __create_free_space_inode() 140 inode_item = btrfs_item_ptr(leaf, path->slots[0], in __create_free_space_inode() 142 btrfs_item_key(leaf, &disk_key, path->slots[0]); in __create_free_space_inode() 143 memset_extent_buffer(leaf, 0, (unsigned long)inode_item, in __create_free_space_inode() 145 btrfs_set_inode_generation(leaf, inode_item, trans->transid); in __create_free_space_inode() [all …]
|
D | delayed-inode.c | 766 struct extent_buffer *leaf; in btrfs_batch_insert_items() local 778 leaf = path->nodes[0]; in btrfs_batch_insert_items() 779 free_space = btrfs_leaf_free_space(root, leaf); in btrfs_batch_insert_items() 846 data_ptr = btrfs_item_ptr(leaf, slot, char); in btrfs_batch_insert_items() 847 write_extent_buffer(leaf, &curr->data, in btrfs_batch_insert_items() 874 struct extent_buffer *leaf; in btrfs_insert_delayed_item() local 884 leaf = path->nodes[0]; in btrfs_insert_delayed_item() 886 item = btrfs_item_nr(leaf, path->slots[0]); in btrfs_insert_delayed_item() 887 ptr = btrfs_item_ptr(leaf, path->slots[0], char); in btrfs_insert_delayed_item() 889 write_extent_buffer(leaf, delayed_item->data, (unsigned long)ptr, in btrfs_insert_delayed_item() [all …]
|
D | inode-map.c | 36 struct extent_buffer *leaf; in caching_kthread() local 68 leaf = path->nodes[0]; in caching_kthread() 70 if (slot >= btrfs_header_nritems(leaf)) { in caching_kthread() 79 leaf = path->nodes[0]; in caching_kthread() 81 if (btrfs_header_nritems(leaf) == 0) { in caching_kthread() 90 btrfs_item_key_to_cpu(leaf, &key, 0); in caching_kthread() 100 btrfs_item_key_to_cpu(leaf, &key, slot); in caching_kthread()
|
D | disk-io.c | 475 struct extent_buffer *leaf) in check_leaf() argument 479 u32 nritems = btrfs_header_nritems(leaf); in check_leaf() 486 if (btrfs_item_offset_nr(leaf, 0) + btrfs_item_size_nr(leaf, 0) != in check_leaf() 488 CORRUPT("invalid item offset size pair", leaf, root, 0); in check_leaf() 500 btrfs_item_key_to_cpu(leaf, &leaf_key, slot); in check_leaf() 501 btrfs_item_key_to_cpu(leaf, &key, slot + 1); in check_leaf() 505 CORRUPT("bad key order", leaf, root, slot); in check_leaf() 514 if (btrfs_item_offset_nr(leaf, slot) != in check_leaf() 515 btrfs_item_end_nr(leaf, slot + 1)) { in check_leaf() 516 CORRUPT("slot offset bad", leaf, root, slot); in check_leaf() [all …]
|
/fs/xfs/ |
D | xfs_dir2_leaf.c | 70 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_block_to_leaf() local 99 leaf = lbp->data; in xfs_dir2_block_to_leaf() 107 leaf->hdr.count = cpu_to_be16(be32_to_cpu(btp->count)); in xfs_dir2_block_to_leaf() 108 leaf->hdr.stale = cpu_to_be16(be32_to_cpu(btp->stale)); in xfs_dir2_block_to_leaf() 113 memcpy(leaf->ents, blp, be32_to_cpu(btp->count) * sizeof(xfs_dir2_leaf_entry_t)); in xfs_dir2_block_to_leaf() 114 xfs_dir2_leaf_log_ents(tp, lbp, 0, be16_to_cpu(leaf->hdr.count) - 1); in xfs_dir2_block_to_leaf() 135 ltp = xfs_dir2_leaf_tail_p(mp, leaf); in xfs_dir2_block_to_leaf() 153 struct xfs_dir2_leaf *leaf, in xfs_dir2_leaf_find_stale() argument 162 if (leaf->ents[*lowstale].address == in xfs_dir2_leaf_find_stale() 173 *highstale < be16_to_cpu(leaf->hdr.count); in xfs_dir2_leaf_find_stale() [all …]
|
D | xfs_attr_leaf.c | 89 STATIC int xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index); 743 xfs_attr_leafblock_t *leaf; in xfs_attr_shortform_allfit() local 748 leaf = bp->data; in xfs_attr_shortform_allfit() 749 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); in xfs_attr_shortform_allfit() 751 entry = &leaf->entries[0]; in xfs_attr_shortform_allfit() 753 for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) { in xfs_attr_shortform_allfit() 758 name_loc = xfs_attr_leaf_name_local(leaf, i); in xfs_attr_shortform_allfit() 780 xfs_attr_leafblock_t *leaf; in xfs_attr_leaf_to_shortform() local 796 leaf = (xfs_attr_leafblock_t *)tmpbuffer; in xfs_attr_leaf_to_shortform() 797 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); in xfs_attr_leaf_to_shortform() [all …]
|
D | xfs_dir2_node.c | 112 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leaf_to_node() local 141 leaf = lbp->data; in xfs_dir2_leaf_to_node() 142 ltp = xfs_dir2_leaf_tail_p(mp, leaf); in xfs_dir2_leaf_to_node() 161 leaf->hdr.info.magic = cpu_to_be16(XFS_DIR2_LEAFN_MAGIC); in xfs_dir2_leaf_to_node() 186 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leafn_add() local 199 leaf = bp->data; in xfs_dir2_leafn_add() 215 if (be16_to_cpu(leaf->hdr.count) == xfs_dir2_max_leaf_ents(mp)) { in xfs_dir2_leafn_add() 216 if (!leaf->hdr.stale) in xfs_dir2_leafn_add() 218 compact = be16_to_cpu(leaf->hdr.stale) > 1; in xfs_dir2_leafn_add() 221 ASSERT(index == 0 || be32_to_cpu(leaf->ents[index - 1].hashval) <= args->hashval); in xfs_dir2_leafn_add() [all …]
|
D | xfs_dir2_block.c | 885 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leaf_to_block() local 902 leaf = lbp->data; in xfs_dir2_leaf_to_block() 903 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC)); in xfs_dir2_leaf_to_block() 904 ltp = xfs_dir2_leaf_tail_p(mp, leaf); in xfs_dir2_leaf_to_block() 938 (uint)sizeof(*lep) * (be16_to_cpu(leaf->hdr.count) - be16_to_cpu(leaf->hdr.stale)); in xfs_dir2_leaf_to_block() 967 btp->count = cpu_to_be32(be16_to_cpu(leaf->hdr.count) - be16_to_cpu(leaf->hdr.stale)); in xfs_dir2_leaf_to_block() 974 for (from = to = 0; from < be16_to_cpu(leaf->hdr.count); from++) { in xfs_dir2_leaf_to_block() 975 if (leaf->ents[from].address == in xfs_dir2_leaf_to_block() 978 lep[to++] = leaf->ents[from]; in xfs_dir2_leaf_to_block()
|
D | xfs_attr.c | 1189 xfs_attr_leafblock_t *leaf; in xfs_attr_leaf_list() local 1198 leaf = bp->data; in xfs_attr_leaf_list() 1199 if (unlikely(leaf->hdr.info.magic != cpu_to_be16(XFS_ATTR_LEAF_MAGIC))) { in xfs_attr_leaf_list() 1201 context->dp->i_mount, leaf); in xfs_attr_leaf_list() 1809 xfs_attr_leafblock_t *leaf; in xfs_attr_node_list() local 1838 leaf = bp->data; in xfs_attr_node_list() 1839 if (cursor->hashval > be32_to_cpu(leaf->entries[ in xfs_attr_node_list() 1840 be16_to_cpu(leaf->hdr.count)-1].hashval)) { in xfs_attr_node_list() 1845 be32_to_cpu(leaf->entries[0].hashval)) { in xfs_attr_node_list() 1917 leaf = bp->data; in xfs_attr_node_list() [all …]
|
/fs/gfs2/ |
D | dir.c | 771 struct gfs2_leaf *leaf; in gfs2_dirent_search() local 789 leaf = (struct gfs2_leaf *)bh->b_data; in gfs2_dirent_search() 790 ln = be64_to_cpu(leaf->lf_next); in gfs2_dirent_search() 822 struct gfs2_leaf *leaf; in new_leaf() local 836 leaf = (struct gfs2_leaf *)bh->b_data; in new_leaf() 837 leaf->lf_depth = cpu_to_be16(depth); in new_leaf() 838 leaf->lf_entries = 0; in new_leaf() 839 leaf->lf_dirent_format = cpu_to_be32(GFS2_FORMAT_DE); in new_leaf() 840 leaf->lf_next = 0; in new_leaf() 841 memset(leaf->lf_reserved, 0, sizeof(leaf->lf_reserved)); in new_leaf() [all …]
|
/fs/jfs/ |
D | jfs_dmap.c | 1127 s8 *leaf; in dbAllocNext() local 1138 leaf = dp->tree.stree + le32_to_cpu(dp->tree.leafidx); in dbAllocNext() 1155 if (leaf[word] == NOFREE) in dbAllocNext() 1202 if (leaf[word] < BUDMIN) in dbAllocNext() 1209 min((int)leaf[word], NLSTOL2BSZ(nwords)); in dbAllocNext() 1259 s8 *leaf; in dbAllocNear() local 1267 leaf = dp->tree.stree + le32_to_cpu(dp->tree.leafidx); in dbAllocNear() 1281 if (leaf[word] < l2nb) in dbAllocNear() 1294 if (leaf[word] < BUDMIN) in dbAllocNear() 2077 s8 *leaf; in dbAllocBits() local [all …]
|