diff options
-rw-r--r-- | btrfs-convert.c | 32 |
1 files changed, 16 insertions, 16 deletions
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, |