ext4_utils: move sparse file pointer out of fs_info
Move the sparse file pointer out of the fs_info struct in
preparation for exporting fs_info without sparse file support.
Change-Id: I5a72147fe4fb24296e615cb82dbba91c6dc6f7f0
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c
index c2a2665..2250241 100644
--- a/ext4_utils/make_ext4fs.c
+++ b/ext4_utils/make_ext4fs.c
@@ -362,9 +362,9 @@
memset(&info, 0, sizeof(info));
memset(&aux_info, 0, sizeof(aux_info));
- if (info.sparse_file) {
- sparse_file_destroy(info.sparse_file);
- info.sparse_file = NULL;
+ if (ext4_sparse_file) {
+ sparse_file_destroy(ext4_sparse_file);
+ ext4_sparse_file = NULL;
}
}
@@ -545,7 +545,7 @@
printf(" Block groups: %d\n", aux_info.groups);
printf(" Reserved block group size: %d\n", info.bg_desc_reserve_blocks);
- info.sparse_file = sparse_file_new(info.block_size, info.len);
+ ext4_sparse_file = sparse_file_new(info.block_size, info.len);
block_allocator_init();
@@ -607,8 +607,8 @@
write_ext4_image(fd, gzip, sparse, crc);
- sparse_file_destroy(info.sparse_file);
- info.sparse_file = NULL;
+ sparse_file_destroy(ext4_sparse_file);
+ ext4_sparse_file = NULL;
free(mountpoint);
free(directory);