Lines Matching refs:leaf
106 #define CHECK_FE_ALIGNED(leaf, slot, fi, name, alignment) \ argument
108 if (unlikely(!IS_ALIGNED(btrfs_file_extent_##name((leaf), (fi)), \
110 file_extent_err((leaf), (slot), \
112 (#name), btrfs_file_extent_##name((leaf), (fi)), \
114 (!IS_ALIGNED(btrfs_file_extent_##name((leaf), (fi)), (alignment))); \
117 static u64 file_extent_end(struct extent_buffer *leaf, in file_extent_end() argument
124 if (btrfs_file_extent_type(leaf, extent) == BTRFS_FILE_EXTENT_INLINE) { in file_extent_end()
125 len = btrfs_file_extent_ram_bytes(leaf, extent); in file_extent_end()
126 end = ALIGN(key->offset + len, leaf->fs_info->sectorsize); in file_extent_end()
128 len = btrfs_file_extent_num_bytes(leaf, extent); in file_extent_end()
171 static bool check_prev_ino(struct extent_buffer *leaf, in check_prev_ino() argument
190 if (!is_fstree(btrfs_header_owner(leaf))) in check_prev_ino()
197 dir_item_err(leaf, slot, in check_prev_ino()
202 static int check_extent_data_item(struct extent_buffer *leaf, in check_extent_data_item() argument
206 struct btrfs_fs_info *fs_info = leaf->fs_info; in check_extent_data_item()
209 u32 item_size = btrfs_item_size(leaf, slot); in check_extent_data_item()
213 file_extent_err(leaf, slot, in check_extent_data_item()
225 if (unlikely(!check_prev_ino(leaf, key, slot, prev_key))) in check_extent_data_item()
228 fi = btrfs_item_ptr(leaf, slot, struct btrfs_file_extent_item); in check_extent_data_item()
235 file_extent_err(leaf, slot, in check_extent_data_item()
241 if (unlikely(btrfs_file_extent_type(leaf, fi) >= in check_extent_data_item()
243 file_extent_err(leaf, slot, in check_extent_data_item()
245 btrfs_file_extent_type(leaf, fi), in check_extent_data_item()
254 if (unlikely(btrfs_file_extent_compression(leaf, fi) >= in check_extent_data_item()
256 file_extent_err(leaf, slot, in check_extent_data_item()
258 btrfs_file_extent_compression(leaf, fi), in check_extent_data_item()
262 if (unlikely(btrfs_file_extent_encryption(leaf, fi))) { in check_extent_data_item()
263 file_extent_err(leaf, slot, in check_extent_data_item()
265 btrfs_file_extent_encryption(leaf, fi)); in check_extent_data_item()
268 if (btrfs_file_extent_type(leaf, fi) == BTRFS_FILE_EXTENT_INLINE) { in check_extent_data_item()
271 file_extent_err(leaf, slot, in check_extent_data_item()
278 if (btrfs_file_extent_compression(leaf, fi) != in check_extent_data_item()
284 btrfs_file_extent_ram_bytes(leaf, fi))) { in check_extent_data_item()
285 file_extent_err(leaf, slot, in check_extent_data_item()
288 btrfs_file_extent_ram_bytes(leaf, fi)); in check_extent_data_item()
296 file_extent_err(leaf, slot, in check_extent_data_item()
301 if (unlikely(CHECK_FE_ALIGNED(leaf, slot, fi, ram_bytes, sectorsize) || in check_extent_data_item()
302 CHECK_FE_ALIGNED(leaf, slot, fi, disk_bytenr, sectorsize) || in check_extent_data_item()
303 CHECK_FE_ALIGNED(leaf, slot, fi, disk_num_bytes, sectorsize) || in check_extent_data_item()
304 CHECK_FE_ALIGNED(leaf, slot, fi, offset, sectorsize) || in check_extent_data_item()
305 CHECK_FE_ALIGNED(leaf, slot, fi, num_bytes, sectorsize))) in check_extent_data_item()
309 if (unlikely(check_add_overflow(btrfs_file_extent_num_bytes(leaf, fi), in check_extent_data_item()
311 file_extent_err(leaf, slot, in check_extent_data_item()
314 btrfs_file_extent_num_bytes(leaf, fi)); in check_extent_data_item()
328 prev_fi = btrfs_item_ptr(leaf, slot - 1, in check_extent_data_item()
330 prev_end = file_extent_end(leaf, prev_key, prev_fi); in check_extent_data_item()
332 file_extent_err(leaf, slot - 1, in check_extent_data_item()
342 static int check_csum_item(struct extent_buffer *leaf, struct btrfs_key *key, in check_csum_item() argument
345 struct btrfs_fs_info *fs_info = leaf->fs_info; in check_csum_item()
350 generic_err(leaf, slot, in check_csum_item()
356 generic_err(leaf, slot, in check_csum_item()
361 if (unlikely(!IS_ALIGNED(btrfs_item_size(leaf, slot), csumsize))) { in check_csum_item()
362 generic_err(leaf, slot, in check_csum_item()
364 btrfs_item_size(leaf, slot), csumsize); in check_csum_item()
371 prev_item_size = btrfs_item_size(leaf, slot - 1); in check_csum_item()
375 generic_err(leaf, slot - 1, in check_csum_item()
388 static int check_inode_key(struct extent_buffer *leaf, struct btrfs_key *key, in check_inode_key() argument
394 btrfs_item_key_to_cpu(leaf, &item_key, slot); in check_inode_key()
410 generic_err(leaf, slot, in check_inode_key()
417 dir_item_err(leaf, slot, in check_inode_key()
428 inode_item_err(leaf, slot, in check_inode_key()
432 dir_item_err(leaf, slot, in check_inode_key()
440 static int check_root_key(struct extent_buffer *leaf, struct btrfs_key *key, in check_root_key() argument
446 btrfs_item_key_to_cpu(leaf, &item_key, slot); in check_root_key()
457 generic_err(leaf, slot, in check_root_key()
466 generic_err(leaf, slot, "invalid root id 0"); in check_root_key()
468 dir_item_err(leaf, slot, in check_root_key()
475 dir_item_err(leaf, slot, in check_root_key()
492 generic_err(leaf, slot, "invalid root id 0 for reloc tree"); in check_root_key()
498 static int check_dir_item(struct extent_buffer *leaf, in check_dir_item() argument
502 struct btrfs_fs_info *fs_info = leaf->fs_info; in check_dir_item()
504 u32 item_size = btrfs_item_size(leaf, slot); in check_dir_item()
507 if (unlikely(!check_prev_ino(leaf, key, slot, prev_key))) in check_dir_item()
510 di = btrfs_item_ptr(leaf, slot, struct btrfs_dir_item); in check_dir_item()
523 dir_item_err(leaf, slot, in check_dir_item()
530 btrfs_dir_item_key_to_cpu(leaf, di, &location_key); in check_dir_item()
532 ret = check_root_key(leaf, &location_key, slot); in check_dir_item()
537 ret = check_inode_key(leaf, &location_key, slot); in check_dir_item()
541 dir_item_err(leaf, slot, in check_dir_item()
549 dir_type = btrfs_dir_ftype(leaf, di); in check_dir_item()
551 dir_item_err(leaf, slot, in check_dir_item()
559 dir_item_err(leaf, slot, in check_dir_item()
566 dir_item_err(leaf, slot, in check_dir_item()
576 name_len = btrfs_dir_name_len(leaf, di); in check_dir_item()
577 data_len = btrfs_dir_data_len(leaf, di); in check_dir_item()
579 dir_item_err(leaf, slot, in check_dir_item()
585 dir_item_err(leaf, slot, in check_dir_item()
593 dir_item_err(leaf, slot, in check_dir_item()
603 dir_item_err(leaf, slot, in check_dir_item()
617 read_extent_buffer(leaf, namebuf, in check_dir_item()
621 dir_item_err(leaf, slot, in check_dir_item()
657 static int check_block_group_item(struct extent_buffer *leaf, in check_block_group_item() argument
660 struct btrfs_fs_info *fs_info = leaf->fs_info; in check_block_group_item()
662 u32 item_size = btrfs_item_size(leaf, slot); in check_block_group_item()
672 block_group_err(leaf, slot, in check_block_group_item()
678 block_group_err(leaf, slot, in check_block_group_item()
684 read_extent_buffer(leaf, &bgi, btrfs_item_ptr_offset(leaf, slot), in check_block_group_item()
696 block_group_err(leaf, slot, in check_block_group_item()
703 block_group_err(leaf, slot, in check_block_group_item()
711 block_group_err(leaf, slot, in check_block_group_item()
719 block_group_err(leaf, slot, in check_block_group_item()
732 block_group_err(leaf, slot, in check_block_group_item()
745 static void chunk_err(const struct extent_buffer *leaf, in chunk_err() argument
749 const struct btrfs_fs_info *fs_info = leaf->fs_info; in chunk_err()
757 is_sb = (leaf->start == BTRFS_SUPER_INFO_OFFSET); in chunk_err()
764 for (i = 0; i < btrfs_header_nritems(leaf); i++) { in chunk_err()
765 if (btrfs_item_ptr_offset(leaf, i) == in chunk_err()
783 BTRFS_CHUNK_TREE_OBJECTID, leaf->start, slot, in chunk_err()
794 int btrfs_check_chunk_valid(struct extent_buffer *leaf, in btrfs_check_chunk_valid() argument
797 struct btrfs_fs_info *fs_info = leaf->fs_info; in btrfs_check_chunk_valid()
810 length = btrfs_chunk_length(leaf, chunk); in btrfs_check_chunk_valid()
811 stripe_len = btrfs_chunk_stripe_len(leaf, chunk); in btrfs_check_chunk_valid()
812 num_stripes = btrfs_chunk_num_stripes(leaf, chunk); in btrfs_check_chunk_valid()
813 sub_stripes = btrfs_chunk_sub_stripes(leaf, chunk); in btrfs_check_chunk_valid()
814 type = btrfs_chunk_type(leaf, chunk); in btrfs_check_chunk_valid()
820 chunk_err(leaf, chunk, logical, in btrfs_check_chunk_valid()
825 chunk_err(leaf, chunk, logical, in btrfs_check_chunk_valid()
831 chunk_err(leaf, chunk, logical, in btrfs_check_chunk_valid()
837 chunk_err(leaf, chunk, logical, in btrfs_check_chunk_valid()
842 if (unlikely(btrfs_chunk_sector_size(leaf, chunk) != fs_info->sectorsize)) { in btrfs_check_chunk_valid()
843 chunk_err(leaf, chunk, logical, in btrfs_check_chunk_valid()
845 btrfs_chunk_sector_size(leaf, chunk), in btrfs_check_chunk_valid()
850 chunk_err(leaf, chunk, logical, in btrfs_check_chunk_valid()
855 chunk_err(leaf, chunk, logical, in btrfs_check_chunk_valid()
861 chunk_err(leaf, chunk, logical, in btrfs_check_chunk_valid()
875 chunk_err(leaf, chunk, logical, in btrfs_check_chunk_valid()
882 chunk_err(leaf, chunk, logical, in btrfs_check_chunk_valid()
886 btrfs_chunk_type(leaf, chunk)); in btrfs_check_chunk_valid()
892 chunk_err(leaf, chunk, logical, in btrfs_check_chunk_valid()
898 chunk_err(leaf, chunk, logical, in btrfs_check_chunk_valid()
907 chunk_err(leaf, chunk, logical, in btrfs_check_chunk_valid()
920 chunk_err(leaf, chunk, logical, in btrfs_check_chunk_valid()
942 chunk_err(leaf, chunk, logical, in btrfs_check_chunk_valid()
958 static int check_leaf_chunk_item(struct extent_buffer *leaf, in check_leaf_chunk_item() argument
964 if (unlikely(btrfs_item_size(leaf, slot) < sizeof(struct btrfs_chunk))) { in check_leaf_chunk_item()
965 chunk_err(leaf, chunk, key->offset, in check_leaf_chunk_item()
967 btrfs_item_size(leaf, slot), in check_leaf_chunk_item()
969 BTRFS_LEAF_DATA_SIZE(leaf->fs_info)); in check_leaf_chunk_item()
973 num_stripes = btrfs_chunk_num_stripes(leaf, chunk); in check_leaf_chunk_item()
979 btrfs_item_size(leaf, slot))) { in check_leaf_chunk_item()
980 chunk_err(leaf, chunk, key->offset, in check_leaf_chunk_item()
982 btrfs_item_size(leaf, slot), in check_leaf_chunk_item()
987 return btrfs_check_chunk_valid(leaf, chunk, key->offset); in check_leaf_chunk_item()
1013 static int check_dev_item(struct extent_buffer *leaf, in check_dev_item() argument
1017 const u32 item_size = btrfs_item_size(leaf, slot); in check_dev_item()
1020 dev_item_err(leaf, slot, in check_dev_item()
1027 dev_item_err(leaf, slot, "invalid item size: has %u expect %zu", in check_dev_item()
1032 ditem = btrfs_item_ptr(leaf, slot, struct btrfs_dev_item); in check_dev_item()
1033 if (unlikely(btrfs_device_id(leaf, ditem) != key->offset)) { in check_dev_item()
1034 dev_item_err(leaf, slot, in check_dev_item()
1036 key->offset, btrfs_device_id(leaf, ditem)); in check_dev_item()
1045 if (unlikely(btrfs_device_bytes_used(leaf, ditem) > in check_dev_item()
1046 btrfs_device_total_bytes(leaf, ditem))) { in check_dev_item()
1047 dev_item_err(leaf, slot, in check_dev_item()
1049 btrfs_device_bytes_used(leaf, ditem), in check_dev_item()
1050 btrfs_device_total_bytes(leaf, ditem)); in check_dev_item()
1060 static int check_inode_item(struct extent_buffer *leaf, in check_inode_item() argument
1063 struct btrfs_fs_info *fs_info = leaf->fs_info; in check_inode_item()
1067 const u32 item_size = btrfs_item_size(leaf, slot); in check_inode_item()
1073 ret = check_inode_key(leaf, key, slot); in check_inode_item()
1078 generic_err(leaf, slot, "invalid item size: has %u expect %zu", in check_inode_item()
1083 iitem = btrfs_item_ptr(leaf, slot, struct btrfs_inode_item); in check_inode_item()
1086 if (unlikely(btrfs_inode_generation(leaf, iitem) > super_gen + 1)) { in check_inode_item()
1087 inode_item_err(leaf, slot, in check_inode_item()
1089 btrfs_inode_generation(leaf, iitem), in check_inode_item()
1094 if (unlikely(btrfs_inode_transid(leaf, iitem) > super_gen + 1)) { in check_inode_item()
1095 inode_item_err(leaf, slot, in check_inode_item()
1097 btrfs_inode_transid(leaf, iitem), super_gen + 1); in check_inode_item()
1106 mode = btrfs_inode_mode(leaf, iitem); in check_inode_item()
1108 inode_item_err(leaf, slot, in check_inode_item()
1121 inode_item_err(leaf, slot, in check_inode_item()
1127 if (unlikely(S_ISDIR(mode) && btrfs_inode_nlink(leaf, iitem) > 1)) { in check_inode_item()
1128 inode_item_err(leaf, slot, in check_inode_item()
1130 btrfs_inode_nlink(leaf, iitem)); in check_inode_item()
1133 btrfs_inode_split_flags(btrfs_inode_flags(leaf, iitem), &flags, &ro_flags); in check_inode_item()
1135 inode_item_err(leaf, slot, in check_inode_item()
1141 inode_item_err(leaf, slot, in check_inode_item()
1149 static int check_root_item(struct extent_buffer *leaf, struct btrfs_key *key, in check_root_item() argument
1152 struct btrfs_fs_info *fs_info = leaf->fs_info; in check_root_item()
1158 ret = check_root_key(leaf, key, slot); in check_root_item()
1162 if (unlikely(btrfs_item_size(leaf, slot) != sizeof(ri) && in check_root_item()
1163 btrfs_item_size(leaf, slot) != in check_root_item()
1165 generic_err(leaf, slot, in check_root_item()
1167 btrfs_item_size(leaf, slot), sizeof(ri), in check_root_item()
1177 read_extent_buffer(leaf, &ri, btrfs_item_ptr_offset(leaf, slot), in check_root_item()
1178 btrfs_item_size(leaf, slot)); in check_root_item()
1183 generic_err(leaf, slot, in check_root_item()
1191 generic_err(leaf, slot, in check_root_item()
1199 generic_err(leaf, slot, in check_root_item()
1208 generic_err(leaf, slot, in check_root_item()
1214 generic_err(leaf, slot, in check_root_item()
1220 generic_err(leaf, slot, in check_root_item()
1228 generic_err(leaf, slot, in check_root_item()
1267 static int check_extent_item(struct extent_buffer *leaf, in check_extent_item() argument
1271 struct btrfs_fs_info *fs_info = leaf->fs_info; in check_extent_item()
1276 const u32 item_size = btrfs_item_size(leaf, slot); in check_extent_item()
1284 generic_err(leaf, slot, in check_extent_item()
1290 generic_err(leaf, slot, in check_extent_item()
1299 extent_err(leaf, slot, in check_extent_item()
1325 extent_err(leaf, slot, in check_extent_item()
1331 end = item_size + btrfs_item_ptr_offset(leaf, slot); in check_extent_item()
1334 ei = btrfs_item_ptr(leaf, slot, struct btrfs_extent_item); in check_extent_item()
1335 flags = btrfs_extent_flags(leaf, ei); in check_extent_item()
1336 total_refs = btrfs_extent_refs(leaf, ei); in check_extent_item()
1337 generation = btrfs_extent_generation(leaf, ei); in check_extent_item()
1340 extent_err(leaf, slot, in check_extent_item()
1348 extent_err(leaf, slot, in check_extent_item()
1358 extent_err(leaf, slot, in check_extent_item()
1365 extent_err(leaf, slot, in check_extent_item()
1371 extent_err(leaf, slot, in check_extent_item()
1377 extent_err(leaf, slot, in check_extent_item()
1389 if (unlikely(btrfs_tree_block_level(leaf, info) >= BTRFS_MAX_LEVEL)) { in check_extent_item()
1390 extent_err(leaf, slot, in check_extent_item()
1392 btrfs_tree_block_level(leaf, info), in check_extent_item()
1409 extent_err(leaf, slot, in check_extent_item()
1415 inline_type = btrfs_extent_inline_ref_type(leaf, iref); in check_extent_item()
1416 inline_offset = btrfs_extent_inline_ref_offset(leaf, iref); in check_extent_item()
1418 extent_err(leaf, slot, in check_extent_item()
1433 extent_err(leaf, slot, in check_extent_item()
1446 dref_offset = btrfs_extent_data_ref_offset(leaf, dref); in check_extent_item()
1449 extent_err(leaf, slot, in check_extent_item()
1454 inline_refs += btrfs_extent_data_ref_count(leaf, dref); in check_extent_item()
1461 extent_err(leaf, slot, in check_extent_item()
1466 inline_refs += btrfs_shared_data_ref_count(leaf, sref); in check_extent_item()
1469 extent_err(leaf, slot, "unknown inline ref type: %u", in check_extent_item()
1477 extent_err(leaf, slot, in check_extent_item()
1484 extent_err(leaf, slot, in check_extent_item()
1500 extent_err(leaf, slot, in check_extent_item()
1512 static int check_simple_keyed_refs(struct extent_buffer *leaf, in check_simple_keyed_refs() argument
1520 if (unlikely(btrfs_item_size(leaf, slot) != expect_item_size)) { in check_simple_keyed_refs()
1521 generic_err(leaf, slot, in check_simple_keyed_refs()
1523 btrfs_item_size(leaf, slot), in check_simple_keyed_refs()
1527 if (unlikely(!IS_ALIGNED(key->objectid, leaf->fs_info->sectorsize))) { in check_simple_keyed_refs()
1528 generic_err(leaf, slot, in check_simple_keyed_refs()
1530 key->objectid, leaf->fs_info->sectorsize); in check_simple_keyed_refs()
1534 !IS_ALIGNED(key->offset, leaf->fs_info->sectorsize))) { in check_simple_keyed_refs()
1535 extent_err(leaf, slot, in check_simple_keyed_refs()
1537 key->offset, leaf->fs_info->sectorsize); in check_simple_keyed_refs()
1543 static int check_extent_data_ref(struct extent_buffer *leaf, in check_extent_data_ref() argument
1547 unsigned long ptr = btrfs_item_ptr_offset(leaf, slot); in check_extent_data_ref()
1548 const unsigned long end = ptr + btrfs_item_size(leaf, slot); in check_extent_data_ref()
1550 if (unlikely(btrfs_item_size(leaf, slot) % sizeof(*dref) != 0)) { in check_extent_data_ref()
1551 generic_err(leaf, slot, in check_extent_data_ref()
1553 btrfs_item_size(leaf, slot), in check_extent_data_ref()
1557 if (unlikely(!IS_ALIGNED(key->objectid, leaf->fs_info->sectorsize))) { in check_extent_data_ref()
1558 generic_err(leaf, slot, in check_extent_data_ref()
1560 key->objectid, leaf->fs_info->sectorsize); in check_extent_data_ref()
1571 offset = btrfs_extent_data_ref_offset(leaf, dref); in check_extent_data_ref()
1572 if (unlikely(!IS_ALIGNED(offset, leaf->fs_info->sectorsize))) { in check_extent_data_ref()
1573 extent_err(leaf, slot, in check_extent_data_ref()
1575 offset, leaf->fs_info->sectorsize); in check_extent_data_ref()
1584 static int check_inode_ref(struct extent_buffer *leaf, in check_inode_ref() argument
1592 if (unlikely(!check_prev_ino(leaf, key, slot, prev_key))) in check_inode_ref()
1595 if (unlikely(btrfs_item_size(leaf, slot) <= sizeof(*iref))) { in check_inode_ref()
1596 inode_ref_err(leaf, slot, in check_inode_ref()
1598 btrfs_item_size(leaf, slot), in check_inode_ref()
1599 sizeof(*iref), BTRFS_LEAF_DATA_SIZE(leaf->fs_info)); in check_inode_ref()
1603 ptr = btrfs_item_ptr_offset(leaf, slot); in check_inode_ref()
1604 end = ptr + btrfs_item_size(leaf, slot); in check_inode_ref()
1609 inode_ref_err(leaf, slot, in check_inode_ref()
1616 namelen = btrfs_inode_ref_name_len(leaf, iref); in check_inode_ref()
1618 inode_ref_err(leaf, slot, in check_inode_ref()
1637 static enum btrfs_tree_block_status check_leaf_item(struct extent_buffer *leaf, in check_leaf_item() argument
1647 ret = check_extent_data_item(leaf, key, slot, prev_key); in check_leaf_item()
1650 ret = check_csum_item(leaf, key, slot, prev_key); in check_leaf_item()
1655 ret = check_dir_item(leaf, key, prev_key, slot); in check_leaf_item()
1658 ret = check_inode_ref(leaf, key, prev_key, slot); in check_leaf_item()
1661 ret = check_block_group_item(leaf, key, slot); in check_leaf_item()
1664 chunk = btrfs_item_ptr(leaf, slot, struct btrfs_chunk); in check_leaf_item()
1665 ret = check_leaf_chunk_item(leaf, chunk, key, slot); in check_leaf_item()
1668 ret = check_dev_item(leaf, key, slot); in check_leaf_item()
1671 ret = check_inode_item(leaf, key, slot); in check_leaf_item()
1674 ret = check_root_item(leaf, key, slot); in check_leaf_item()
1678 ret = check_extent_item(leaf, key, slot, prev_key); in check_leaf_item()
1683 ret = check_simple_keyed_refs(leaf, key, slot); in check_leaf_item()
1686 ret = check_extent_data_ref(leaf, key, slot); in check_leaf_item()
1695 enum btrfs_tree_block_status __btrfs_check_leaf(struct extent_buffer *leaf) in __btrfs_check_leaf() argument
1697 struct btrfs_fs_info *fs_info = leaf->fs_info; in __btrfs_check_leaf()
1701 u32 nritems = btrfs_header_nritems(leaf); in __btrfs_check_leaf()
1704 if (unlikely(btrfs_header_level(leaf) != 0)) { in __btrfs_check_leaf()
1705 generic_err(leaf, 0, in __btrfs_check_leaf()
1707 btrfs_header_level(leaf)); in __btrfs_check_leaf()
1719 if (nritems == 0 && !btrfs_header_flag(leaf, BTRFS_HEADER_FLAG_RELOC)) { in __btrfs_check_leaf()
1720 u64 owner = btrfs_header_owner(leaf); in __btrfs_check_leaf()
1728 generic_err(leaf, 0, in __btrfs_check_leaf()
1736 generic_err(leaf, 0, in __btrfs_check_leaf()
1746 generic_err(leaf, 0, in __btrfs_check_leaf()
1773 btrfs_item_key_to_cpu(leaf, &key, slot); in __btrfs_check_leaf()
1777 generic_err(leaf, slot, in __btrfs_check_leaf()
1785 item_data_end = (u64)btrfs_item_offset(leaf, slot) + in __btrfs_check_leaf()
1786 btrfs_item_size(leaf, slot); in __btrfs_check_leaf()
1795 item_end_expected = btrfs_item_offset(leaf, in __btrfs_check_leaf()
1798 generic_err(leaf, slot, in __btrfs_check_leaf()
1810 generic_err(leaf, slot, in __btrfs_check_leaf()
1817 if (unlikely(btrfs_item_ptr_offset(leaf, slot) < in __btrfs_check_leaf()
1818 btrfs_item_nr_offset(leaf, slot) + sizeof(struct btrfs_item))) { in __btrfs_check_leaf()
1819 generic_err(leaf, slot, in __btrfs_check_leaf()
1821 btrfs_item_nr_offset(leaf, slot) + in __btrfs_check_leaf()
1823 btrfs_item_ptr_offset(leaf, slot)); in __btrfs_check_leaf()
1831 if (btrfs_header_flag(leaf, BTRFS_HEADER_FLAG_WRITTEN)) { in __btrfs_check_leaf()
1838 ret = check_leaf_item(leaf, &key, slot, &prev_key); in __btrfs_check_leaf()
1851 int btrfs_check_leaf(struct extent_buffer *leaf) in btrfs_check_leaf() argument
1855 ret = __btrfs_check_leaf(leaf); in btrfs_check_leaf()