From 2f43f2dc7bbd920f40882119d631af42ef212307 Mon Sep 17 00:00:00 2001 From: Thomas Hebb Date: Sun, 26 Jun 2022 16:52:42 -0700 Subject: [PATCH] btrfs-progs: convert: move simple_range into common.h This is currently defined in source-fs.h, but main.c uses it far more than source-fs.c does. Put it in common.h instead, since it's a useful standalone type. Author: Thomas Hebb Pull-request: #494 Reviewed-by: Qu Wenruo Signed-off-by: David Sterba --- convert/common.h | 21 +++++++++++++++++++++ convert/source-fs.h | 21 --------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/convert/common.h b/convert/common.h index 935916f3..581ef329 100644 --- a/convert/common.h +++ b/convert/common.h @@ -63,4 +63,25 @@ struct btrfs_convert_context { int make_convert_btrfs(int fd, struct btrfs_mkfs_config *cfg, struct btrfs_convert_context *cctx); +/* + * Represents a simple contiguous range. + * + * For multiple or non-contiguous ranges, use extent_cache_tree from + * extent-cache.c + */ +struct simple_range { + u64 start; + u64 len; +}; + +/* + * Simple range functions + */ + +/* Get range end (exclusive) */ +static inline u64 range_end(const struct simple_range *range) +{ + return (range->start + range->len); +} + #endif diff --git a/convert/source-fs.h b/convert/source-fs.h index 46dea6b9..c65b29c7 100644 --- a/convert/source-fs.h +++ b/convert/source-fs.h @@ -29,17 +29,6 @@ struct task_info; #define CONV_IMAGE_SUBVOL_OBJECTID BTRFS_FIRST_FREE_OBJECTID -/* - * Represents a simple contiguous range. - * - * For multiple or non-contiguous ranges, use extent_cache_tree from - * extent-cache.c - */ -struct simple_range { - u64 start; - u64 len; -}; - extern const struct simple_range btrfs_reserved_ranges[3]; struct task_ctx { @@ -160,14 +149,4 @@ int read_disk_extent(struct btrfs_root *root, u64 bytenr, int record_file_blocks(struct blk_iterate_data *data, u64 file_block, u64 disk_block, u64 num_blocks); -/* - * Simple range functions - * - * Get range end (exclusive) - */ -static inline u64 range_end(const struct simple_range *range) -{ - return (range->start + range->len); -} - #endif