/fs/btrfs/ |
D | extent_map.c | 50 struct extent_map *em; in alloc_extent_map() local 51 em = kmem_cache_zalloc(extent_map_cache, GFP_NOFS); in alloc_extent_map() 52 if (!em) in alloc_extent_map() 54 em->in_tree = 0; in alloc_extent_map() 55 em->flags = 0; in alloc_extent_map() 56 em->compress_type = BTRFS_COMPRESS_NONE; in alloc_extent_map() 57 em->generation = 0; in alloc_extent_map() 58 atomic_set(&em->refs, 1); in alloc_extent_map() 59 INIT_LIST_HEAD(&em->list); in alloc_extent_map() 60 return em; in alloc_extent_map() [all …]
|
D | extent_map.h | 47 static inline u64 extent_map_end(struct extent_map *em) in extent_map_end() argument 49 if (em->start + em->len < em->start) in extent_map_end() 51 return em->start + em->len; in extent_map_end() 54 static inline u64 extent_map_block_end(struct extent_map *em) in extent_map_block_end() argument 56 if (em->block_start + em->block_len < em->block_start) in extent_map_block_end() 58 return em->block_start + em->block_len; in extent_map_block_end() 65 struct extent_map *em, int modified); 66 int remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em); 69 void free_extent_map(struct extent_map *em); 73 void clear_em_logging(struct extent_map_tree *tree, struct extent_map *em);
|
D | file.c | 546 struct extent_map *em; in btrfs_drop_extent_cache() local 575 em = lookup_extent_mapping(em_tree, start, len); in btrfs_drop_extent_cache() 576 if (!em) { in btrfs_drop_extent_cache() 580 flags = em->flags; in btrfs_drop_extent_cache() 581 gen = em->generation; in btrfs_drop_extent_cache() 582 if (skip_pinned && test_bit(EXTENT_FLAG_PINNED, &em->flags)) { in btrfs_drop_extent_cache() 583 if (testend && em->start + em->len >= start + len) { in btrfs_drop_extent_cache() 584 free_extent_map(em); in btrfs_drop_extent_cache() 588 start = em->start + em->len; in btrfs_drop_extent_cache() 590 len = start + len - (em->start + em->len); in btrfs_drop_extent_cache() [all …]
|
D | inode.c | 620 struct extent_map *em; in submit_compressed_extents() local 717 em = alloc_extent_map(); in submit_compressed_extents() 718 if (!em) { in submit_compressed_extents() 722 em->start = async_extent->start; in submit_compressed_extents() 723 em->len = async_extent->ram_size; in submit_compressed_extents() 724 em->orig_start = em->start; in submit_compressed_extents() 725 em->mod_start = em->start; in submit_compressed_extents() 726 em->mod_len = em->len; in submit_compressed_extents() 728 em->block_start = ins.objectid; in submit_compressed_extents() 729 em->block_len = ins.offset; in submit_compressed_extents() [all …]
|
D | volumes.c | 2370 struct extent_map *em; in btrfs_relocate_chunk() local 2402 em = lookup_extent_mapping(em_tree, chunk_offset, 1); in btrfs_relocate_chunk() 2405 BUG_ON(!em || em->start > chunk_offset || in btrfs_relocate_chunk() 2406 em->start + em->len < chunk_offset); in btrfs_relocate_chunk() 2407 map = (struct map_lookup *)em->bdev; in btrfs_relocate_chunk() 2424 trace_btrfs_chunk_free(root, map, chunk_offset, em->len); in btrfs_relocate_chunk() 2435 remove_extent_mapping(em_tree, em); in btrfs_relocate_chunk() 2439 em->bdev = NULL; in btrfs_relocate_chunk() 2442 free_extent_map(em); in btrfs_relocate_chunk() 2444 free_extent_map(em); in btrfs_relocate_chunk() [all …]
|
D | extent_io.c | 2180 struct extent_map *em; in bio_readpage_error() local 2205 em = lookup_extent_mapping(em_tree, start, failrec->len); in bio_readpage_error() 2206 if (!em) { in bio_readpage_error() 2212 if (em->start > start || em->start + em->len < start) { in bio_readpage_error() 2213 free_extent_map(em); in bio_readpage_error() 2214 em = NULL; in bio_readpage_error() 2218 if (!em) { in bio_readpage_error() 2222 logical = start - em->start; in bio_readpage_error() 2223 logical = em->block_start + logical; in bio_readpage_error() 2224 if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags)) { in bio_readpage_error() [all …]
|
D | compression.c | 452 struct extent_map *em; in add_ra_bio_pages() local 505 em = lookup_extent_mapping(em_tree, last_offset, in add_ra_bio_pages() 509 if (!em || last_offset < em->start || in add_ra_bio_pages() 510 (last_offset + PAGE_CACHE_SIZE > extent_map_end(em)) || in add_ra_bio_pages() 511 (em->block_start >> 9) != cb->orig_bio->bi_sector) { in add_ra_bio_pages() 512 free_extent_map(em); in add_ra_bio_pages() 518 free_extent_map(em); in add_ra_bio_pages() 581 struct extent_map *em; in btrfs_submit_compressed_read() local 591 em = lookup_extent_mapping(em_tree, in btrfs_submit_compressed_read() 595 if (!em) in btrfs_submit_compressed_read() [all …]
|
D | tree-log.c | 3269 struct extent_map *em, struct btrfs_path *path) in log_one_extent() argument 3278 u64 mod_start = em->mod_start; in log_one_extent() 3279 u64 mod_len = em->mod_len; in log_one_extent() 3282 u64 extent_offset = em->start - em->orig_start; in log_one_extent() 3288 ret = __btrfs_drop_extents(trans, log, inode, path, em->start, in log_one_extent() 3289 em->start + em->len, NULL, 0); in log_one_extent() 3297 key.offset = em->start; in log_one_extent() 3306 btrfs_set_token_file_extent_generation(leaf, fi, em->generation, in log_one_extent() 3308 if (test_bit(EXTENT_FLAG_PREALLOC, &em->flags)) { in log_one_extent() 3317 if (em->block_start == 0) in log_one_extent() [all …]
|
D | dev-replace.c | 568 struct extent_map *em; in btrfs_dev_replace_update_device_in_mapping_tree() local 575 em = lookup_extent_mapping(em_tree, start, (u64)-1); in btrfs_dev_replace_update_device_in_mapping_tree() 576 if (!em) in btrfs_dev_replace_update_device_in_mapping_tree() 578 map = (struct map_lookup *)em->bdev; in btrfs_dev_replace_update_device_in_mapping_tree() 582 start = em->start + em->len; in btrfs_dev_replace_update_device_in_mapping_tree() 583 free_extent_map(em); in btrfs_dev_replace_update_device_in_mapping_tree()
|
D | ioctl.c | 786 struct extent_map *em = NULL; in check_defrag_in_cache() local 791 em = lookup_extent_mapping(em_tree, offset, PAGE_CACHE_SIZE); in check_defrag_in_cache() 794 if (em) { in check_defrag_in_cache() 795 end = extent_map_end(em); in check_defrag_in_cache() 796 free_extent_map(em); in check_defrag_in_cache() 881 struct extent_map *em; in defrag_lookup_extent() local 889 em = lookup_extent_mapping(em_tree, start, len); in defrag_lookup_extent() 892 if (!em) { in defrag_lookup_extent() 895 em = btrfs_get_extent(inode, NULL, 0, start, len, 0); in defrag_lookup_extent() 898 if (IS_ERR(em)) in defrag_lookup_extent() [all …]
|
D | disk-io.c | 203 struct extent_map *em; in btree_get_extent() local 207 em = lookup_extent_mapping(em_tree, start, len); in btree_get_extent() 208 if (em) { in btree_get_extent() 209 em->bdev = in btree_get_extent() 216 em = alloc_extent_map(); in btree_get_extent() 217 if (!em) { in btree_get_extent() 218 em = ERR_PTR(-ENOMEM); in btree_get_extent() 221 em->start = 0; in btree_get_extent() 222 em->len = (u64)-1; in btree_get_extent() 223 em->block_len = (u64)-1; in btree_get_extent() [all …]
|
D | relocation.c | 2980 struct extent_map *em; local 2983 em = alloc_extent_map(); 2984 if (!em) 2987 em->start = start; 2988 em->len = end + 1 - start; 2989 em->block_len = em->len; 2990 em->block_start = block_start; 2991 em->bdev = root->fs_info->fs_devices->latest_bdev; 2992 set_bit(EXTENT_FLAG_PINNED, &em->flags); 2997 ret = add_extent_mapping(em_tree, em, 0); [all …]
|
D | scrub.c | 2560 struct extent_map *em; in scrub_chunk() local 2565 em = lookup_extent_mapping(&map_tree->map_tree, chunk_offset, 1); in scrub_chunk() 2568 if (!em) in scrub_chunk() 2571 map = (struct map_lookup *)em->bdev; in scrub_chunk() 2572 if (em->start != chunk_offset) in scrub_chunk() 2575 if (em->len < length) in scrub_chunk() 2589 free_extent_map(em); in scrub_chunk()
|
/fs/ocfs2/ |
D | extent_map.c | 62 static void __ocfs2_extent_map_lookup(struct ocfs2_extent_map *em, in __ocfs2_extent_map_lookup() argument 71 list_for_each_entry(emi, &em->em_list, ei_list) { in __ocfs2_extent_map_lookup() 75 list_move(&emi->ei_list, &em->em_list); in __ocfs2_extent_map_lookup() 118 struct ocfs2_extent_map *em = &oi->ip_extent_map; in ocfs2_extent_map_trunc() local 123 list_for_each_entry_safe(emi, n, &em->em_list, ei_list) { in ocfs2_extent_map_trunc() 127 BUG_ON(em->em_num_items == 0); in ocfs2_extent_map_trunc() 128 em->em_num_items--; in ocfs2_extent_map_trunc() 231 struct ocfs2_extent_map *em = &oi->ip_extent_map; in ocfs2_extent_map_insert_rec() local 244 list_for_each_entry(emi, &em->em_list, ei_list) { in ocfs2_extent_map_insert_rec() 246 list_move(&emi->ei_list, &em->em_list); in ocfs2_extent_map_insert_rec() [all …]
|