Lines Matching full:leaf

169 	struct extent_buffer *leaf;  in btrfs_insert_hole_extent()  local
183 leaf = path->nodes[0]; in btrfs_insert_hole_extent()
184 item = btrfs_item_ptr(leaf, path->slots[0], in btrfs_insert_hole_extent()
186 btrfs_set_file_extent_disk_bytenr(leaf, item, 0); in btrfs_insert_hole_extent()
187 btrfs_set_file_extent_disk_num_bytes(leaf, item, 0); in btrfs_insert_hole_extent()
188 btrfs_set_file_extent_offset(leaf, item, 0); in btrfs_insert_hole_extent()
189 btrfs_set_file_extent_num_bytes(leaf, item, num_bytes); in btrfs_insert_hole_extent()
190 btrfs_set_file_extent_ram_bytes(leaf, item, num_bytes); in btrfs_insert_hole_extent()
191 btrfs_set_file_extent_generation(leaf, item, trans->transid); in btrfs_insert_hole_extent()
192 btrfs_set_file_extent_type(leaf, item, BTRFS_FILE_EXTENT_REG); in btrfs_insert_hole_extent()
193 btrfs_set_file_extent_compression(leaf, item, 0); in btrfs_insert_hole_extent()
194 btrfs_set_file_extent_encryption(leaf, item, 0); in btrfs_insert_hole_extent()
195 btrfs_set_file_extent_other_encoding(leaf, item, 0); in btrfs_insert_hole_extent()
197 btrfs_mark_buffer_dirty(leaf); in btrfs_insert_hole_extent()
214 struct extent_buffer *leaf; in btrfs_lookup_csum() local
225 leaf = path->nodes[0]; in btrfs_lookup_csum()
231 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_lookup_csum()
237 csums_in_item = btrfs_item_size(leaf, path->slots[0]); in btrfs_lookup_csum()
247 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_csum_item); in btrfs_lookup_csum()
390 * If requested number of sectors is larger than one leaf can contain, in btrfs_lookup_bio_sums()
464 struct extent_buffer *leaf; in btrfs_lookup_csums_list() local
492 leaf = path->nodes[0]; in btrfs_lookup_csums_list()
493 btrfs_item_key_to_cpu(leaf, &key, path->slots[0] - 1); in btrfs_lookup_csums_list()
513 btrfs_item_size(leaf, path->slots[0] - 1)) in btrfs_lookup_csums_list()
521 leaf = path->nodes[0]; in btrfs_lookup_csums_list()
522 if (path->slots[0] >= btrfs_header_nritems(leaf)) { in btrfs_lookup_csums_list()
528 leaf = path->nodes[0]; in btrfs_lookup_csums_list()
531 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_lookup_csums_list()
541 btrfs_item_size(leaf, path->slots[0])); in btrfs_lookup_csums_list()
606 struct extent_buffer *leaf; in btrfs_lookup_csums_bitmap() local
641 leaf = path->nodes[0]; in btrfs_lookup_csums_bitmap()
642 btrfs_item_key_to_cpu(leaf, &key, path->slots[0] - 1); in btrfs_lookup_csums_bitmap()
662 btrfs_item_size(leaf, path->slots[0] - 1)) in btrfs_lookup_csums_bitmap()
671 leaf = path->nodes[0]; in btrfs_lookup_csums_bitmap()
672 if (path->slots[0] >= btrfs_header_nritems(leaf)) { in btrfs_lookup_csums_bitmap()
678 leaf = path->nodes[0]; in btrfs_lookup_csums_bitmap()
681 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_lookup_csums_bitmap()
691 btrfs_item_size(leaf, path->slots[0])); in btrfs_lookup_csums_bitmap()
819 struct extent_buffer *leaf; in truncate_one_csum() local
825 leaf = path->nodes[0]; in truncate_one_csum()
826 csum_end = btrfs_item_size(leaf, path->slots[0]) / csum_size; in truncate_one_csum()
871 struct extent_buffer *leaf; in btrfs_del_csums() local
898 leaf = path->nodes[0]; in btrfs_del_csums()
899 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_del_csums()
909 csum_end = btrfs_item_size(leaf, path->slots[0]) / csum_size; in btrfs_del_csums()
923 * leaf correspond to our range and then delete them all in btrfs_del_csums()
932 btrfs_item_key_to_cpu(leaf, &pk, slot); in btrfs_del_csums()
977 item_offset = btrfs_item_ptr_offset(leaf, in btrfs_del_csums()
980 memzero_extent_buffer(leaf, item_offset + offset, in btrfs_del_csums()
1048 struct extent_buffer *leaf = NULL; in btrfs_csum_file_blocks() local
1073 leaf = path->nodes[0]; in btrfs_csum_file_blocks()
1074 item_end = btrfs_item_ptr(leaf, path->slots[0], in btrfs_csum_file_blocks()
1077 btrfs_item_size(leaf, path->slots[0])); in btrfs_csum_file_blocks()
1087 leaf = path->nodes[0]; in btrfs_csum_file_blocks()
1088 item_size = btrfs_item_size(leaf, path->slots[0]); in btrfs_csum_file_blocks()
1109 * First check if the leaf has enough free space for at least one in btrfs_csum_file_blocks()
1113 if (btrfs_leaf_free_space(leaf) >= csum_size) { in btrfs_csum_file_blocks()
1114 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_csum_file_blocks()
1134 leaf = path->nodes[0]; in btrfs_csum_file_blocks()
1135 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_csum_file_blocks()
1145 if (csum_offset == btrfs_item_size(leaf, path->slots[0]) / in btrfs_csum_file_blocks()
1170 * checksum item. If we are at the last item in the leaf, then in btrfs_csum_file_blocks()
1173 * getting the first key for the next leaf, repeat the btree in btrfs_csum_file_blocks()
1175 * would only save a few bytes of leaf space. in btrfs_csum_file_blocks()
1200 diff = diff - btrfs_item_size(leaf, path->slots[0]); in btrfs_csum_file_blocks()
1201 diff = min_t(u32, btrfs_leaf_free_space(leaf), diff); in btrfs_csum_file_blocks()
1233 leaf = path->nodes[0]; in btrfs_csum_file_blocks()
1235 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_csum_item); in btrfs_csum_file_blocks()
1237 btrfs_item_size(leaf, path->slots[0])); in btrfs_csum_file_blocks()
1245 write_extent_buffer(leaf, sums->sums + index, (unsigned long)item, in btrfs_csum_file_blocks()
1270 struct extent_buffer *leaf = path->nodes[0]; in btrfs_extent_item_to_extent_map() local
1275 u8 type = btrfs_file_extent_type(leaf, fi); in btrfs_extent_item_to_extent_map()
1276 int compress_type = btrfs_file_extent_compression(leaf, fi); in btrfs_extent_item_to_extent_map()
1278 btrfs_item_key_to_cpu(leaf, &key, slot); in btrfs_extent_item_to_extent_map()
1281 em->ram_bytes = btrfs_file_extent_ram_bytes(leaf, fi); in btrfs_extent_item_to_extent_map()
1282 em->generation = btrfs_file_extent_generation(leaf, fi); in btrfs_extent_item_to_extent_map()
1288 btrfs_file_extent_offset(leaf, fi); in btrfs_extent_item_to_extent_map()
1289 em->orig_block_len = btrfs_file_extent_disk_num_bytes(leaf, fi); in btrfs_extent_item_to_extent_map()
1290 bytenr = btrfs_file_extent_disk_bytenr(leaf, fi); in btrfs_extent_item_to_extent_map()
1301 bytenr += btrfs_file_extent_offset(leaf, fi); in btrfs_extent_item_to_extent_map()
1335 const struct extent_buffer *leaf = path->nodes[0]; in btrfs_file_extent_end() local
1341 btrfs_item_key_to_cpu(leaf, &key, slot); in btrfs_file_extent_end()
1343 fi = btrfs_item_ptr(leaf, slot, struct btrfs_file_extent_item); in btrfs_file_extent_end()
1345 if (btrfs_file_extent_type(leaf, fi) == BTRFS_FILE_EXTENT_INLINE) { in btrfs_file_extent_end()
1346 end = btrfs_file_extent_ram_bytes(leaf, fi); in btrfs_file_extent_end()
1347 end = ALIGN(key.offset + end, leaf->fs_info->sectorsize); in btrfs_file_extent_end()
1349 end = key.offset + btrfs_file_extent_num_bytes(leaf, fi); in btrfs_file_extent_end()