summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/flash/format.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/disk_cache/flash/format.h')
-rw-r--r--net/disk_cache/flash/format.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/net/disk_cache/flash/format.h b/net/disk_cache/flash/format.h
new file mode 100644
index 0000000..12a5a48
--- /dev/null
+++ b/net/disk_cache/flash/format.h
@@ -0,0 +1,26 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_DISK_CACHE_FLASH_FORMAT_H
+#define NET_DISK_CACHE_FLASH_FORMAT_H
+
+namespace disk_cache {
+
+// Storage constants.
+const int32 kFlashPageSize = 8 * 1024;
+const int32 kFlashBlockSize = 512 * kFlashPageSize;
+
+// Segment constants.
+const int32 kFlashSegmentSize = 4 * 1024 * 1024;
+const int32 kFlashSmallEntrySize = 4 * 1024;
+const size_t kFlashMaxEntryCount = kFlashSegmentSize / kFlashSmallEntrySize - 1;
+
+// Segment summary consists of a fixed region at the end of the segment
+// containing a counter specifying the number of saved offsets followed by the
+// offsets.
+const int32 kFlashSummarySize = (1 + kFlashMaxEntryCount) * sizeof(int32);
+
+} // namespace disk_cache
+
+#endif // NET_DISK_CACHE_FLASH_FORMAT_H