Home
last modified time | relevance | path

Searched refs:eb (Results 1 – 25 of 35) sorted by relevance

12

/fs/btrfs/
Dlocking.c17 static void btrfs_assert_spinning_writers_get(struct extent_buffer *eb) in btrfs_assert_spinning_writers_get() argument
19 WARN_ON(eb->spinning_writers); in btrfs_assert_spinning_writers_get()
20 eb->spinning_writers++; in btrfs_assert_spinning_writers_get()
23 static void btrfs_assert_spinning_writers_put(struct extent_buffer *eb) in btrfs_assert_spinning_writers_put() argument
25 WARN_ON(eb->spinning_writers != 1); in btrfs_assert_spinning_writers_put()
26 eb->spinning_writers--; in btrfs_assert_spinning_writers_put()
29 static void btrfs_assert_no_spinning_writers(struct extent_buffer *eb) in btrfs_assert_no_spinning_writers() argument
31 WARN_ON(eb->spinning_writers); in btrfs_assert_no_spinning_writers()
34 static void btrfs_assert_spinning_readers_get(struct extent_buffer *eb) in btrfs_assert_spinning_readers_get() argument
36 atomic_inc(&eb->spinning_readers); in btrfs_assert_spinning_readers_get()
[all …]
Dprint-tree.c10 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 …]
Dlocking.h14 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_read(struct extent_buffer *eb);
21 void btrfs_set_lock_blocking_write(struct extent_buffer *eb);
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 …]
Dextent_io.c66 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()
2259 int btrfs_repair_eb_io_failure(struct extent_buffer *eb, int mirror_num) in btrfs_repair_eb_io_failure() argument
2261 struct btrfs_fs_info *fs_info = eb->fs_info; in btrfs_repair_eb_io_failure()
2262 u64 start = eb->start; in btrfs_repair_eb_io_failure()
2263 int i, num_pages = num_extent_pages(eb); in btrfs_repair_eb_io_failure()
2270 struct page *p = eb->pages[i]; in btrfs_repair_eb_io_failure()
[all …]
Dstruct-funcs.c41 u##bits btrfs_get_token_##bits(const struct extent_buffer *eb, \
56 ASSERT(token->eb == eb); \
65 err = map_private_extent_buffer(eb, offset, size, \
70 read_extent_buffer(eb, &leres, offset, size); \
79 u##bits btrfs_get_##bits(const struct extent_buffer *eb, \
92 err = map_private_extent_buffer(eb, offset, size, \
97 read_extent_buffer(eb, &leres, offset, size); \
104 void btrfs_set_token_##bits(struct extent_buffer *eb, \
119 ASSERT(token->eb == eb); \
128 err = map_private_extent_buffer(eb, offset, size, \
[all …]
Dbackref.c27 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 …]
Duuid-tree.c27 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 …]
Dextent_io.h432 void free_extent_buffer(struct extent_buffer *eb);
433 void free_extent_buffer_stale(struct extent_buffer *eb);
437 int read_extent_buffer_pages(struct extent_buffer *eb, int wait,
439 void wait_on_extent_buffer_writeback(struct extent_buffer *eb);
441 static inline int num_extent_pages(const struct extent_buffer *eb) in num_extent_pages() argument
443 return (round_up(eb->start + eb->len, PAGE_SIZE) >> PAGE_SHIFT) - in num_extent_pages()
444 (eb->start >> PAGE_SHIFT); in num_extent_pages()
447 static inline void extent_buffer_get(struct extent_buffer *eb) in extent_buffer_get() argument
449 atomic_inc(&eb->refs); in extent_buffer_get()
452 static inline int extent_buffer_uptodate(struct extent_buffer *eb) in extent_buffer_uptodate() argument
[all …]
Drelocation.c53 struct extent_buffer *eb; member
388 btrfs_tree_unlock(node->eb); in unlock_node_buffer()
395 if (node->eb) { in drop_node_buffer()
397 free_extent_buffer(node->eb); in drop_node_buffer()
398 node->eb = NULL; in drop_node_buffer()
689 struct extent_buffer *eb; in build_backref_tree() local
770 eb = path1->nodes[0]; in build_backref_tree()
773 if (path1->slots[0] >= btrfs_header_nritems(eb)) { in build_backref_tree()
781 eb = path1->nodes[0]; in build_backref_tree()
784 btrfs_item_key_to_cpu(eb, &key, path1->slots[0]); in build_backref_tree()
[all …]
Dctree.h1296 const struct extent_buffer *eb; member
1305 struct extent_buffer *eb) in btrfs_init_map_token() argument
1307 token->eb = eb; in btrfs_init_map_token()
1319 #define read_eb_member(eb, ptr, type, member, result) (\ argument
1320 read_extent_buffer(eb, (char *)(result), \
1325 #define write_eb_member(eb, ptr, type, member, result) (\ argument
1326 write_extent_buffer(eb, (char *)(result), \
1332 u##bits btrfs_get_token_##bits(const struct extent_buffer *eb, \
1335 void btrfs_set_token_##bits(struct extent_buffer *eb, const void *ptr, \
1338 u##bits btrfs_get_##bits(const struct extent_buffer *eb, \
[all …]
Dctree.c128 struct extent_buffer *eb; in btrfs_root_node() local
132 eb = rcu_dereference(root->node); in btrfs_root_node()
140 if (atomic_inc_not_zero(&eb->refs)) { in btrfs_root_node()
147 return eb; in btrfs_root_node()
156 struct extent_buffer *eb; in btrfs_lock_root_node() local
159 eb = btrfs_root_node(root); in btrfs_lock_root_node()
160 btrfs_tree_lock(eb); in btrfs_lock_root_node()
161 if (eb == root->node) in btrfs_lock_root_node()
163 btrfs_tree_unlock(eb); in btrfs_lock_root_node()
164 free_extent_buffer(eb); in btrfs_lock_root_node()
[all …]
Dtree-checker.c49 static void generic_err(const struct extent_buffer *eb, int slot, in generic_err() argument
52 const struct btrfs_fs_info *fs_info = eb->fs_info; in generic_err()
63 btrfs_header_level(eb) == 0 ? "leaf" : "node", in generic_err()
64 btrfs_header_owner(eb), btrfs_header_bytenr(eb), slot, &vaf); in generic_err()
74 static void file_extent_err(const struct extent_buffer *eb, int slot, in file_extent_err() argument
77 const struct btrfs_fs_info *fs_info = eb->fs_info; in file_extent_err()
82 btrfs_item_key_to_cpu(eb, &key, slot); in file_extent_err()
90 btrfs_header_level(eb) == 0 ? "leaf" : "node", in file_extent_err()
91 btrfs_header_owner(eb), btrfs_header_bytenr(eb), slot, in file_extent_err()
293 static void dir_item_err(const struct extent_buffer *eb, int slot, in dir_item_err() argument
[all …]
Ddev-replace.c38 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 …]
Ddisk-io.c182 void btrfs_set_buffer_lockdep_class(u64 objectid, struct extent_buffer *eb, in btrfs_set_buffer_lockdep_class() argument
194 lockdep_set_class_and_name(&eb->lock, in btrfs_set_buffer_lockdep_class()
302 struct extent_buffer *eb, u64 parent_transid, in verify_parent_transid() argument
309 if (!parent_transid || btrfs_header_generation(eb) == parent_transid) in verify_parent_transid()
316 btrfs_tree_read_lock(eb); in verify_parent_transid()
317 btrfs_set_lock_blocking_read(eb); in verify_parent_transid()
320 lock_extent_bits(io_tree, eb->start, eb->start + eb->len - 1, in verify_parent_transid()
322 if (extent_buffer_uptodate(eb) && in verify_parent_transid()
323 btrfs_header_generation(eb) == parent_transid) { in verify_parent_transid()
327 btrfs_err_rl(eb->fs_info, in verify_parent_transid()
[all …]
Dtree-log.c293 int (*process_func)(struct btrfs_root *log, struct extent_buffer *eb,
301 struct extent_buffer *eb, in process_one_buffer() argument
312 ret = btrfs_read_buffer(eb, gen, level, NULL); in process_one_buffer()
318 ret = btrfs_pin_extent_for_log_replay(fs_info, eb->start, in process_one_buffer()
319 eb->len); in process_one_buffer()
321 if (!ret && btrfs_buffer_uptodate(eb, gen, 0)) { in process_one_buffer()
322 if (wc->pin && btrfs_header_level(eb) == 0) in process_one_buffer()
323 ret = btrfs_exclude_logged_extents(eb); in process_one_buffer()
325 btrfs_write_tree_block(eb); in process_one_buffer()
327 btrfs_wait_tree_block_writeback(eb); in process_one_buffer()
[all …]
Dreada.c95 struct reada_extent *re, struct extent_buffer *eb, in __readahead_hook() argument
128 if (!btrfs_header_level(eb)) in __readahead_hook()
131 nritems = btrfs_header_nritems(eb); in __readahead_hook()
132 generation = btrfs_header_generation(eb); in __readahead_hook()
139 btrfs_node_key_to_cpu(eb, &key, i); in __readahead_hook()
141 btrfs_node_key_to_cpu(eb, &next_key, i + 1); in __readahead_hook()
144 bytenr = btrfs_node_blockptr(eb, i); in __readahead_hook()
145 n_gen = btrfs_node_ptr_generation(eb, i); in __readahead_hook()
198 int btree_readahead_hook(struct extent_buffer *eb, int err) in btree_readahead_hook() argument
200 struct btrfs_fs_info *fs_info = eb->fs_info; in btree_readahead_hook()
[all …]
Dqgroup.c1794 struct extent_buffer *eb) in btrfs_qgroup_trace_leaf_items() argument
1797 int nr = btrfs_header_nritems(eb); in btrfs_qgroup_trace_leaf_items()
1808 btrfs_item_key_to_cpu(eb, &key, i); in btrfs_qgroup_trace_leaf_items()
1813 fi = btrfs_item_ptr(eb, i, struct btrfs_file_extent_item); in btrfs_qgroup_trace_leaf_items()
1815 extent_type = btrfs_file_extent_type(eb, fi); in btrfs_qgroup_trace_leaf_items()
1820 bytenr = btrfs_file_extent_disk_bytenr(eb, fi); in btrfs_qgroup_trace_leaf_items()
1824 num_bytes = btrfs_file_extent_disk_num_bytes(eb, fi); in btrfs_qgroup_trace_leaf_items()
1853 struct extent_buffer *eb; in adjust_slots_upwards() local
1859 eb = path->nodes[level]; in adjust_slots_upwards()
1860 nr = btrfs_header_nritems(eb); in adjust_slots_upwards()
[all …]
Dsend.c498 struct extent_buffer *eb, in fs_path_add_from_extent_buffer() argument
508 read_extent_buffer(eb, prepared, off, len); in fs_path_add_from_extent_buffer()
621 struct extent_buffer *eb, in tlv_put_btrfs_timespec() argument
625 read_extent_buffer(eb, &bts, (unsigned long)ts, sizeof(bts)); in tlv_put_btrfs_timespec()
667 #define TLV_PUT_BTRFS_TIMESPEC(sctx, attrtype, eb, ts) \ argument
669 ret = tlv_put_btrfs_timespec(sctx, attrtype, eb, ts); \
895 struct extent_buffer *eb = path->nodes[0]; in iterate_inode_ref() local
926 ptr = (unsigned long)btrfs_item_ptr(eb, slot, in iterate_inode_ref()
929 total = btrfs_item_size(eb, item); in iterate_inode_ref()
932 ptr = btrfs_item_ptr_offset(eb, slot); in iterate_inode_ref()
[all …]
Dref-verify.c555 struct extent_buffer *eb; in walk_down_tree() local
569 eb = read_tree_block(fs_info, block_bytenr, gen, in walk_down_tree()
571 if (IS_ERR(eb)) in walk_down_tree()
572 return PTR_ERR(eb); in walk_down_tree()
573 if (!extent_buffer_uptodate(eb)) { in walk_down_tree()
574 free_extent_buffer(eb); in walk_down_tree()
577 btrfs_tree_read_lock(eb); in walk_down_tree()
578 btrfs_set_lock_blocking_read(eb); in walk_down_tree()
579 path->nodes[level-1] = eb; in walk_down_tree()
985 struct extent_buffer *eb; in btrfs_build_ref_tree() local
[all …]
Dextent-tree.c389 int btrfs_get_extent_inline_ref_type(const struct extent_buffer *eb, in btrfs_get_extent_inline_ref_type() argument
393 int type = btrfs_extent_inline_ref_type(eb, iref); in btrfs_get_extent_inline_ref_type()
394 u64 offset = btrfs_extent_inline_ref_offset(eb, iref); in btrfs_get_extent_inline_ref_type()
404 ASSERT(eb->fs_info); in btrfs_get_extent_inline_ref_type()
410 IS_ALIGNED(offset, eb->fs_info->sectorsize)) in btrfs_get_extent_inline_ref_type()
417 ASSERT(eb->fs_info); in btrfs_get_extent_inline_ref_type()
423 IS_ALIGNED(offset, eb->fs_info->sectorsize)) in btrfs_get_extent_inline_ref_type()
432 btrfs_print_leaf((struct extent_buffer *)eb); in btrfs_get_extent_inline_ref_type()
433 btrfs_err(eb->fs_info, in btrfs_get_extent_inline_ref_type()
435 eb->start, (unsigned long)iref, type); in btrfs_get_extent_inline_ref_type()
[all …]
/fs/btrfs/tests/
Dextent-buffer-tests.c17 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 …]
Dextent-io-tests.c271 static int check_eb_bitmap(unsigned long *bitmap, struct extent_buffer *eb, in check_eb_bitmap() argument
280 bit1 = !!extent_buffer_test_bit(eb, 0, i); in check_eb_bitmap()
286 bit1 = !!extent_buffer_test_bit(eb, i / BITS_PER_BYTE, in check_eb_bitmap()
296 static int __test_eb_bitmaps(unsigned long *bitmap, struct extent_buffer *eb, in __test_eb_bitmaps() argument
304 memzero_extent_buffer(eb, 0, len); in __test_eb_bitmaps()
305 if (memcmp_extent_buffer(eb, bitmap, 0, len) != 0) { in __test_eb_bitmaps()
311 extent_buffer_bitmap_set(eb, 0, 0, len * BITS_PER_BYTE); in __test_eb_bitmaps()
312 ret = check_eb_bitmap(bitmap, eb, len); in __test_eb_bitmaps()
319 extent_buffer_bitmap_clear(eb, 0, 0, len * BITS_PER_BYTE); in __test_eb_bitmaps()
320 ret = check_eb_bitmap(bitmap, eb, len); in __test_eb_bitmaps()
[all …]
Dbtrfs-tests.c164 struct extent_buffer *eb; in btrfs_free_dummy_fs_info() local
166 eb = radix_tree_deref_slot_protected(slot, &fs_info->buffer_lock); in btrfs_free_dummy_fs_info()
167 if (!eb) in btrfs_free_dummy_fs_info()
170 if (radix_tree_exception(eb)) { in btrfs_free_dummy_fs_info()
171 if (radix_tree_deref_retry(eb)) in btrfs_free_dummy_fs_info()
177 free_extent_buffer_stale(eb); in btrfs_free_dummy_fs_info()
/fs/ocfs2/
Dalloc.c565 struct ocfs2_extent_block *eb);
668 struct ocfs2_extent_block *eb = (struct ocfs2_extent_block *)eb_bh->b_data; in ocfs2_path_insert_eb() local
679 path->p_node[index].el = &eb->h_list; in ocfs2_path_insert_eb()
882 struct ocfs2_extent_block *eb = in ocfs2_validate_extent_block() local
894 rc = ocfs2_validate_meta_ecc(sb, bh->b_data, &eb->h_check); in ocfs2_validate_extent_block()
905 if (!OCFS2_IS_VALID_EXTENT_BLOCK(eb)) { in ocfs2_validate_extent_block()
909 eb->h_signature); in ocfs2_validate_extent_block()
913 if (le64_to_cpu(eb->h_blkno) != bh->b_blocknr) { in ocfs2_validate_extent_block()
917 (unsigned long long)le64_to_cpu(eb->h_blkno)); in ocfs2_validate_extent_block()
921 if (le32_to_cpu(eb->h_fs_generation) != OCFS2_SB(sb)->fs_generation) in ocfs2_validate_extent_block()
[all …]
Dextent_map.c282 struct ocfs2_extent_block *eb; in ocfs2_last_eb_is_empty() local
291 eb = (struct ocfs2_extent_block *) eb_bh->b_data; in ocfs2_last_eb_is_empty()
292 el = &eb->h_list; in ocfs2_last_eb_is_empty()
353 struct ocfs2_extent_block *eb, *next_eb; in ocfs2_figure_hole_clusters() local
358 eb = (struct ocfs2_extent_block *)eb_bh->b_data; in ocfs2_figure_hole_clusters()
364 if (le64_to_cpu(eb->h_next_leaf_blk) == 0ULL) in ocfs2_figure_hole_clusters()
368 le64_to_cpu(eb->h_next_leaf_blk), in ocfs2_figure_hole_clusters()
406 struct ocfs2_extent_block *eb; in ocfs2_get_clusters_nocache() local
427 eb = (struct ocfs2_extent_block *) eb_bh->b_data; in ocfs2_get_clusters_nocache()
428 el = &eb->h_list; in ocfs2_get_clusters_nocache()
[all …]

12