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