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

Unified Diff: base/file_util.h

Issue 3187011: linux: add UMA stat for the file system where the prefs are stored (Closed)
Patch Set: coda Created 10 years, 4 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 | « base/base.gypi ('k') | base/file_util_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util.h
diff --git a/base/file_util.h b/base/file_util.h
index 91b16d23d333db52541c14e90773df3b1b792fe7..ce30b5e2862024044c71db4450aa5044af232d12 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -612,9 +612,29 @@ inline bool MakeFileUnreadable(const FilePath& path) {
// is passed in. If it is 0 then the whole file is paged in. The step size
// which indicates the number of bytes to skip after every page touched is
// also passed in.
- bool PreReadImage(const wchar_t* file_path, size_t size_to_read,
- size_t step_size);
+bool PreReadImage(const wchar_t* file_path, size_t size_to_read,
+ size_t step_size);
#endif // OS_WIN
+
+#if defined(OS_LINUX)
+// Broad categories of file systems as returned by statfs() on Linux.
+enum FileSystemType {
+ FILE_SYSTEM_UNKNOWN, // statfs failed.
+ FILE_SYSTEM_0, // statfs.f_type == 0 means unknown, may indicate AFS.
+ FILE_SYSTEM_ORDINARY, // on-disk filesystem like ext2
+ FILE_SYSTEM_NFS,
+ FILE_SYSTEM_SMB,
+ FILE_SYSTEM_CODA,
+ FILE_SYSTEM_MEMORY, // in-memory file system
+ FILE_SYSTEM_OTHER, // any other value.
+ FILE_SYSTEM_TYPE_COUNT
+};
+
+// Attempts determine the FileSystemType for |path|.
+// Returns false if |path| doesn't exist.
+bool GetFileSystemType(const FilePath& path, FileSystemType* type);
+#endif
+
} // namespace file_util
// Deprecated functions have been moved to this separate header file,
« no previous file with comments | « base/base.gypi ('k') | base/file_util_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698