btrfs: remove no longer used btrfs_clone_chunk_map()
authorFilipe Manana <fdmanana@suse.com>
Wed, 3 Apr 2024 11:47:51 +0000 (12:47 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 May 2024 19:31:03 +0000 (21:31 +0200)
There are no more users of btrfs_clone_chunk_map(), the last one (and
only one ever) was removed in commit 1ec17ef59168 ("btrfs: zoned: fix
use-after-free in do_zone_finish()"). So remove btrfs_clone_chunk_map().

Reviewed-by: Qu Wenruo <wqu@suse.com>
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/volumes.c
fs/btrfs/volumes.h

index ef6bd2f4251b523ecfa4e0c31fc3c7eb0d26d332..b6a701011fb057b5d6e2e96eee0b98019c2f8321 100644 (file)
@@ -5615,21 +5615,6 @@ struct btrfs_chunk_map *btrfs_alloc_chunk_map(int num_stripes, gfp_t gfp)
        return map;
 }
 
-struct btrfs_chunk_map *btrfs_clone_chunk_map(struct btrfs_chunk_map *map, gfp_t gfp)
-{
-       const int size = btrfs_chunk_map_size(map->num_stripes);
-       struct btrfs_chunk_map *clone;
-
-       clone = kmemdup(map, size, gfp);
-       if (!clone)
-               return NULL;
-
-       refcount_set(&clone->refs, 1);
-       RB_CLEAR_NODE(&clone->rb_node);
-
-       return clone;
-}
-
 static struct btrfs_block_group *create_chunk(struct btrfs_trans_handle *trans,
                        struct alloc_chunk_ctl *ctl,
                        struct btrfs_device_info *devices_info)
index 93854609a4d5689b32c0f79e818de1327d811cea..cf555f5b47ce63f1c9bf0797cbaf1386ae14a01e 100644 (file)
@@ -743,7 +743,6 @@ struct btrfs_chunk_map *btrfs_alloc_chunk_map(int num_stripes, gfp_t gfp);
 int btrfs_add_chunk_map(struct btrfs_fs_info *fs_info, struct btrfs_chunk_map *map);
 #endif
 
-struct btrfs_chunk_map *btrfs_clone_chunk_map(struct btrfs_chunk_map *map, gfp_t gfp);
 struct btrfs_chunk_map *btrfs_find_chunk_map(struct btrfs_fs_info *fs_info,
                                             u64 logical, u64 length);
 struct btrfs_chunk_map *btrfs_find_chunk_map_nolock(struct btrfs_fs_info *fs_info,