summaryrefslogtreecommitdiff
path: root/btrfs-convert.c
diff options
context:
space:
mode:
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 b8684792..480ce9ee 100644
--- a/btrfs-convert.c
+++ b/btrfs-convert.c
@@ -173,6 +173,22 @@ static int convert_insert_dirent(struct btrfs_trans_handle *trans,
return 0;
}
+static int read_disk_extent(struct btrfs_root *root, u64 bytenr,
+ u32 num_bytes, char *buffer)
+{
+ int ret;
+ struct btrfs_fs_devices *fs_devs = root->fs_info->fs_devices;
+
+ ret = pread(fs_devs->latest_bdev, buffer, num_bytes, bytenr);
+ if (ret != num_bytes)
+ goto fail;
+ ret = 0;
+fail:
+ if (ret > 0)
+ ret = -1;
+ return ret;
+}
+
/*
* Open Ext2fs in readonly mode, read block allocation bitmap and
* inode bitmap into memory.
@@ -414,22 +430,6 @@ error:
return -1;
}
-static int read_disk_extent(struct btrfs_root *root, u64 bytenr,
- u32 num_bytes, char *buffer)
-{
- int ret;
- struct btrfs_fs_devices *fs_devs = root->fs_info->fs_devices;
-
- ret = pread(fs_devs->latest_bdev, buffer, num_bytes, bytenr);
- if (ret != num_bytes)
- goto fail;
- ret = 0;
-fail:
- if (ret > 0)
- ret = -1;
- return ret;
-}
-
static int csum_disk_extent(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
u64 disk_bytenr, u64 num_bytes)