]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: remove no longer used EXTENT_MAP_DELALLOC block start value
authorFilipe Manana <fdmanana@suse.com>
Thu, 23 Nov 2023 23:53:51 +0000 (23:53 +0000)
committerDavid Sterba <dsterba@suse.com>
Fri, 15 Dec 2023 19:27:03 +0000 (20:27 +0100)
After commit ac3c0d36a2a2 ("btrfs: make fiemap more efficient and accurate
reporting extent sharedness") we no longer need to create special extent
maps during fiemap that have a block start with the EXTENT_MAP_DELALLOC
value. So this block start value for extent maps is no longer used since
then, therefore remove it.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/defrag.c
fs/btrfs/extent_map.c
fs/btrfs/extent_map.h
include/trace/events/btrfs.h

index 5244561e201682a3c69a3fc077aa9e11847fd958..9bcb60c68c58a55da622f189d76d17400f8fab38 100644 (file)
@@ -996,9 +996,8 @@ static int defrag_collect_targets(struct btrfs_inode *inode,
                    em->len <= inode->root->fs_info->max_inline)
                        goto next;
 
-               /* Skip hole/delalloc/preallocated extents */
+               /* Skip holes and preallocated extents. */
                if (em->block_start == EXTENT_MAP_HOLE ||
-                   em->block_start == EXTENT_MAP_DELALLOC ||
                    test_bit(EXTENT_FLAG_PREALLOC, &em->flags))
                        goto next;
 
index c956b1ced69f335abd4402f1d6863d6ff2dd5f27..80f86503a5cde1238c23d5d02d9e0f521c4b83ee 100644 (file)
@@ -212,9 +212,6 @@ static int mergable_maps(struct extent_map *prev, struct extent_map *next)
        if (!list_empty(&prev->list) || !list_empty(&next->list))
                return 0;
 
-       ASSERT(next->block_start != EXTENT_MAP_DELALLOC &&
-              prev->block_start != EXTENT_MAP_DELALLOC);
-
        if (extent_map_end(prev) == next->start &&
            prev->flags == next->flags &&
            ((next->block_start == EXTENT_MAP_HOLE &&
index bae14af197ef1f3c66185a9b54f05fdaf6494fc8..66f8dd26487be8cffd46757afac0c8813afe2ace 100644 (file)
@@ -9,8 +9,6 @@
 #define EXTENT_MAP_LAST_BYTE ((u64)-4)
 #define EXTENT_MAP_HOLE ((u64)-3)
 #define EXTENT_MAP_INLINE ((u64)-2)
-/* used only during fiemap calls */
-#define EXTENT_MAP_DELALLOC ((u64)-1)
 
 /* bits for the extent_map::flags field */
 enum {
index 856109048999db1e34075350b7cf741c3102b163..31da1456f95335ee613fc7e12c2a5434c50a0876 100644 (file)
@@ -265,8 +265,7 @@ DEFINE_EVENT(btrfs__inode, btrfs_inode_evict,
        __print_symbolic_u64(type,                                      \
                { EXTENT_MAP_LAST_BYTE, "LAST_BYTE"     },              \
                { EXTENT_MAP_HOLE,      "HOLE"          },              \
-               { EXTENT_MAP_INLINE,    "INLINE"        },              \
-               { EXTENT_MAP_DELALLOC,  "DELALLOC"      })
+               { EXTENT_MAP_INLINE,    "INLINE"        })
 
 #define show_map_type(type)                    \
        type, (type >= EXTENT_MAP_LAST_BYTE) ? "-" :  __show_map_type(type)