From f507d20d2f12d5bc0b850000a413dba11f9e1c9e Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 23 Aug 2016 17:34:43 +0200 Subject: btrfs-progs: convert: move intersect_with_sb Signed-off-by: David Sterba --- btrfs-convert.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'btrfs-convert.c') diff --git a/btrfs-convert.c b/btrfs-convert.c index d19c07cb..3f7e07d3 100644 --- a/btrfs-convert.c +++ b/btrfs-convert.c @@ -128,6 +128,22 @@ static inline void convert_close_fs(struct btrfs_convert_context *cctx) cctx->convert_ops->close_fs(cctx); } +static int intersect_with_sb(u64 bytenr, u64 num_bytes) +{ + int i; + u64 offset; + + for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) { + offset = btrfs_sb_offset(i); + offset &= ~((u64)BTRFS_STRIPE_LEN - 1); + + if (bytenr < offset + BTRFS_STRIPE_LEN && + bytenr + num_bytes > offset) + return 1; + } + return 0; +} + /* * Open Ext2fs in readonly mode, read block allocation bitmap and * inode bitmap into memory. @@ -275,22 +291,6 @@ static void ext2_close_fs(struct btrfs_convert_context *cctx) ext2fs_close(cctx->fs_data); } -static int intersect_with_sb(u64 bytenr, u64 num_bytes) -{ - int i; - u64 offset; - - for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) { - offset = btrfs_sb_offset(i); - offset &= ~((u64)BTRFS_STRIPE_LEN - 1); - - if (bytenr < offset + BTRFS_STRIPE_LEN && - bytenr + num_bytes > offset) - return 1; - } - return 0; -} - static int convert_insert_dirent(struct btrfs_trans_handle *trans, struct btrfs_root *root, const char *name, size_t name_len, -- cgit v1.2.3