summaryrefslogtreecommitdiff
path: root/common/utils.h
diff options
context:
space:
mode:
authorAndroid Build Role Account android-build-prod <android-build-team-robot@google.com>2021-03-25 10:07:36 +0000
committerAndroid Build Role Account android-build-prod <android-build-team-robot@google.com>2021-03-25 10:07:36 +0000
commit75548accd9594d870fa712e3da2d9f618e38c60e (patch)
treede292a70ddc2edd6da37d3d9b370debd8b80b88f /common/utils.h
parent9c7061227a48006b715abc21030bf7cd3038e656 (diff)
parentf1c33f832a626903c5fd7dc61a472685d7427c82 (diff)
Snap for 7234866 from f1c33f832a626903c5fd7dc61a472685d7427c82 to s-keystone-qcom-release
Change-Id: Ib1ef35430561943fb1741db48297001fe97c328e
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",