Home
last modified time | relevance | path

Searched refs:em (Results 1 – 20 of 20) sorted by relevance

/fs/btrfs/tests/
Dinode-tests.c221 struct extent_map *em = NULL; in test_btrfs_get_extent() local
259 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, 0, sectorsize); in test_btrfs_get_extent()
260 if (IS_ERR(em)) { in test_btrfs_get_extent()
261 em = NULL; in test_btrfs_get_extent()
265 if (em->block_start != EXTENT_MAP_HOLE) { in test_btrfs_get_extent()
266 test_err("expected a hole, got %llu", em->block_start); in test_btrfs_get_extent()
269 free_extent_map(em); in test_btrfs_get_extent()
279 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, 0, (u64)-1); in test_btrfs_get_extent()
280 if (IS_ERR(em)) { in test_btrfs_get_extent()
284 if (em->block_start != EXTENT_MAP_HOLE) { in test_btrfs_get_extent()
[all …]
Dextent-map-tests.c15 struct extent_map *em; in free_extent_map_tree() local
20 em = rb_entry(node, struct extent_map, rb_node); in free_extent_map_tree()
21 remove_extent_mapping(em_tree, em); in free_extent_map_tree()
24 if (refcount_read(&em->refs) != 1) { in free_extent_map_tree()
27 em->start, em->len, em->block_start, in free_extent_map_tree()
28 em->block_len, refcount_read(&em->refs)); in free_extent_map_tree()
30 refcount_set(&em->refs, 1); in free_extent_map_tree()
33 free_extent_map(em); in free_extent_map_tree()
56 struct extent_map *em; in test_case_1() local
61 em = alloc_extent_map(); in test_case_1()
[all …]
/fs/btrfs/
Dextent_map.c52 struct extent_map *em; in alloc_extent_map() local
53 em = kmem_cache_zalloc(extent_map_cache, GFP_NOFS); in alloc_extent_map()
54 if (!em) in alloc_extent_map()
56 RB_CLEAR_NODE(&em->rb_node); in alloc_extent_map()
57 em->flags = 0; in alloc_extent_map()
58 em->compress_type = BTRFS_COMPRESS_NONE; in alloc_extent_map()
59 em->generation = 0; in alloc_extent_map()
60 refcount_set(&em->refs, 1); in alloc_extent_map()
61 INIT_LIST_HEAD(&em->list); in alloc_extent_map()
62 return em; in alloc_extent_map()
[all …]
Dextent_map.h58 static inline int extent_map_in_tree(const struct extent_map *em) in extent_map_in_tree() argument
60 return !RB_EMPTY_NODE(&em->rb_node); in extent_map_in_tree()
63 static inline u64 extent_map_end(struct extent_map *em) in extent_map_end() argument
65 if (em->start + em->len < em->start) in extent_map_end()
67 return em->start + em->len; in extent_map_end()
70 static inline u64 extent_map_block_end(struct extent_map *em) in extent_map_block_end() argument
72 if (em->block_start + em->block_len < em->block_start) in extent_map_block_end()
74 return em->block_start + em->block_len; in extent_map_block_end()
81 struct extent_map *em, int modified);
82 void remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em);
[all …]
Dfile.c528 struct extent_map *em; in btrfs_drop_extent_cache() local
557 em = lookup_extent_mapping(em_tree, start, len); in btrfs_drop_extent_cache()
558 if (!em) { in btrfs_drop_extent_cache()
562 flags = em->flags; in btrfs_drop_extent_cache()
563 gen = em->generation; in btrfs_drop_extent_cache()
564 if (skip_pinned && test_bit(EXTENT_FLAG_PINNED, &em->flags)) { in btrfs_drop_extent_cache()
565 if (testend && em->start + em->len >= start + len) { in btrfs_drop_extent_cache()
566 free_extent_map(em); in btrfs_drop_extent_cache()
570 start = em->start + em->len; in btrfs_drop_extent_cache()
572 len = start + len - (em->start + em->len); in btrfs_drop_extent_cache()
[all …]
Dinode.c855 struct extent_map *em; in submit_compressed_extents() local
933 em = create_io_em(inode, async_extent->start, in submit_compressed_extents()
942 if (IS_ERR(em)) in submit_compressed_extents()
945 free_extent_map(em); in submit_compressed_extents()
1016 struct extent_map *em; in get_extent_allocation_hint() local
1020 em = search_extent_mapping(em_tree, start, num_bytes); in get_extent_allocation_hint()
1021 if (em) { in get_extent_allocation_hint()
1027 if (em->block_start >= EXTENT_MAP_LAST_BYTE) { in get_extent_allocation_hint()
1028 free_extent_map(em); in get_extent_allocation_hint()
1029 em = search_extent_mapping(em_tree, 0, 0); in get_extent_allocation_hint()
[all …]
Dvolumes.c1839 struct extent_map *em; in find_next_chunk() local
1847 em = rb_entry(n, struct extent_map, rb_node); in find_next_chunk()
1848 ret = em->start + em->len; in find_next_chunk()
3059 struct extent_map *em; in btrfs_get_chunk_map() local
3063 em = lookup_extent_mapping(em_tree, logical, length); in btrfs_get_chunk_map()
3066 if (!em) { in btrfs_get_chunk_map()
3073 if (em->start > logical || em->start + em->len <= logical) { in btrfs_get_chunk_map()
3076 logical, logical + length, em->start, em->start + em->len); in btrfs_get_chunk_map()
3077 free_extent_map(em); in btrfs_get_chunk_map()
3082 return em; in btrfs_get_chunk_map()
[all …]
Dextent_io.c2486 struct extent_map *em; in btrfs_get_io_failure_record() local
2518 em = lookup_extent_mapping(em_tree, start, failrec->len); in btrfs_get_io_failure_record()
2519 if (!em) { in btrfs_get_io_failure_record()
2525 if (em->start > start || em->start + em->len <= start) { in btrfs_get_io_failure_record()
2526 free_extent_map(em); in btrfs_get_io_failure_record()
2527 em = NULL; in btrfs_get_io_failure_record()
2530 if (!em) { in btrfs_get_io_failure_record()
2535 logical = start - em->start; in btrfs_get_io_failure_record()
2536 logical = em->block_start + logical; in btrfs_get_io_failure_record()
2537 if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags)) { in btrfs_get_io_failure_record()
[all …]
Dblock-group.c857 u64 group_start, struct extent_map *em) in btrfs_remove_block_group() argument
1088 remove_extent_mapping(em_tree, em); in btrfs_remove_block_group()
1091 free_extent_map(em); in btrfs_remove_block_group()
1107 struct extent_map *em; in btrfs_start_trans_remove_block_group() local
1112 em = lookup_extent_mapping(em_tree, chunk_offset, 1); in btrfs_start_trans_remove_block_group()
1114 ASSERT(em && em->start == chunk_offset); in btrfs_start_trans_remove_block_group()
1135 map = em->map_lookup; in btrfs_start_trans_remove_block_group()
1137 free_extent_map(em); in btrfs_start_trans_remove_block_group()
1636 struct extent_map *em; in read_bg_from_eb() local
1648 em = lookup_extent_mapping(em_tree, key->objectid, key->offset); in read_bg_from_eb()
[all …]
Dfile-item.c1199 struct extent_map *em) in btrfs_extent_item_to_extent_map() argument
1214 em->ram_bytes = btrfs_file_extent_ram_bytes(leaf, fi); in btrfs_extent_item_to_extent_map()
1217 em->start = extent_start; in btrfs_extent_item_to_extent_map()
1218 em->len = extent_end - extent_start; in btrfs_extent_item_to_extent_map()
1219 em->orig_start = extent_start - in btrfs_extent_item_to_extent_map()
1221 em->orig_block_len = btrfs_file_extent_disk_num_bytes(leaf, fi); in btrfs_extent_item_to_extent_map()
1224 em->block_start = EXTENT_MAP_HOLE; in btrfs_extent_item_to_extent_map()
1228 set_bit(EXTENT_FLAG_COMPRESSED, &em->flags); in btrfs_extent_item_to_extent_map()
1229 em->compress_type = compress_type; in btrfs_extent_item_to_extent_map()
1230 em->block_start = bytenr; in btrfs_extent_item_to_extent_map()
[all …]
Dcompression.c553 struct extent_map *em; in add_ra_bio_pages() local
618 em = lookup_extent_mapping(em_tree, last_offset, in add_ra_bio_pages()
622 if (!em || last_offset < em->start || in add_ra_bio_pages()
623 (last_offset + PAGE_SIZE > extent_map_end(em)) || in add_ra_bio_pages()
624 (em->block_start >> 9) != cb->orig_bio->bi_iter.bi_sector) { in add_ra_bio_pages()
625 free_extent_map(em); in add_ra_bio_pages()
631 free_extent_map(em); in add_ra_bio_pages()
687 struct extent_map *em; in btrfs_submit_compressed_read() local
699 em = lookup_extent_mapping(em_tree, file_offset, fs_info->sectorsize); in btrfs_submit_compressed_read()
701 if (!em) in btrfs_submit_compressed_read()
[all …]
Dzoned.c1113 struct extent_map *em; in btrfs_load_block_group_zone_info() local
1139 em = lookup_extent_mapping(em_tree, logical, length); in btrfs_load_block_group_zone_info()
1142 if (!em) in btrfs_load_block_group_zone_info()
1145 map = em->map_lookup; in btrfs_load_block_group_zone_info()
1149 free_extent_map(em); in btrfs_load_block_group_zone_info()
1314 free_extent_map(em); in btrfs_load_block_group_zone_info()
1434 struct extent_map *em; in btrfs_rewrite_logical_zoned() local
1459 em = search_extent_mapping(em_tree, ordered->file_offset, in btrfs_rewrite_logical_zoned()
1461 em->block_start = *logical; in btrfs_rewrite_logical_zoned()
1462 free_extent_map(em); in btrfs_rewrite_logical_zoned()
[all …]
Ddev-replace.c593 struct extent_map *em; in btrfs_finish_block_group_to_copy() local
610 em = btrfs_get_chunk_map(fs_info, chunk_offset, 1); in btrfs_finish_block_group_to_copy()
611 ASSERT(!IS_ERR(em)); in btrfs_finish_block_group_to_copy()
612 map = em->map_lookup; in btrfs_finish_block_group_to_copy()
625 free_extent_map(em); in btrfs_finish_block_group_to_copy()
868 struct extent_map *em; in btrfs_dev_replace_update_device_in_mapping_tree() local
875 em = lookup_extent_mapping(em_tree, start, (u64)-1); in btrfs_dev_replace_update_device_in_mapping_tree()
876 if (!em) in btrfs_dev_replace_update_device_in_mapping_tree()
878 map = em->map_lookup; in btrfs_dev_replace_update_device_in_mapping_tree()
882 start = em->start + em->len; in btrfs_dev_replace_update_device_in_mapping_tree()
[all …]
Dtree-log.c4243 const struct extent_map *em, in log_extent_csums() argument
4249 u64 mod_start = em->mod_start; in log_extent_csums()
4250 u64 mod_len = em->mod_len; in log_extent_csums()
4255 test_bit(EXTENT_FLAG_PREALLOC, &em->flags) || in log_extent_csums()
4256 em->block_start == EXTENT_MAP_HOLE) in log_extent_csums()
4318 if (em->compress_type) { in log_extent_csums()
4320 csum_len = max(em->block_len, em->orig_block_len); in log_extent_csums()
4322 csum_offset = mod_start - em->start; in log_extent_csums()
4328 em->block_start + csum_offset, in log_extent_csums()
4329 em->block_start + csum_offset + in log_extent_csums()
[all …]
Dioctl.c1000 struct extent_map *em = NULL; in check_defrag_in_cache() local
1005 em = lookup_extent_mapping(em_tree, offset, PAGE_SIZE); in check_defrag_in_cache()
1008 if (em) { in check_defrag_in_cache()
1009 end = extent_map_end(em); in check_defrag_in_cache()
1010 free_extent_map(em); in check_defrag_in_cache()
1094 struct extent_map *em; in defrag_lookup_extent() local
1102 em = lookup_extent_mapping(em_tree, start, len); in defrag_lookup_extent()
1105 if (!em) { in defrag_lookup_extent()
1111 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, start, len); in defrag_lookup_extent()
1114 if (IS_ERR(em)) in defrag_lookup_extent()
[all …]
Drelocation.c2928 struct extent_map *em; in setup_extent_mapping() local
2931 em = alloc_extent_map(); in setup_extent_mapping()
2932 if (!em) in setup_extent_mapping()
2935 em->start = start; in setup_extent_mapping()
2936 em->len = end + 1 - start; in setup_extent_mapping()
2937 em->block_len = em->len; in setup_extent_mapping()
2938 em->block_start = block_start; in setup_extent_mapping()
2939 set_bit(EXTENT_FLAG_PINNED, &em->flags); in setup_extent_mapping()
2944 ret = add_extent_mapping(em_tree, em, 0); in setup_extent_mapping()
2947 free_extent_map(em); in setup_extent_mapping()
Dblock-group.h264 u64 group_start, struct extent_map *em);
Dscrub.c3587 struct extent_map *em; in scrub_chunk() local
3592 em = lookup_extent_mapping(map_tree, chunk_offset, 1); in scrub_chunk()
3595 if (!em) { in scrub_chunk()
3608 map = em->map_lookup; in scrub_chunk()
3609 if (em->start != chunk_offset) in scrub_chunk()
3612 if (em->len < length) in scrub_chunk()
3625 free_extent_map(em); in scrub_chunk()
Dctree.h3166 struct extent_map *em);
/fs/ocfs2/
Dextent_map.c48 static void __ocfs2_extent_map_lookup(struct ocfs2_extent_map *em, in __ocfs2_extent_map_lookup() argument
57 list_for_each_entry(emi, &em->em_list, ei_list) { in __ocfs2_extent_map_lookup()
61 list_move(&emi->ei_list, &em->em_list); in __ocfs2_extent_map_lookup()
104 struct ocfs2_extent_map *em = &oi->ip_extent_map; in ocfs2_extent_map_trunc() local
109 list_for_each_entry_safe(emi, n, &em->em_list, ei_list) { in ocfs2_extent_map_trunc()
113 BUG_ON(em->em_num_items == 0); in ocfs2_extent_map_trunc()
114 em->em_num_items--; in ocfs2_extent_map_trunc()
217 struct ocfs2_extent_map *em = &oi->ip_extent_map; in ocfs2_extent_map_insert_rec() local
230 list_for_each_entry(emi, &em->em_list, ei_list) { in ocfs2_extent_map_insert_rec()
232 list_move(&emi->ei_list, &em->em_list); in ocfs2_extent_map_insert_rec()
[all …]