/linux-4.19.296/fs/btrfs/ |
D | locking.c | 15 static void btrfs_assert_tree_read_locked(struct extent_buffer *eb); 22 void btrfs_set_lock_blocking_rw(struct extent_buffer *eb, int rw) in btrfs_set_lock_blocking_rw() argument 30 if (eb->lock_nested && current->pid == eb->lock_owner) in btrfs_set_lock_blocking_rw() 33 if (atomic_read(&eb->blocking_writers) == 0) { in btrfs_set_lock_blocking_rw() 34 WARN_ON(atomic_read(&eb->spinning_writers) != 1); in btrfs_set_lock_blocking_rw() 35 atomic_dec(&eb->spinning_writers); in btrfs_set_lock_blocking_rw() 36 btrfs_assert_tree_locked(eb); in btrfs_set_lock_blocking_rw() 37 atomic_inc(&eb->blocking_writers); in btrfs_set_lock_blocking_rw() 38 write_unlock(&eb->lock); in btrfs_set_lock_blocking_rw() 41 btrfs_assert_tree_read_locked(eb); in btrfs_set_lock_blocking_rw() [all …]
|
D | locking.h | 14 void btrfs_tree_lock(struct extent_buffer *eb); 15 void btrfs_tree_unlock(struct extent_buffer *eb); 17 void btrfs_tree_read_lock(struct extent_buffer *eb); 18 void btrfs_tree_read_unlock(struct extent_buffer *eb); 19 void btrfs_tree_read_unlock_blocking(struct extent_buffer *eb); 20 void btrfs_set_lock_blocking_rw(struct extent_buffer *eb, int rw); 21 void btrfs_clear_lock_blocking_rw(struct extent_buffer *eb, int rw); 22 void btrfs_assert_tree_locked(struct extent_buffer *eb); 23 int btrfs_try_tree_read_lock(struct extent_buffer *eb); 24 int btrfs_try_tree_write_lock(struct extent_buffer *eb); [all …]
|
D | print-tree.c | 10 static void print_chunk(struct extent_buffer *eb, struct btrfs_chunk *chunk) in print_chunk() argument 12 int num_stripes = btrfs_chunk_num_stripes(eb, chunk); in print_chunk() 15 btrfs_chunk_length(eb, chunk), btrfs_chunk_owner(eb, chunk), in print_chunk() 16 btrfs_chunk_type(eb, chunk), num_stripes); in print_chunk() 19 btrfs_stripe_devid_nr(eb, chunk, i), in print_chunk() 20 btrfs_stripe_offset_nr(eb, chunk, i)); in print_chunk() 23 static void print_dev_item(struct extent_buffer *eb, in print_dev_item() argument 27 btrfs_device_id(eb, dev_item), in print_dev_item() 28 btrfs_device_total_bytes(eb, dev_item), in print_dev_item() 29 btrfs_device_bytes_used(eb, dev_item)); in print_dev_item() [all …]
|
D | struct-funcs.c | 39 u##bits btrfs_get_token_##bits(const struct extent_buffer *eb, \ 54 token->eb == eb && \ 61 err = map_private_extent_buffer(eb, offset, size, \ 66 read_extent_buffer(eb, &leres, offset, size); \ 74 token->eb = eb; \ 78 void btrfs_set_token_##bits(struct extent_buffer *eb, \ 93 token->eb == eb && \ 100 err = map_private_extent_buffer(eb, offset, size, \ 106 write_extent_buffer(eb, &val2, offset, size); \ 114 token->eb = eb; \ [all …]
|
D | extent_io.c | 66 struct extent_buffer *eb; in btrfs_leak_debug_check() local 79 eb = list_entry(buffers.next, struct extent_buffer, leak_list); in btrfs_leak_debug_check() 81 eb->start, eb->len, atomic_read(&eb->refs), eb->bflags); in btrfs_leak_debug_check() 82 list_del(&eb->leak_list); in btrfs_leak_debug_check() 83 kmem_cache_free(extent_buffer_cache, eb); in btrfs_leak_debug_check() 2100 struct extent_buffer *eb, int mirror_num) in repair_eb_io_failure() argument 2102 u64 start = eb->start; in repair_eb_io_failure() 2103 int i, num_pages = num_extent_pages(eb); in repair_eb_io_failure() 2110 struct page *p = eb->pages[i]; in repair_eb_io_failure() 2848 static void attach_extent_buffer_page(struct extent_buffer *eb, in attach_extent_buffer_page() argument [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_nr(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 | 27 const struct extent_buffer *eb, in check_extent_in_eb() argument 37 !btrfs_file_extent_compression(eb, fi) && in check_extent_in_eb() 38 !btrfs_file_extent_encryption(eb, fi) && in check_extent_in_eb() 39 !btrfs_file_extent_other_encoding(eb, fi)) { in check_extent_in_eb() 43 data_offset = btrfs_file_extent_offset(eb, fi); in check_extent_in_eb() 44 data_len = btrfs_file_extent_num_bytes(eb, fi); in check_extent_in_eb() 74 static int find_extent_in_eb(const struct extent_buffer *eb, in find_extent_in_eb() argument 92 nritems = btrfs_header_nritems(eb); in find_extent_in_eb() 94 btrfs_item_key_to_cpu(eb, &key, slot); in find_extent_in_eb() 97 fi = btrfs_item_ptr(eb, slot, struct btrfs_file_extent_item); in find_extent_in_eb() [all …]
|
D | extent_io.h | 420 void free_extent_buffer(struct extent_buffer *eb); 421 void free_extent_buffer_stale(struct extent_buffer *eb); 426 struct extent_buffer *eb, int wait, 428 void wait_on_extent_buffer_writeback(struct extent_buffer *eb); 430 static inline int num_extent_pages(const struct extent_buffer *eb) in num_extent_pages() argument 432 return (round_up(eb->start + eb->len, PAGE_SIZE) >> PAGE_SHIFT) - in num_extent_pages() 433 (eb->start >> PAGE_SHIFT); in num_extent_pages() 436 static inline void extent_buffer_get(struct extent_buffer *eb) in extent_buffer_get() argument 438 atomic_inc(&eb->refs); in extent_buffer_get() 441 static inline int extent_buffer_uptodate(struct extent_buffer *eb) in extent_buffer_uptodate() argument [all …]
|
D | relocation.c | 51 struct extent_buffer *eb; member 384 btrfs_tree_unlock(node->eb); in unlock_node_buffer() 391 if (node->eb) { in drop_node_buffer() 393 free_extent_buffer(node->eb); in drop_node_buffer() 394 node->eb = NULL; in drop_node_buffer() 653 struct extent_buffer *eb; in build_backref_tree() local 734 eb = path1->nodes[0]; in build_backref_tree() 737 if (path1->slots[0] >= btrfs_header_nritems(eb)) { in build_backref_tree() 745 eb = path1->nodes[0]; in build_backref_tree() 748 btrfs_item_key_to_cpu(eb, &key, path1->slots[0]); in build_backref_tree() [all …]
|
D | ctree.c | 135 struct extent_buffer *eb; in btrfs_root_node() local 139 eb = rcu_dereference(root->node); in btrfs_root_node() 147 if (atomic_inc_not_zero(&eb->refs)) { in btrfs_root_node() 154 return eb; in btrfs_root_node() 163 struct extent_buffer *eb; in btrfs_lock_root_node() local 166 eb = btrfs_root_node(root); in btrfs_lock_root_node() 167 btrfs_tree_lock(eb); in btrfs_lock_root_node() 168 if (eb == root->node) in btrfs_lock_root_node() 170 btrfs_tree_unlock(eb); in btrfs_lock_root_node() 171 free_extent_buffer(eb); in btrfs_lock_root_node() [all …]
|
D | tree-checker.c | 47 const struct extent_buffer *eb, int slot, in generic_err() argument 60 btrfs_header_level(eb) == 0 ? "leaf" : "node", in generic_err() 61 btrfs_header_owner(eb), btrfs_header_bytenr(eb), slot, &vaf); in generic_err() 72 const struct extent_buffer *eb, int slot, in file_extent_err() argument 79 btrfs_item_key_to_cpu(eb, &key, slot); in file_extent_err() 87 btrfs_header_level(eb) == 0 ? "leaf" : "node", in file_extent_err() 88 btrfs_header_owner(eb), btrfs_header_bytenr(eb), slot, in file_extent_err() 226 const struct extent_buffer *eb, int slot, in dir_item_err() argument 233 btrfs_item_key_to_cpu(eb, &key, slot); in dir_item_err() 241 btrfs_header_level(eb) == 0 ? "leaf" : "node", in dir_item_err() [all …]
|
D | ctree.h | 1478 const struct extent_buffer *eb; member 1499 #define read_eb_member(eb, ptr, type, member, result) (\ argument 1500 read_extent_buffer(eb, (char *)(result), \ 1505 #define write_eb_member(eb, ptr, type, member, result) (\ argument 1506 write_extent_buffer(eb, (char *)(result), \ 1512 u##bits btrfs_get_token_##bits(const struct extent_buffer *eb, \ 1515 void btrfs_set_token_##bits(struct extent_buffer *eb, const void *ptr, \ 1518 static inline u##bits btrfs_get_##bits(const struct extent_buffer *eb, \ 1522 return btrfs_get_token_##bits(eb, ptr, off, NULL); \ 1524 static inline void btrfs_set_##bits(struct extent_buffer *eb, void *ptr,\ [all …]
|
D | dev-replace.c | 37 struct extent_buffer *eb; in btrfs_init_dev_replace() local 89 eb = path->nodes[0]; in btrfs_init_dev_replace() 90 item_size = btrfs_item_size_nr(eb, slot); in btrfs_init_dev_replace() 91 ptr = btrfs_item_ptr(eb, slot, struct btrfs_dev_replace_item); in btrfs_init_dev_replace() 99 src_devid = btrfs_dev_replace_src_devid(eb, ptr); in btrfs_init_dev_replace() 101 btrfs_dev_replace_cont_reading_from_srcdev_mode(eb, ptr); in btrfs_init_dev_replace() 102 dev_replace->replace_state = btrfs_dev_replace_replace_state(eb, ptr); in btrfs_init_dev_replace() 103 dev_replace->time_started = btrfs_dev_replace_time_started(eb, ptr); in btrfs_init_dev_replace() 105 btrfs_dev_replace_time_stopped(eb, ptr); in btrfs_init_dev_replace() 107 btrfs_dev_replace_num_write_errors(eb, ptr)); in btrfs_init_dev_replace() [all …]
|
D | tree-log.c | 279 int (*process_func)(struct btrfs_root *log, struct extent_buffer *eb, 287 struct extent_buffer *eb, in process_one_buffer() argument 298 ret = btrfs_read_buffer(eb, gen, level, NULL); in process_one_buffer() 304 ret = btrfs_pin_extent_for_log_replay(fs_info, eb->start, in process_one_buffer() 305 eb->len); in process_one_buffer() 307 if (!ret && btrfs_buffer_uptodate(eb, gen, 0)) { in process_one_buffer() 308 if (wc->pin && btrfs_header_level(eb) == 0) in process_one_buffer() 309 ret = btrfs_exclude_logged_extents(fs_info, eb); in process_one_buffer() 311 btrfs_write_tree_block(eb); in process_one_buffer() 313 btrfs_wait_tree_block_writeback(eb); in process_one_buffer() [all …]
|
D | disk-io.c | 184 void btrfs_set_buffer_lockdep_class(u64 objectid, struct extent_buffer *eb, in btrfs_set_buffer_lockdep_class() argument 196 lockdep_set_class_and_name(&eb->lock, in btrfs_set_buffer_lockdep_class() 324 struct extent_buffer *eb, u64 parent_transid, in verify_parent_transid() argument 331 if (!parent_transid || btrfs_header_generation(eb) == parent_transid) in verify_parent_transid() 338 btrfs_tree_read_lock(eb); in verify_parent_transid() 339 btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); in verify_parent_transid() 342 lock_extent_bits(io_tree, eb->start, eb->start + eb->len - 1, in verify_parent_transid() 344 if (extent_buffer_uptodate(eb) && in verify_parent_transid() 345 btrfs_header_generation(eb) == parent_transid) { in verify_parent_transid() 349 btrfs_err_rl(eb->fs_info, in verify_parent_transid() [all …]
|
D | reada.c | 94 struct reada_extent *re, struct extent_buffer *eb, in __readahead_hook() argument 127 if (!btrfs_header_level(eb)) in __readahead_hook() 130 nritems = btrfs_header_nritems(eb); in __readahead_hook() 131 generation = btrfs_header_generation(eb); in __readahead_hook() 138 btrfs_node_key_to_cpu(eb, &key, i); in __readahead_hook() 140 btrfs_node_key_to_cpu(eb, &next_key, i + 1); in __readahead_hook() 143 bytenr = btrfs_node_blockptr(eb, i); in __readahead_hook() 144 n_gen = btrfs_node_ptr_generation(eb, i); in __readahead_hook() 197 int btree_readahead_hook(struct extent_buffer *eb, int err) in btree_readahead_hook() argument 199 struct btrfs_fs_info *fs_info = eb->fs_info; in btree_readahead_hook() [all …]
|
D | disk-io.h | 43 struct extent_buffer *eb, int level, 50 int mirror_num, struct extent_buffer **eb); 154 struct extent_buffer *eb, int level); 159 struct extent_buffer *eb, int level) in btrfs_set_buffer_lockdep_class() argument
|
D | send.c | 483 struct extent_buffer *eb, in fs_path_add_from_extent_buffer() argument 493 read_extent_buffer(eb, prepared, off, len); in fs_path_add_from_extent_buffer() 606 struct extent_buffer *eb, in tlv_put_btrfs_timespec() argument 610 read_extent_buffer(eb, &bts, (unsigned long)ts, sizeof(bts)); in tlv_put_btrfs_timespec() 652 #define TLV_PUT_BTRFS_TIMESPEC(sctx, attrtype, eb, ts) \ argument 654 ret = tlv_put_btrfs_timespec(sctx, attrtype, eb, ts); \ 880 struct extent_buffer *eb = path->nodes[0]; in iterate_inode_ref() local 911 ptr = (unsigned long)btrfs_item_ptr(eb, slot, in iterate_inode_ref() 914 total = btrfs_item_size(eb, item); in iterate_inode_ref() 917 ptr = btrfs_item_ptr_offset(eb, slot); in iterate_inode_ref() [all …]
|
D | ref-verify.c | 565 struct extent_buffer *eb; in walk_down_tree() local 579 eb = read_tree_block(fs_info, block_bytenr, gen, in walk_down_tree() 581 if (IS_ERR(eb)) in walk_down_tree() 582 return PTR_ERR(eb); in walk_down_tree() 583 if (!extent_buffer_uptodate(eb)) { in walk_down_tree() 584 free_extent_buffer(eb); in walk_down_tree() 587 btrfs_tree_read_lock(eb); in walk_down_tree() 588 btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); in walk_down_tree() 589 path->nodes[level-1] = eb; in walk_down_tree() 986 struct extent_buffer *eb; in btrfs_build_ref_tree() local [all …]
|
D | root-tree.c | 20 static void btrfs_read_root_item(struct extent_buffer *eb, int slot, in btrfs_read_root_item() argument 27 len = btrfs_item_size_nr(eb, slot); in btrfs_read_root_item() 28 read_extent_buffer(eb, item, btrfs_item_ptr_offset(eb, slot), in btrfs_read_root_item() 35 btrfs_warn(eb->fs_info, in btrfs_read_root_item()
|
/linux-4.19.296/fs/btrfs/tests/ |
D | extent-buffer-tests.c | 17 struct extent_buffer *eb; in test_btrfs_split_item() local 51 path->nodes[0] = eb = alloc_dummy_extent_buffer(fs_info, nodesize); in test_btrfs_split_item() 52 if (!eb) { in test_btrfs_split_item() 66 write_extent_buffer(eb, value, btrfs_item_ptr_offset(eb, 0), in test_btrfs_split_item() 86 btrfs_item_key_to_cpu(eb, &key, 0); in test_btrfs_split_item() 95 if (btrfs_item_size(eb, item) != strlen(split1)) { in test_btrfs_split_item() 101 read_extent_buffer(eb, buf, btrfs_item_ptr_offset(eb, 0), in test_btrfs_split_item() 111 btrfs_item_key_to_cpu(eb, &key, 1); in test_btrfs_split_item() 120 if (btrfs_item_size(eb, item) != strlen(split2)) { in test_btrfs_split_item() 126 read_extent_buffer(eb, buf, btrfs_item_ptr_offset(eb, 1), in test_btrfs_split_item() [all …]
|
D | extent-io-tests.c | 264 static int check_eb_bitmap(unsigned long *bitmap, struct extent_buffer *eb, in check_eb_bitmap() argument 273 bit1 = !!extent_buffer_test_bit(eb, 0, i); in check_eb_bitmap() 279 bit1 = !!extent_buffer_test_bit(eb, i / BITS_PER_BYTE, in check_eb_bitmap() 289 static int __test_eb_bitmaps(unsigned long *bitmap, struct extent_buffer *eb, in __test_eb_bitmaps() argument 297 memzero_extent_buffer(eb, 0, len); in __test_eb_bitmaps() 298 if (memcmp_extent_buffer(eb, bitmap, 0, len) != 0) { in __test_eb_bitmaps() 304 extent_buffer_bitmap_set(eb, 0, 0, len * BITS_PER_BYTE); in __test_eb_bitmaps() 305 ret = check_eb_bitmap(bitmap, eb, len); in __test_eb_bitmaps() 312 extent_buffer_bitmap_clear(eb, 0, 0, len * BITS_PER_BYTE); in __test_eb_bitmaps() 313 ret = check_eb_bitmap(bitmap, eb, len); in __test_eb_bitmaps() [all …]
|
D | btrfs-tests.c | 149 struct extent_buffer *eb; in btrfs_free_dummy_fs_info() local 151 eb = radix_tree_deref_slot_protected(slot, &fs_info->buffer_lock); in btrfs_free_dummy_fs_info() 152 if (!eb) in btrfs_free_dummy_fs_info() 155 if (radix_tree_exception(eb)) { in btrfs_free_dummy_fs_info() 156 if (radix_tree_deref_retry(eb)) in btrfs_free_dummy_fs_info() 162 free_extent_buffer_stale(eb); in btrfs_free_dummy_fs_info()
|
/linux-4.19.296/fs/ocfs2/ |
D | alloc.c | 579 struct ocfs2_extent_block *eb); 682 struct ocfs2_extent_block *eb = (struct ocfs2_extent_block *)eb_bh->b_data; in ocfs2_path_insert_eb() local 693 path->p_node[index].el = &eb->h_list; in ocfs2_path_insert_eb() 896 struct ocfs2_extent_block *eb = in ocfs2_validate_extent_block() local 908 rc = ocfs2_validate_meta_ecc(sb, bh->b_data, &eb->h_check); in ocfs2_validate_extent_block() 919 if (!OCFS2_IS_VALID_EXTENT_BLOCK(eb)) { in ocfs2_validate_extent_block() 923 eb->h_signature); in ocfs2_validate_extent_block() 927 if (le64_to_cpu(eb->h_blkno) != bh->b_blocknr) { in ocfs2_validate_extent_block() 931 (unsigned long long)le64_to_cpu(eb->h_blkno)); in ocfs2_validate_extent_block() 935 if (le32_to_cpu(eb->h_fs_generation) != OCFS2_SB(sb)->fs_generation) in ocfs2_validate_extent_block() [all …]
|
D | extent_map.c | 295 struct ocfs2_extent_block *eb; in ocfs2_last_eb_is_empty() local 304 eb = (struct ocfs2_extent_block *) eb_bh->b_data; in ocfs2_last_eb_is_empty() 305 el = &eb->h_list; in ocfs2_last_eb_is_empty() 366 struct ocfs2_extent_block *eb, *next_eb; in ocfs2_figure_hole_clusters() local 371 eb = (struct ocfs2_extent_block *)eb_bh->b_data; in ocfs2_figure_hole_clusters() 377 if (le64_to_cpu(eb->h_next_leaf_blk) == 0ULL) in ocfs2_figure_hole_clusters() 381 le64_to_cpu(eb->h_next_leaf_blk), in ocfs2_figure_hole_clusters() 419 struct ocfs2_extent_block *eb; in ocfs2_get_clusters_nocache() local 440 eb = (struct ocfs2_extent_block *) eb_bh->b_data; in ocfs2_get_clusters_nocache() 441 el = &eb->h_list; in ocfs2_get_clusters_nocache() [all …]
|