summaryrefslogtreecommitdiff
path: root/cmd_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd_debug.c')
-rw-r--r--cmd_debug.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/cmd_debug.c b/cmd_debug.c
index 04afea13..159835b8 100644
--- a/cmd_debug.c
+++ b/cmd_debug.c
@@ -38,12 +38,10 @@ static void dump_one_device(struct bch_fs *c, struct bch_dev *ca, int fd,
bool entire_journal)
{
struct bch_sb *sb = ca->disk_sb.sb;
- ranges data;
+ ranges data = { 0 };
unsigned i;
int ret;
- darray_init(data);
-
/* Superblock: */
range_add(&data, BCH_SB_LAYOUT_SECTOR << 9,
sizeof(struct bch_sb_layout));
@@ -110,7 +108,7 @@ static void dump_one_device(struct bch_fs *c, struct bch_dev *ca, int fd,
qcow2_write_image(ca->disk_sb.bdev->bd_fd, fd, &data,
max_t(unsigned, btree_bytes(c) / 8, block_bytes(c)));
- darray_free(data);
+ darray_exit(data);
}
int cmd_dump(int argc, char *argv[])