summaryrefslogtreecommitdiff
path: root/common/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/utils.h')
-rw-r--r--common/utils.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/utils.h b/common/utils.h
index 5f6e4757..9a278eb1 100644
--- a/common/utils.h
+++ b/common/utils.h
@@ -23,6 +23,7 @@
#include <unistd.h>
#include <algorithm>
+#include <cstdint>
#include <limits>
#include <map>
#include <memory>
@@ -181,6 +182,10 @@ std::string MakePartitionName(const std::string& disk_name, int partition_num);
// in |read_only|. Return whether the operation succeeded.
bool SetBlockDeviceReadOnly(const std::string& device, bool read_only);
+// Reserve |size| bytes on space on |path| by creating a file at |path| and
+// write 0s into it. Return true iff both creation and writing succeed.
+[[nodiscard]] bool ReserveStorageSpace(const char* path, uint64_t size);
+
// Synchronously mount or unmount a filesystem. Return true on success.
// When mounting, it will attempt to mount the device as the passed filesystem
// type |type|, with the passed |flags| options. If |type| is empty, "ext2",