• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef NET_DISK_CACHE_FLASH_FORMAT_H_
6 #define NET_DISK_CACHE_FLASH_FORMAT_H_
7 
8 namespace disk_cache {
9 
10 // Storage constants.
11 const int32 kFlashPageSize = 8 * 1024;
12 const int32 kFlashBlockSize = 512 * kFlashPageSize;
13 
14 // Segment constants.
15 const int32 kFlashSegmentSize = 4 * 1024 * 1024;
16 const int32 kFlashSmallEntrySize = 4 * 1024;
17 const size_t kFlashMaxEntryCount = kFlashSegmentSize / kFlashSmallEntrySize - 1;
18 
19 // Segment summary consists of a fixed region at the end of the segment
20 // containing a counter specifying the number of saved offsets followed by the
21 // offsets.
22 const int32 kFlashSummarySize = (1 + kFlashMaxEntryCount) * sizeof(int32);
23 const int32 kFlashSegmentFreeSpace = kFlashSegmentSize - kFlashSummarySize;
24 
25 // An entry consists of a fixed number of streams.
26 const int32 kFlashLogStoreEntryNumStreams = 4;
27 const int32 kFlashLogStoreEntryHeaderSize =
28     kFlashLogStoreEntryNumStreams * sizeof(int32);
29 
30 }  // namespace disk_cache
31 
32 #endif  // NET_DISK_CACHE_FLASH_FORMAT_H_
33