summaryrefslogtreecommitdiff
path: root/btrfs-convert.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-08-23 17:34:43 +0200
committerDavid Sterba <dsterba@suse.com>2016-08-24 14:37:36 +0200
commitf507d20d2f12d5bc0b850000a413dba11f9e1c9e (patch)
treed658ba83179941187b6fd8c22b2e70c2744e8766 /btrfs-convert.c
parenta1e8a8739cde4c670fc578db2feb6d9269242693 (diff)
btrfs-progs: convert: move intersect_with_sb
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'btrfs-convert.c')
-rw-r--r--btrfs-convert.c32
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,