Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(771)

Unified Diff: utils.h

Issue 3706006: AU: Add a utility routine to get the filesystem size from a device. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: review comments Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils.h
diff --git a/utils.h b/utils.h
index bfe73784d9d940e971ed4330d84eba3ff1ece04c..9beae04b9bb025ed1782c57db4efc7562e49c4e0 100644
--- a/utils.h
+++ b/utils.h
@@ -115,6 +115,17 @@ bool MountFilesystem(const std::string& device, const std::string& mountpoint,
unsigned long flags);
bool UnmountFilesystem(const std::string& mountpoint);
+// Returns the block count and the block byte size of the ext3 file system on
+// |device| (which may be a real device or a path to a filesystem image) or on
+// an opened file descriptor |fd|. The actual file-system size is |block_count|
+// * |block_size| bytes. Returns true on success, false otherwise.
+bool GetFilesystemSize(const std::string& device,
+ int* out_block_count,
+ int* out_block_size);
+bool GetFilesystemSizeFromFD(int fd,
+ int* out_block_count,
+ int* out_block_size);
+
enum BootLoader {
BootLoader_SYSLINUX = 0,
BootLoader_CHROME_FIRMWARE = 1
« no previous file with comments | « no previous file | utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698