X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fext.cc;h=5e2ff7d9cbd93a4463f4c5f05ae661a7f955b7b6;hp=7853984cf28e2b4ff123078fe02dccae39c03eaf;hb=fe933ebb2c55b4235fcba5d02af2ba91c272fc88;hpb=8a8c977c12fc65f1f50ea05099387e0fc8840e7d diff --git a/src/lib/ext.cc b/src/lib/ext.cc index 7853984cf..5e2ff7d9c 100644 --- a/src/lib/ext.cc +++ b/src/lib/ext.cc @@ -27,6 +27,7 @@ #include "exceptions.h" #include "ext.h" #include "nanomsg.h" +#include #ifdef DCPOMATIC_LINUX #include @@ -72,7 +73,7 @@ using std::vector; /* Use quite a big block size here, as ext4's fwrite() has quite a bit of overhead */ -static uint64_t const block_size = 4096 * 4096; +uint64_t constexpr block_size = 4096 * 4096; static @@ -284,12 +285,26 @@ try { ext4_dmask_set (DEBUG_ALL); - /* We rely on static initialization for these */ - static struct ext4_fs fs; - static struct ext4_mkfs_info info; + struct ext4_fs fs; + fs.read_only = false; + fs.bdev = nullptr; + fs.last_inode_bg_id = 0; + fs.jbd_fs = nullptr; + fs.jbd_journal = nullptr; + fs.curr_trans = nullptr; + struct ext4_mkfs_info info; + info.len = 0; info.block_size = 4096; + info.blocks_per_group = 0; info.inode_size = 128; + info.inodes = 0; + info.journal_blocks = 0; + info.dsc_size = 0; + for (int i = 0; i < UUID_SIZE; ++i) { + info.uuid[i] = rand() & 0xff; + } info.journal = false; + info.label = nullptr; #ifdef WIN32 file_windows_name_set(device.c_str());