/fs/btrfs/ |
D | locking.c | 27 static void btrfs_assert_tree_read_locked(struct extent_buffer *eb); 34 void btrfs_set_lock_blocking_rw(struct extent_buffer *eb, int rw) in btrfs_set_lock_blocking_rw() argument 42 if (eb->lock_nested && current->pid == eb->lock_owner) in btrfs_set_lock_blocking_rw() 45 if (atomic_read(&eb->blocking_writers) == 0) { in btrfs_set_lock_blocking_rw() 46 WARN_ON(atomic_read(&eb->spinning_writers) != 1); in btrfs_set_lock_blocking_rw() 47 atomic_dec(&eb->spinning_writers); in btrfs_set_lock_blocking_rw() 48 btrfs_assert_tree_locked(eb); in btrfs_set_lock_blocking_rw() 49 atomic_inc(&eb->blocking_writers); in btrfs_set_lock_blocking_rw() 50 write_unlock(&eb->lock); in btrfs_set_lock_blocking_rw() 53 btrfs_assert_tree_read_locked(eb); in btrfs_set_lock_blocking_rw() [all …]
|
D | locking.h | 27 void btrfs_tree_lock(struct extent_buffer *eb); 28 void btrfs_tree_unlock(struct extent_buffer *eb); 30 void btrfs_tree_read_lock(struct extent_buffer *eb); 31 void btrfs_tree_read_unlock(struct extent_buffer *eb); 32 void btrfs_tree_read_unlock_blocking(struct extent_buffer *eb); 33 void btrfs_set_lock_blocking_rw(struct extent_buffer *eb, int rw); 34 void btrfs_clear_lock_blocking_rw(struct extent_buffer *eb, int rw); 35 void btrfs_assert_tree_locked(struct extent_buffer *eb); 36 int btrfs_try_tree_read_lock(struct extent_buffer *eb); 37 int btrfs_try_tree_write_lock(struct extent_buffer *eb); [all …]
|
D | print-tree.c | 23 static void print_chunk(struct extent_buffer *eb, struct btrfs_chunk *chunk) in print_chunk() argument 25 int num_stripes = btrfs_chunk_num_stripes(eb, chunk); in print_chunk() 29 btrfs_chunk_length(eb, chunk), btrfs_chunk_owner(eb, chunk), in print_chunk() 30 btrfs_chunk_type(eb, chunk), num_stripes); in print_chunk() 33 btrfs_stripe_devid_nr(eb, chunk, i), in print_chunk() 34 btrfs_stripe_offset_nr(eb, chunk, i)); in print_chunk() 37 static void print_dev_item(struct extent_buffer *eb, in print_dev_item() argument 42 btrfs_device_id(eb, dev_item), in print_dev_item() 43 btrfs_device_total_bytes(eb, dev_item), in print_dev_item() 44 btrfs_device_bytes_used(eb, dev_item)); in print_dev_item() [all …]
|
D | extent_io.c | 63 struct extent_buffer *eb; in btrfs_leak_debug_check() local 76 eb = list_entry(buffers.next, struct extent_buffer, leak_list); in btrfs_leak_debug_check() 79 eb->start, eb->len, atomic_read(&eb->refs)); in btrfs_leak_debug_check() 80 list_del(&eb->leak_list); in btrfs_leak_debug_check() 81 kmem_cache_free(extent_buffer_cache, eb); in btrfs_leak_debug_check() 2152 int repair_eb_io_failure(struct btrfs_root *root, struct extent_buffer *eb, in repair_eb_io_failure() argument 2155 u64 start = eb->start; in repair_eb_io_failure() 2156 unsigned long i, num_pages = num_extent_pages(eb->start, eb->len); in repair_eb_io_failure() 2163 struct page *p = eb->pages[i]; in repair_eb_io_failure() 2913 static void attach_extent_buffer_page(struct extent_buffer *eb, in attach_extent_buffer_page() argument [all …]
|
D | struct-funcs.c | 53 u##bits btrfs_get_token_##bits(const struct extent_buffer *eb, \ 68 token->eb == eb && \ 75 err = map_private_extent_buffer(eb, offset, size, \ 80 read_extent_buffer(eb, &leres, offset, size); \ 88 token->eb = eb; \ 92 void btrfs_set_token_##bits(struct extent_buffer *eb, \ 107 token->eb == eb && \ 114 err = map_private_extent_buffer(eb, offset, size, \ 120 write_extent_buffer(eb, &val2, offset, size); \ 128 token->eb = eb; \ [all …]
|
D | backref.c | 37 static int check_extent_in_eb(struct btrfs_key *key, struct extent_buffer *eb, in check_extent_in_eb() argument 45 if (!btrfs_file_extent_compression(eb, fi) && in check_extent_in_eb() 46 !btrfs_file_extent_encryption(eb, fi) && in check_extent_in_eb() 47 !btrfs_file_extent_other_encoding(eb, fi)) { in check_extent_in_eb() 51 data_offset = btrfs_file_extent_offset(eb, fi); in check_extent_in_eb() 52 data_len = btrfs_file_extent_num_bytes(eb, fi); in check_extent_in_eb() 82 static int find_extent_in_eb(struct extent_buffer *eb, u64 wanted_disk_byte, in find_extent_in_eb() argument 99 nritems = btrfs_header_nritems(eb); in find_extent_in_eb() 101 btrfs_item_key_to_cpu(eb, &key, slot); in find_extent_in_eb() 104 fi = btrfs_item_ptr(eb, slot, struct btrfs_file_extent_item); in find_extent_in_eb() [all …]
|
D | uuid-tree.c | 39 struct extent_buffer *eb; in btrfs_uuid_tree_lookup() local 65 eb = path->nodes[0]; in btrfs_uuid_tree_lookup() 67 item_size = btrfs_item_size_nr(eb, slot); in btrfs_uuid_tree_lookup() 68 offset = btrfs_item_ptr_offset(eb, slot); in btrfs_uuid_tree_lookup() 79 read_extent_buffer(eb, &data, offset, sizeof(data)); in btrfs_uuid_tree_lookup() 100 struct extent_buffer *eb; in btrfs_uuid_tree_add() local 126 eb = path->nodes[0]; in btrfs_uuid_tree_add() 128 offset = btrfs_item_ptr_offset(eb, slot); in btrfs_uuid_tree_add() 135 eb = path->nodes[0]; in btrfs_uuid_tree_add() 137 offset = btrfs_item_ptr_offset(eb, slot); in btrfs_uuid_tree_add() [all …]
|
D | relocation.c | 62 struct extent_buffer *eb; member 394 btrfs_tree_unlock(node->eb); in unlock_node_buffer() 401 if (node->eb) { in drop_node_buffer() 403 free_extent_buffer(node->eb); in drop_node_buffer() 404 node->eb = NULL; in drop_node_buffer() 686 struct extent_buffer *eb; local 767 eb = path1->nodes[0]; 770 if (path1->slots[0] >= btrfs_header_nritems(eb)) { 778 eb = path1->nodes[0]; 781 btrfs_item_key_to_cpu(eb, &key, path1->slots[0]); [all …]
|
D | ctree.c | 43 struct extent_buffer *eb); 150 struct extent_buffer *eb; in btrfs_root_node() local 154 eb = rcu_dereference(root->node); in btrfs_root_node() 162 if (atomic_inc_not_zero(&eb->refs)) { in btrfs_root_node() 169 return eb; in btrfs_root_node() 178 struct extent_buffer *eb; in btrfs_lock_root_node() local 181 eb = btrfs_root_node(root); in btrfs_lock_root_node() 182 btrfs_tree_lock(eb); in btrfs_lock_root_node() 183 if (eb == root->node) in btrfs_lock_root_node() 185 btrfs_tree_unlock(eb); in btrfs_lock_root_node() [all …]
|
D | extent_io.h | 290 void free_extent_buffer(struct extent_buffer *eb); 291 void free_extent_buffer_stale(struct extent_buffer *eb); 296 struct extent_buffer *eb, u64 start, int wait, 298 void wait_on_extent_buffer_writeback(struct extent_buffer *eb); 306 static inline void extent_buffer_get(struct extent_buffer *eb) in extent_buffer_get() argument 308 atomic_inc(&eb->refs); in extent_buffer_get() 311 int memcmp_extent_buffer(const struct extent_buffer *eb, const void *ptrv, 313 void read_extent_buffer(const struct extent_buffer *eb, void *dst, 316 int read_extent_buffer_to_user_nofault(const struct extent_buffer *eb, 319 void write_extent_buffer(struct extent_buffer *eb, const void *src, [all …]
|
D | tree-checker.c | 36 #define CORRUPT(reason, eb, root, slot) \ argument 39 btrfs_header_level(eb) == 0 ? "leaf" : "node", \ 40 reason, btrfs_header_bytenr(eb), root->objectid, slot) 64 const struct extent_buffer *eb, int slot, in generic_err() argument 77 btrfs_header_level(eb) == 0 ? "leaf" : "node", in generic_err() 78 root->objectid, btrfs_header_bytenr(eb), slot, &vaf); in generic_err() 186 const struct extent_buffer *eb, int slot, in dir_item_err() argument 193 btrfs_item_key_to_cpu(eb, &key, slot); in dir_item_err() 201 btrfs_header_level(eb) == 0 ? "leaf" : "node", root->objectid, in dir_item_err() 202 btrfs_header_bytenr(eb), slot, key.objectid, &vaf); in dir_item_err() [all …]
|
D | ctree.h | 2286 const struct extent_buffer *eb; member 2304 #define read_eb_member(eb, ptr, type, member, result) ( \ argument 2305 read_extent_buffer(eb, (char *)(result), \ 2310 #define write_eb_member(eb, ptr, type, member, result) ( \ argument 2311 write_extent_buffer(eb, (char *)(result), \ 2317 u##bits btrfs_get_token_##bits(const struct extent_buffer *eb, \ 2320 void btrfs_set_token_##bits(struct extent_buffer *eb, const void *ptr, \ 2323 static inline u##bits btrfs_get_##bits(const struct extent_buffer *eb, \ 2327 return btrfs_get_token_##bits(eb, ptr, off, NULL); \ 2329 static inline void btrfs_set_##bits(struct extent_buffer *eb, void *ptr,\ [all …]
|
D | dev-replace.c | 60 struct extent_buffer *eb; in btrfs_init_dev_replace() local 101 eb = path->nodes[0]; in btrfs_init_dev_replace() 102 item_size = btrfs_item_size_nr(eb, slot); in btrfs_init_dev_replace() 103 ptr = btrfs_item_ptr(eb, slot, struct btrfs_dev_replace_item); in btrfs_init_dev_replace() 111 src_devid = btrfs_dev_replace_src_devid(eb, ptr); in btrfs_init_dev_replace() 113 btrfs_dev_replace_cont_reading_from_srcdev_mode(eb, ptr); in btrfs_init_dev_replace() 114 dev_replace->replace_state = btrfs_dev_replace_replace_state(eb, ptr); in btrfs_init_dev_replace() 115 dev_replace->time_started = btrfs_dev_replace_time_started(eb, ptr); in btrfs_init_dev_replace() 117 btrfs_dev_replace_time_stopped(eb, ptr); in btrfs_init_dev_replace() 119 btrfs_dev_replace_num_write_errors(eb, ptr)); in btrfs_init_dev_replace() [all …]
|
D | disk-io.c | 196 void btrfs_set_buffer_lockdep_class(u64 objectid, struct extent_buffer *eb, in btrfs_set_buffer_lockdep_class() argument 208 lockdep_set_class_and_name(&eb->lock, in btrfs_set_buffer_lockdep_class() 347 struct extent_buffer *eb, u64 parent_transid, in verify_parent_transid() argument 354 if (!parent_transid || btrfs_header_generation(eb) == parent_transid) in verify_parent_transid() 361 btrfs_tree_read_lock(eb); in verify_parent_transid() 362 btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); in verify_parent_transid() 365 lock_extent_bits(io_tree, eb->start, eb->start + eb->len - 1, in verify_parent_transid() 367 if (extent_buffer_uptodate(eb) && in verify_parent_transid() 368 btrfs_header_generation(eb) == parent_transid) { in verify_parent_transid() 372 btrfs_err_rl(eb->fs_info, in verify_parent_transid() [all …]
|
D | tree-log.c | 283 int (*process_func)(struct btrfs_root *log, struct extent_buffer *eb, 291 struct extent_buffer *eb, in process_one_buffer() argument 301 ret = btrfs_read_buffer(eb, gen); in process_one_buffer() 308 eb->start, eb->len); in process_one_buffer() 310 if (!ret && btrfs_buffer_uptodate(eb, gen, 0)) { in process_one_buffer() 311 if (wc->pin && btrfs_header_level(eb) == 0) in process_one_buffer() 312 ret = btrfs_exclude_logged_extents(log, eb); in process_one_buffer() 314 btrfs_write_tree_block(eb); in process_one_buffer() 316 btrfs_wait_tree_block_writeback(eb); in process_one_buffer() 338 struct extent_buffer *eb, int slot, in overwrite_item() argument [all …]
|
D | reada.c | 108 static int __readahead_hook(struct btrfs_root *root, struct extent_buffer *eb, in __readahead_hook() argument 122 if (eb) in __readahead_hook() 123 level = btrfs_header_level(eb); in __readahead_hook() 146 nritems = level ? btrfs_header_nritems(eb) : 0; in __readahead_hook() 147 generation = btrfs_header_generation(eb); in __readahead_hook() 171 btrfs_node_key_to_cpu(eb, &key, i); in __readahead_hook() 173 btrfs_node_key_to_cpu(eb, &next_key, i + 1); in __readahead_hook() 176 bytenr = btrfs_node_blockptr(eb, i); in __readahead_hook() 177 n_gen = btrfs_node_ptr_generation(eb, i); in __readahead_hook() 236 int btree_readahead_hook(struct btrfs_root *root, struct extent_buffer *eb, in btree_readahead_hook() argument [all …]
|
D | send.c | 453 struct extent_buffer *eb, in fs_path_add_from_extent_buffer() argument 463 read_extent_buffer(eb, prepared, off, len); in fs_path_add_from_extent_buffer() 586 struct extent_buffer *eb, in tlv_put_btrfs_timespec() argument 590 read_extent_buffer(eb, &bts, (unsigned long)ts, sizeof(bts)); in tlv_put_btrfs_timespec() 632 #define TLV_PUT_BTRFS_TIMESPEC(sctx, attrtype, eb, ts) \ argument 634 ret = tlv_put_btrfs_timespec(sctx, attrtype, eb, ts); \ 856 struct extent_buffer *eb = path->nodes[0]; in iterate_inode_ref() local 887 ptr = (unsigned long)btrfs_item_ptr(eb, slot, in iterate_inode_ref() 890 total = btrfs_item_size(eb, item); in iterate_inode_ref() 893 ptr = btrfs_item_ptr_offset(eb, slot); in iterate_inode_ref() [all …]
|
D | disk-io.h | 51 int mirror_num, struct extent_buffer **eb); 155 struct extent_buffer *eb, int level); 160 struct extent_buffer *eb, int level) in btrfs_set_buffer_lockdep_class() argument
|
D | root-tree.c | 33 static void btrfs_read_root_item(struct extent_buffer *eb, int slot, in btrfs_read_root_item() argument 40 len = btrfs_item_size_nr(eb, slot); in btrfs_read_root_item() 41 read_extent_buffer(eb, item, btrfs_item_ptr_offset(eb, slot), in btrfs_read_root_item() 48 btrfs_warn(eb->fs_info, in btrfs_read_root_item()
|
D | extent-tree.c | 6102 struct extent_buffer *eb) in btrfs_exclude_logged_extents() argument 6112 for (i = 0; i < btrfs_header_nritems(eb); i++) { in btrfs_exclude_logged_extents() 6113 btrfs_item_key_to_cpu(eb, &key, i); in btrfs_exclude_logged_extents() 6116 item = btrfs_item_ptr(eb, i, struct btrfs_file_extent_item); in btrfs_exclude_logged_extents() 6117 found_type = btrfs_file_extent_type(eb, item); in btrfs_exclude_logged_extents() 6120 if (btrfs_file_extent_disk_bytenr(eb, item) == 0) in btrfs_exclude_logged_extents() 6122 key.objectid = btrfs_file_extent_disk_bytenr(eb, item); in btrfs_exclude_logged_extents() 6123 key.offset = btrfs_file_extent_disk_num_bytes(eb, item); in btrfs_exclude_logged_extents() 8077 struct extent_buffer *eb; in reada_walk_down() local 8091 eb = path->nodes[wc->level]; in reada_walk_down() [all …]
|
/fs/btrfs/tests/ |
D | extent-buffer-tests.c | 29 struct extent_buffer *eb; in test_btrfs_split_item() local 56 path->nodes[0] = eb = alloc_dummy_extent_buffer(NULL, 4096); in test_btrfs_split_item() 57 if (!eb) { in test_btrfs_split_item() 71 write_extent_buffer(eb, value, btrfs_item_ptr_offset(eb, 0), in test_btrfs_split_item() 91 btrfs_item_key_to_cpu(eb, &key, 0); in test_btrfs_split_item() 100 if (btrfs_item_size(eb, item) != strlen(split1)) { in test_btrfs_split_item() 106 read_extent_buffer(eb, buf, btrfs_item_ptr_offset(eb, 0), in test_btrfs_split_item() 116 btrfs_item_key_to_cpu(eb, &key, 1); in test_btrfs_split_item() 125 if (btrfs_item_size(eb, item) != strlen(split2)) { in test_btrfs_split_item() 131 read_extent_buffer(eb, buf, btrfs_item_ptr_offset(eb, 1), in test_btrfs_split_item() [all …]
|
D | btrfs-tests.c | 141 struct extent_buffer *eb; in btrfs_free_dummy_fs_info() local 143 eb = radix_tree_deref_slot_protected(slot, &fs_info->buffer_lock); in btrfs_free_dummy_fs_info() 144 if (!eb) in btrfs_free_dummy_fs_info() 147 if (radix_tree_exception(eb)) { in btrfs_free_dummy_fs_info() 148 if (radix_tree_deref_retry(eb)) in btrfs_free_dummy_fs_info() 153 free_extent_buffer_stale(eb); in btrfs_free_dummy_fs_info()
|
/fs/ocfs2/ |
D | alloc.c | 570 struct ocfs2_extent_block *eb); 673 struct ocfs2_extent_block *eb = (struct ocfs2_extent_block *)eb_bh->b_data; in ocfs2_path_insert_eb() local 684 path->p_node[index].el = &eb->h_list; in ocfs2_path_insert_eb() 887 struct ocfs2_extent_block *eb = in ocfs2_validate_extent_block() local 899 rc = ocfs2_validate_meta_ecc(sb, bh->b_data, &eb->h_check); in ocfs2_validate_extent_block() 910 if (!OCFS2_IS_VALID_EXTENT_BLOCK(eb)) { in ocfs2_validate_extent_block() 914 eb->h_signature); in ocfs2_validate_extent_block() 918 if (le64_to_cpu(eb->h_blkno) != bh->b_blocknr) { in ocfs2_validate_extent_block() 922 (unsigned long long)le64_to_cpu(eb->h_blkno)); in ocfs2_validate_extent_block() 926 if (le32_to_cpu(eb->h_fs_generation) != OCFS2_SB(sb)->fs_generation) { in ocfs2_validate_extent_block() [all …]
|
D | extent_map.c | 294 struct ocfs2_extent_block *eb; in ocfs2_last_eb_is_empty() local 303 eb = (struct ocfs2_extent_block *) eb_bh->b_data; in ocfs2_last_eb_is_empty() 304 el = &eb->h_list; in ocfs2_last_eb_is_empty() 365 struct ocfs2_extent_block *eb, *next_eb; in ocfs2_figure_hole_clusters() local 370 eb = (struct ocfs2_extent_block *)eb_bh->b_data; in ocfs2_figure_hole_clusters() 376 if (le64_to_cpu(eb->h_next_leaf_blk) == 0ULL) in ocfs2_figure_hole_clusters() 380 le64_to_cpu(eb->h_next_leaf_blk), in ocfs2_figure_hole_clusters() 418 struct ocfs2_extent_block *uninitialized_var(eb); in ocfs2_get_clusters_nocache() 439 eb = (struct ocfs2_extent_block *) eb_bh->b_data; in ocfs2_get_clusters_nocache() 440 el = &eb->h_list; in ocfs2_get_clusters_nocache() [all …]
|
D | refcounttree.c | 966 struct ocfs2_extent_block *eb, in ocfs2_get_refcount_cpos_end() argument 987 if (!eb || (eb && !eb->h_next_leaf_blk)) { in ocfs2_get_refcount_cpos_end() 1011 cpos = le32_to_cpu(eb->h_list.l_recs[index].e_cpos); in ocfs2_get_refcount_cpos_end() 1075 struct ocfs2_extent_block *eb = NULL; in ocfs2_get_refcount_rec() local 1099 eb = (struct ocfs2_extent_block *) eb_bh->b_data; in ocfs2_get_refcount_rec() 1100 el = &eb->h_list; in ocfs2_get_refcount_rec() 1123 eb, el, i, &cpos_end); in ocfs2_get_refcount_rec() 2648 struct ocfs2_extent_block *eb = NULL; in ocfs2_refcount_cal_cow_clusters() local 2663 eb = (struct ocfs2_extent_block *) eb_bh->b_data; in ocfs2_refcount_cal_cow_clusters() 2664 el = &eb->h_list; in ocfs2_refcount_cal_cow_clusters() [all …]
|