/fs/btrfs/ |
D | locking.c | 81 void btrfs_set_buffer_lockdep_class(u64 objectid, struct extent_buffer *eb, int level) in btrfs_set_buffer_lockdep_class() argument 92 lockdep_set_class_and_name(&eb->lock, &ks->keys[level], ks->names[level]); in btrfs_set_buffer_lockdep_class() 95 void btrfs_maybe_reset_lockdep_class(struct btrfs_root *root, struct extent_buffer *eb) in btrfs_maybe_reset_lockdep_class() argument 99 eb, btrfs_header_level(eb)); in btrfs_maybe_reset_lockdep_class() 128 void __btrfs_tree_read_lock(struct extent_buffer *eb, enum btrfs_lock_nesting nest) in __btrfs_tree_read_lock() argument 135 down_read_nested(&eb->lock, nest); in __btrfs_tree_read_lock() 136 trace_btrfs_tree_read_lock(eb, start_ns); in __btrfs_tree_read_lock() 139 void btrfs_tree_read_lock(struct extent_buffer *eb) in btrfs_tree_read_lock() argument 141 __btrfs_tree_read_lock(eb, BTRFS_NESTING_NORMAL); in btrfs_tree_read_lock() 149 int btrfs_try_tree_read_lock(struct extent_buffer *eb) in btrfs_try_tree_read_lock() argument [all …]
|
D | extent_io.c | 38 static inline void btrfs_leak_debug_add_eb(struct extent_buffer *eb) in btrfs_leak_debug_add_eb() argument 40 struct btrfs_fs_info *fs_info = eb->fs_info; in btrfs_leak_debug_add_eb() 44 list_add(&eb->leak_list, &fs_info->allocated_ebs); in btrfs_leak_debug_add_eb() 48 static inline void btrfs_leak_debug_del_eb(struct extent_buffer *eb) in btrfs_leak_debug_del_eb() argument 50 struct btrfs_fs_info *fs_info = eb->fs_info; in btrfs_leak_debug_del_eb() 54 list_del(&eb->leak_list); in btrfs_leak_debug_del_eb() 60 struct extent_buffer *eb; in btrfs_extent_buffer_leak_debug_check() local 73 eb = list_first_entry(&fs_info->allocated_ebs, in btrfs_extent_buffer_leak_debug_check() 77 eb->start, eb->len, atomic_read(&eb->refs), eb->bflags, in btrfs_extent_buffer_leak_debug_check() 78 btrfs_header_owner(eb)); in btrfs_extent_buffer_leak_debug_check() [all …]
|
D | tree-mod-log.c | 170 struct extent_buffer *eb) in tree_mod_dont_log() argument 174 if (eb && btrfs_header_level(eb) == 0) in tree_mod_dont_log() 188 struct extent_buffer *eb) in tree_mod_need_log() argument 192 if (eb && btrfs_header_level(eb) == 0) in tree_mod_need_log() 198 static struct tree_mod_elem *alloc_tree_mod_elem(struct extent_buffer *eb, in alloc_tree_mod_elem() argument 209 tm->logical = eb->start; in alloc_tree_mod_elem() 211 btrfs_node_key(eb, &tm->key, slot); in alloc_tree_mod_elem() 212 tm->blockptr = btrfs_node_blockptr(eb, slot); in alloc_tree_mod_elem() 216 tm->generation = btrfs_node_ptr_generation(eb, slot); in alloc_tree_mod_elem() 222 int btrfs_tree_mod_log_insert_key(struct extent_buffer *eb, int slot, in btrfs_tree_mod_log_insert_key() argument [all …]
|
D | print-tree.c | 49 static void print_chunk(struct extent_buffer *eb, struct btrfs_chunk *chunk) in print_chunk() argument 51 int num_stripes = btrfs_chunk_num_stripes(eb, chunk); in print_chunk() 54 btrfs_chunk_length(eb, chunk), btrfs_chunk_owner(eb, chunk), in print_chunk() 55 btrfs_chunk_type(eb, chunk), num_stripes); in print_chunk() 58 btrfs_stripe_devid_nr(eb, chunk, i), in print_chunk() 59 btrfs_stripe_offset_nr(eb, chunk, i)); in print_chunk() 62 static void print_dev_item(struct extent_buffer *eb, in print_dev_item() argument 66 btrfs_device_id(eb, dev_item), in print_dev_item() 67 btrfs_device_total_bytes(eb, dev_item), in print_dev_item() 68 btrfs_device_bytes_used(eb, dev_item)); in print_dev_item() [all …]
|
D | locking.h | 86 void __btrfs_tree_lock(struct extent_buffer *eb, enum btrfs_lock_nesting nest); 87 void btrfs_tree_lock(struct extent_buffer *eb); 88 void btrfs_tree_unlock(struct extent_buffer *eb); 90 void __btrfs_tree_read_lock(struct extent_buffer *eb, enum btrfs_lock_nesting nest); 91 void btrfs_tree_read_lock(struct extent_buffer *eb); 92 void btrfs_tree_read_unlock(struct extent_buffer *eb); 93 int btrfs_try_tree_read_lock(struct extent_buffer *eb); 94 int btrfs_try_tree_write_lock(struct extent_buffer *eb); 100 static inline void btrfs_assert_tree_write_locked(struct extent_buffer *eb) in btrfs_assert_tree_write_locked() argument 102 lockdep_assert_held_write(&eb->lock); in btrfs_assert_tree_write_locked() [all …]
|
D | struct-funcs.c | 10 static bool check_setget_bounds(const struct extent_buffer *eb, in check_setget_bounds() argument 15 if (unlikely(member_offset + size > eb->len)) { in check_setget_bounds() 16 btrfs_warn(eb->fs_info, in check_setget_bounds() 18 (member_offset > eb->len ? "start" : "end"), in check_setget_bounds() 19 (unsigned long)ptr, eb->start, member_offset, size); in check_setget_bounds() 56 const unsigned long oip = get_eb_offset_in_page(token->eb, \ 64 ASSERT(check_setget_bounds(token->eb, ptr, off, size)); \ 69 token->kaddr = page_address(token->eb->pages[idx]); \ 75 token->kaddr = page_address(token->eb->pages[idx + 1]); \ 80 u##bits btrfs_get_##bits(const struct extent_buffer *eb, \ [all …]
|
D | extent_io.h | 172 void free_extent_buffer(struct extent_buffer *eb); 173 void free_extent_buffer_stale(struct extent_buffer *eb); 177 int read_extent_buffer_pages(struct extent_buffer *eb, int wait, 179 void wait_on_extent_buffer_writeback(struct extent_buffer *eb); 184 static inline int num_extent_pages(const struct extent_buffer *eb) in num_extent_pages() argument 193 return (eb->len >> PAGE_SHIFT) ?: 1; in num_extent_pages() 196 static inline int extent_buffer_uptodate(const struct extent_buffer *eb) in extent_buffer_uptodate() argument 198 return test_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags); in extent_buffer_uptodate() 201 int memcmp_extent_buffer(const struct extent_buffer *eb, const void *ptrv, 203 void read_extent_buffer(const struct extent_buffer *eb, void *dst, [all …]
|
D | uuid-tree.c | 27 struct extent_buffer *eb; in btrfs_uuid_tree_lookup() local 53 eb = path->nodes[0]; in btrfs_uuid_tree_lookup() 55 item_size = btrfs_item_size(eb, slot); in btrfs_uuid_tree_lookup() 56 offset = btrfs_item_ptr_offset(eb, slot); in btrfs_uuid_tree_lookup() 68 read_extent_buffer(eb, &data, offset, sizeof(data)); in btrfs_uuid_tree_lookup() 90 struct extent_buffer *eb; in btrfs_uuid_tree_add() local 116 eb = path->nodes[0]; in btrfs_uuid_tree_add() 118 offset = btrfs_item_ptr_offset(eb, slot); in btrfs_uuid_tree_add() 125 eb = path->nodes[0]; in btrfs_uuid_tree_add() 127 offset = btrfs_item_ptr_offset(eb, slot); in btrfs_uuid_tree_add() [all …]
|
D | backref.c | 29 const struct extent_buffer *eb, in check_extent_in_eb() argument 39 !btrfs_file_extent_compression(eb, fi) && in check_extent_in_eb() 40 !btrfs_file_extent_encryption(eb, fi) && in check_extent_in_eb() 41 !btrfs_file_extent_other_encoding(eb, fi)) { in check_extent_in_eb() 45 data_offset = btrfs_file_extent_offset(eb, fi); in check_extent_in_eb() 46 data_len = btrfs_file_extent_num_bytes(eb, fi); in check_extent_in_eb() 76 static int find_extent_in_eb(const struct extent_buffer *eb, in find_extent_in_eb() argument 94 nritems = btrfs_header_nritems(eb); in find_extent_in_eb() 96 btrfs_item_key_to_cpu(eb, &key, slot); in find_extent_in_eb() 99 fi = btrfs_item_ptr(eb, slot, struct btrfs_file_extent_item); in find_extent_in_eb() [all …]
|
D | ctree.h | 1731 struct extent_buffer *eb; member 1740 struct extent_buffer *eb) in btrfs_init_map_token() argument 1742 token->eb = eb; in btrfs_init_map_token() 1743 token->kaddr = page_address(eb->pages[0]); in btrfs_init_map_token() 1765 #define read_eb_member(eb, ptr, type, member, result) (\ argument 1766 read_extent_buffer(eb, (char *)(result), \ 1771 #define write_eb_member(eb, ptr, type, member, result) (\ argument 1772 write_extent_buffer(eb, (char *)(result), \ 1783 u##bits btrfs_get_##bits(const struct extent_buffer *eb, \ 1785 void btrfs_set_##bits(const struct extent_buffer *eb, void *ptr, \ [all …]
|
D | disk-io.c | 122 struct extent_buffer *eb, u64 parent_transid, in verify_parent_transid() argument 128 if (!parent_transid || btrfs_header_generation(eb) == parent_transid) in verify_parent_transid() 134 lock_extent(io_tree, eb->start, eb->start + eb->len - 1, &cached_state); in verify_parent_transid() 135 if (extent_buffer_uptodate(eb) && in verify_parent_transid() 136 btrfs_header_generation(eb) == parent_transid) { in verify_parent_transid() 140 btrfs_err_rl(eb->fs_info, in verify_parent_transid() 142 eb->start, eb->read_mirror, in verify_parent_transid() 143 parent_transid, btrfs_header_generation(eb)); in verify_parent_transid() 145 clear_extent_buffer_uptodate(eb); in verify_parent_transid() 147 unlock_extent(io_tree, eb->start, eb->start + eb->len - 1, in verify_parent_transid() [all …]
|
D | relocation.c | 737 struct extent_buffer *eb; in create_reloc_root() local 755 ret = btrfs_copy_root(trans, root, root->commit_root, &eb, in create_reloc_root() 778 ret = btrfs_copy_root(trans, root, root->node, &eb, in create_reloc_root() 791 btrfs_set_root_bytenr(root_item, eb->start); in create_reloc_root() 792 btrfs_set_root_level(root_item, btrfs_header_level(eb)); in create_reloc_root() 802 btrfs_tree_unlock(eb); in create_reloc_root() 803 free_extent_buffer(eb); in create_reloc_root() 1178 int memcmp_node_keys(struct extent_buffer *eb, int slot, in memcmp_node_keys() argument 1183 btrfs_node_key(eb, &key1, slot); in memcmp_node_keys() 1204 struct extent_buffer *eb; in replace_path() local [all …]
|
D | tree-checker.c | 51 static void generic_err(const struct extent_buffer *eb, int slot, in generic_err() argument 54 const struct btrfs_fs_info *fs_info = eb->fs_info; in generic_err() 65 btrfs_header_level(eb) == 0 ? "leaf" : "node", in generic_err() 66 btrfs_header_owner(eb), btrfs_header_bytenr(eb), slot, &vaf); in generic_err() 76 static void file_extent_err(const struct extent_buffer *eb, int slot, in file_extent_err() argument 79 const struct btrfs_fs_info *fs_info = eb->fs_info; in file_extent_err() 84 btrfs_item_key_to_cpu(eb, &key, slot); in file_extent_err() 92 btrfs_header_level(eb) == 0 ? "leaf" : "node", in file_extent_err() 93 btrfs_header_owner(eb), btrfs_header_bytenr(eb), slot, in file_extent_err() 136 static void dir_item_err(const struct extent_buffer *eb, int slot, in dir_item_err() argument [all …]
|
D | dev-replace.c | 77 struct extent_buffer *eb; in btrfs_init_dev_replace() local 130 eb = path->nodes[0]; in btrfs_init_dev_replace() 131 item_size = btrfs_item_size(eb, slot); in btrfs_init_dev_replace() 132 ptr = btrfs_item_ptr(eb, slot, struct btrfs_dev_replace_item); in btrfs_init_dev_replace() 140 src_devid = btrfs_dev_replace_src_devid(eb, ptr); in btrfs_init_dev_replace() 142 btrfs_dev_replace_cont_reading_from_srcdev_mode(eb, ptr); in btrfs_init_dev_replace() 143 dev_replace->replace_state = btrfs_dev_replace_replace_state(eb, ptr); in btrfs_init_dev_replace() 144 dev_replace->time_started = btrfs_dev_replace_time_started(eb, ptr); in btrfs_init_dev_replace() 146 btrfs_dev_replace_time_stopped(eb, ptr); in btrfs_init_dev_replace() 148 btrfs_dev_replace_num_write_errors(eb, ptr)); in btrfs_init_dev_replace() [all …]
|
D | tree-log.c | 317 int (*process_func)(struct btrfs_root *log, struct extent_buffer *eb, 325 struct extent_buffer *eb, in process_one_buffer() argument 336 ret = btrfs_read_extent_buffer(eb, gen, level, NULL); in process_one_buffer() 342 ret = btrfs_pin_extent_for_log_replay(wc->trans, eb->start, in process_one_buffer() 343 eb->len); in process_one_buffer() 347 if (btrfs_buffer_uptodate(eb, gen, 0) && in process_one_buffer() 348 btrfs_header_level(eb) == 0) in process_one_buffer() 349 ret = btrfs_exclude_logged_extents(eb); in process_one_buffer() 357 struct extent_buffer *eb, int slot, in do_overwrite_item() argument 372 item_size = btrfs_item_size(eb, slot); in do_overwrite_item() [all …]
|
D | zoned.c | 1588 struct extent_buffer *eb) in btrfs_redirty_list_add() argument 1590 struct btrfs_fs_info *fs_info = eb->fs_info; in btrfs_redirty_list_add() 1593 btrfs_header_flag(eb, BTRFS_HEADER_FLAG_WRITTEN) || in btrfs_redirty_list_add() 1594 !list_empty(&eb->release_list)) in btrfs_redirty_list_add() 1597 memzero_extent_buffer(eb, 0, eb->len); in btrfs_redirty_list_add() 1598 set_bit(EXTENT_BUFFER_NO_CHECK, &eb->bflags); in btrfs_redirty_list_add() 1599 set_extent_buffer_dirty(eb); in btrfs_redirty_list_add() 1600 set_extent_bits_nowait(&trans->dirty_pages, eb->start, in btrfs_redirty_list_add() 1601 eb->start + eb->len - 1, EXTENT_DIRTY); in btrfs_redirty_list_add() 1604 list_add_tail(&eb->release_list, &trans->releasing_ebs); in btrfs_redirty_list_add() [all …]
|
D | tree-mod-log.h | 34 int btrfs_tree_mod_log_insert_key(struct extent_buffer *eb, int slot, 36 int btrfs_tree_mod_log_free_eb(struct extent_buffer *eb); 39 struct extent_buffer *eb, 48 int btrfs_tree_mod_log_insert_move(struct extent_buffer *eb,
|
D | zoned.h | 56 struct extent_buffer *eb); 63 struct extent_buffer *eb, 66 struct extent_buffer *eb); 78 struct extent_buffer *eb); 184 struct extent_buffer *eb) { } in btrfs_redirty_list_add() argument 201 struct extent_buffer *eb, in btrfs_check_meta_write_pointer() argument 209 struct extent_buffer *eb) in btrfs_revert_meta_write_pointer() argument 253 struct extent_buffer *eb) { } in btrfs_schedule_zone_finish_bg() argument
|
D | backref.h | 42 int tree_backref_for_extent(unsigned long *ptr, struct extent_buffer *eb, 201 struct extent_buffer *eb; member 318 ASSERT(node->eb == NULL); in btrfs_backref_free_node() 338 btrfs_tree_unlock(node->eb); in btrfs_backref_unlock_node_buffer() 346 if (node->eb) { in btrfs_backref_drop_node_buffer() 348 free_extent_buffer(node->eb); in btrfs_backref_drop_node_buffer() 349 node->eb = NULL; in btrfs_backref_drop_node_buffer()
|
D | qgroup.c | 1901 struct extent_buffer *eb) in btrfs_qgroup_trace_leaf_items() argument 1904 int nr = btrfs_header_nritems(eb); in btrfs_qgroup_trace_leaf_items() 1915 btrfs_item_key_to_cpu(eb, &key, i); in btrfs_qgroup_trace_leaf_items() 1920 fi = btrfs_item_ptr(eb, i, struct btrfs_file_extent_item); in btrfs_qgroup_trace_leaf_items() 1922 extent_type = btrfs_file_extent_type(eb, fi); in btrfs_qgroup_trace_leaf_items() 1927 bytenr = btrfs_file_extent_disk_bytenr(eb, fi); in btrfs_qgroup_trace_leaf_items() 1931 num_bytes = btrfs_file_extent_disk_num_bytes(eb, fi); in btrfs_qgroup_trace_leaf_items() 1960 struct extent_buffer *eb; in adjust_slots_upwards() local 1966 eb = path->nodes[level]; in adjust_slots_upwards() 1967 nr = btrfs_header_nritems(eb); in adjust_slots_upwards() [all …]
|
/fs/btrfs/tests/ |
D | extent-buffer-tests.c | 17 struct extent_buffer *eb; in test_btrfs_split_item() local 50 eb = alloc_dummy_extent_buffer(fs_info, nodesize); in test_btrfs_split_item() 51 path->nodes[0] = eb; in test_btrfs_split_item() 52 if (!eb) { in test_btrfs_split_item() 64 write_extent_buffer(eb, value, btrfs_item_ptr_offset(eb, 0), in test_btrfs_split_item() 84 btrfs_item_key_to_cpu(eb, &key, 0); in test_btrfs_split_item() 92 if (btrfs_item_size(eb, 0) != strlen(split1)) { in test_btrfs_split_item() 98 read_extent_buffer(eb, buf, btrfs_item_ptr_offset(eb, 0), in test_btrfs_split_item() 108 btrfs_item_key_to_cpu(eb, &key, 1); in test_btrfs_split_item() 116 if (btrfs_item_size(eb, 1) != strlen(split2)) { in test_btrfs_split_item() [all …]
|
D | extent-io-tests.c | 322 static int check_eb_bitmap(unsigned long *bitmap, struct extent_buffer *eb, in check_eb_bitmap() argument 331 bit1 = !!extent_buffer_test_bit(eb, 0, i); in check_eb_bitmap() 337 bit1 = !!extent_buffer_test_bit(eb, i / BITS_PER_BYTE, in check_eb_bitmap() 347 static int __test_eb_bitmaps(unsigned long *bitmap, struct extent_buffer *eb, in __test_eb_bitmaps() argument 355 memzero_extent_buffer(eb, 0, len); in __test_eb_bitmaps() 356 if (memcmp_extent_buffer(eb, bitmap, 0, len) != 0) { in __test_eb_bitmaps() 362 extent_buffer_bitmap_set(eb, 0, 0, len * BITS_PER_BYTE); in __test_eb_bitmaps() 363 ret = check_eb_bitmap(bitmap, eb, len); in __test_eb_bitmaps() 370 extent_buffer_bitmap_clear(eb, 0, 0, len * BITS_PER_BYTE); in __test_eb_bitmaps() 371 ret = check_eb_bitmap(bitmap, eb, len); in __test_eb_bitmaps() [all …]
|
D | btrfs-tests.c | 169 struct extent_buffer *eb; in btrfs_free_dummy_fs_info() local 171 eb = radix_tree_deref_slot_protected(slot, &fs_info->buffer_lock); in btrfs_free_dummy_fs_info() 172 if (!eb) in btrfs_free_dummy_fs_info() 175 if (radix_tree_exception(eb)) { in btrfs_free_dummy_fs_info() 176 if (radix_tree_deref_retry(eb)) in btrfs_free_dummy_fs_info() 182 free_extent_buffer_stale(eb); in btrfs_free_dummy_fs_info()
|
/fs/ocfs2/ |
D | alloc.c | 563 struct ocfs2_extent_block *eb); 666 struct ocfs2_extent_block *eb = (struct ocfs2_extent_block *)eb_bh->b_data; in ocfs2_path_insert_eb() local 677 path->p_node[index].el = &eb->h_list; in ocfs2_path_insert_eb() 880 struct ocfs2_extent_block *eb = in ocfs2_validate_extent_block() local 892 rc = ocfs2_validate_meta_ecc(sb, bh->b_data, &eb->h_check); in ocfs2_validate_extent_block() 903 if (!OCFS2_IS_VALID_EXTENT_BLOCK(eb)) { in ocfs2_validate_extent_block() 907 eb->h_signature); in ocfs2_validate_extent_block() 911 if (le64_to_cpu(eb->h_blkno) != bh->b_blocknr) { in ocfs2_validate_extent_block() 915 (unsigned long long)le64_to_cpu(eb->h_blkno)); in ocfs2_validate_extent_block() 919 if (le32_to_cpu(eb->h_fs_generation) != OCFS2_SB(sb)->fs_generation) in ocfs2_validate_extent_block() [all …]
|
D | extent_map.c | 280 struct ocfs2_extent_block *eb; in ocfs2_last_eb_is_empty() local 289 eb = (struct ocfs2_extent_block *) eb_bh->b_data; in ocfs2_last_eb_is_empty() 290 el = &eb->h_list; in ocfs2_last_eb_is_empty() 351 struct ocfs2_extent_block *eb, *next_eb; in ocfs2_figure_hole_clusters() local 356 eb = (struct ocfs2_extent_block *)eb_bh->b_data; in ocfs2_figure_hole_clusters() 362 if (le64_to_cpu(eb->h_next_leaf_blk) == 0ULL) in ocfs2_figure_hole_clusters() 366 le64_to_cpu(eb->h_next_leaf_blk), in ocfs2_figure_hole_clusters() 404 struct ocfs2_extent_block *eb; in ocfs2_get_clusters_nocache() local 425 eb = (struct ocfs2_extent_block *) eb_bh->b_data; in ocfs2_get_clusters_nocache() 426 el = &eb->h_list; in ocfs2_get_clusters_nocache() [all …]
|