| Index: net/disk_cache/blockfile/disk_format_v3.h
|
| diff --git a/net/disk_cache/blockfile/disk_format_v3.h b/net/disk_cache/blockfile/disk_format_v3.h
|
| index f5811cc0fc42c85fd0a89e94e3b63e610f2e20bc..bdac90e8991c04efd798f65704ca13db9f8ce59e 100644
|
| --- a/net/disk_cache/blockfile/disk_format_v3.h
|
| +++ b/net/disk_cache/blockfile/disk_format_v3.h
|
| @@ -63,30 +63,30 @@ enum CacheFlags {
|
|
|
| // Header for the master index file.
|
| struct IndexHeaderV3 {
|
| - uint32 magic;
|
| - uint32 version;
|
| - int32 num_entries; // Number of entries currently stored.
|
| - int32 num_bytes; // Total size of the stored data.
|
| - int32 last_file; // Last external file created.
|
| - int32 reserved1;
|
| - CacheAddr stats; // Storage for usage data.
|
| - int32 table_len; // Actual size of the table.
|
| - int32 crash; // Signals a previous crash.
|
| - int32 experiment; // Id of an ongoing test.
|
| - int32 max_bytes; // Total maximum size of the stored data.
|
| - uint32 flags;
|
| - int32 used_cells;
|
| - int32 max_bucket;
|
| - uint64 create_time; // Creation time for this set of files.
|
| - uint64 base_time; // Current base for timestamps.
|
| - uint64 old_time; // Previous time used for timestamps.
|
| - int32 max_block_file;
|
| - int32 num_no_use_entries;
|
| - int32 num_low_use_entries;
|
| - int32 num_high_use_entries;
|
| - int32 reserved;
|
| - int32 num_evicted_entries;
|
| - int32 pad[6];
|
| + uint32 magic;
|
| + uint32 version;
|
| + int32 num_entries; // Number of entries currently stored.
|
| + int32 num_bytes; // Total size of the stored data.
|
| + int32 last_file; // Last external file created.
|
| + int32 reserved1;
|
| + CacheAddr stats; // Storage for usage data.
|
| + int32 table_len; // Actual size of the table.
|
| + int32 crash; // Signals a previous crash.
|
| + int32 experiment; // Id of an ongoing test.
|
| + int32 max_bytes; // Total maximum size of the stored data.
|
| + uint32 flags;
|
| + int32 used_cells;
|
| + int32 max_bucket;
|
| + uint64 create_time; // Creation time for this set of files.
|
| + uint64 base_time; // Current base for timestamps.
|
| + uint64 old_time; // Previous time used for timestamps.
|
| + int32 max_block_file;
|
| + int32 num_no_use_entries;
|
| + int32 num_low_use_entries;
|
| + int32 num_high_use_entries;
|
| + int32 reserved;
|
| + int32 num_evicted_entries;
|
| + int32 pad[6];
|
| };
|
|
|
| const int kBaseBitmapBytes = 3968;
|
| @@ -94,29 +94,29 @@ const int kBaseBitmapBytes = 3968;
|
| // page increments (4096 bytes), but all bits don't have to be in use at any
|
| // given time. The required file size can be computed from header.table_len.
|
| struct IndexBitmap {
|
| - IndexHeaderV3 header;
|
| - uint32 bitmap[kBaseBitmapBytes / 4]; // First page of the bitmap.
|
| + IndexHeaderV3 header;
|
| + uint32 bitmap[kBaseBitmapBytes / 4]; // First page of the bitmap.
|
| };
|
| COMPILE_ASSERT(sizeof(IndexBitmap) == 4096, bad_IndexHeader);
|
|
|
| // Possible states for a given entry.
|
| enum EntryState {
|
| - ENTRY_FREE = 0, // Available slot.
|
| - ENTRY_NEW, // The entry is being created.
|
| - ENTRY_OPEN, // The entry is being accessed.
|
| - ENTRY_MODIFIED, // The entry is being modified.
|
| - ENTRY_DELETED, // The entry is being deleted.
|
| - ENTRY_FIXING, // Inconsistent state. The entry is being verified.
|
| - ENTRY_USED // The slot is in use (entry is present).
|
| + ENTRY_FREE = 0, // Available slot.
|
| + ENTRY_NEW, // The entry is being created.
|
| + ENTRY_OPEN, // The entry is being accessed.
|
| + ENTRY_MODIFIED, // The entry is being modified.
|
| + ENTRY_DELETED, // The entry is being deleted.
|
| + ENTRY_FIXING, // Inconsistent state. The entry is being verified.
|
| + ENTRY_USED // The slot is in use (entry is present).
|
| };
|
| COMPILE_ASSERT(ENTRY_USED <= 7, state_uses_3_bits);
|
|
|
| enum EntryGroup {
|
| - ENTRY_NO_USE = 0, // The entry has not been reused.
|
| - ENTRY_LOW_USE, // The entry has low reuse.
|
| - ENTRY_HIGH_USE, // The entry has high reuse.
|
| - ENTRY_RESERVED, // Reserved for future use.
|
| - ENTRY_EVICTED // The entry was deleted.
|
| + ENTRY_NO_USE = 0, // The entry has not been reused.
|
| + ENTRY_LOW_USE, // The entry has low reuse.
|
| + ENTRY_HIGH_USE, // The entry has high reuse.
|
| + ENTRY_RESERVED, // Reserved for future use.
|
| + ENTRY_EVICTED // The entry was deleted.
|
| };
|
| COMPILE_ASSERT(ENTRY_USED <= 7, group_uses_3_bits);
|
|
|
| @@ -180,16 +180,16 @@ struct IndexCell {
|
| // If that same Addr is stored on a large table, the location field would be
|
| // 0x61234
|
|
|
| - uint64 first_part;
|
| - uint8 last_part;
|
| + uint64 first_part;
|
| + uint8 last_part;
|
| };
|
| COMPILE_ASSERT(sizeof(IndexCell) == 9, bad_IndexCell);
|
|
|
| const int kCellsPerBucket = 4;
|
| struct IndexBucket {
|
| - IndexCell cells[kCellsPerBucket];
|
| - int32 next;
|
| - uint32 hash; // The high order byte is reserved (should be zero).
|
| + IndexCell cells[kCellsPerBucket];
|
| + int32 next;
|
| + uint32 hash; // The high order byte is reserved (should be zero).
|
| };
|
| COMPILE_ASSERT(sizeof(IndexBucket) == 44, bad_IndexBucket);
|
| const int kBytesPerCell = 44 / kCellsPerBucket;
|
| @@ -204,40 +204,40 @@ struct Index {
|
|
|
| // Flags that can be applied to an entry.
|
| enum EntryFlags {
|
| - PARENT_ENTRY = 1, // This entry has children (sparse) entries.
|
| - CHILD_ENTRY = 1 << 1 // Child entry that stores sparse data.
|
| + PARENT_ENTRY = 1, // This entry has children (sparse) entries.
|
| + CHILD_ENTRY = 1 << 1 // Child entry that stores sparse data.
|
| };
|
|
|
| struct EntryRecord {
|
| - uint32 hash;
|
| - uint32 pad1;
|
| - uint8 reuse_count;
|
| - uint8 refetch_count;
|
| - int8 state; // Current EntryState.
|
| - uint8 flags; // Any combination of EntryFlags.
|
| - int32 key_len;
|
| - int32 data_size[4]; // We can store up to 4 data streams for each
|
| - CacheAddr data_addr[4]; // entry.
|
| - uint32 data_hash[4];
|
| - uint64 creation_time;
|
| - uint64 last_modified_time;
|
| - uint64 last_access_time;
|
| - int32 pad[3];
|
| - uint32 self_hash;
|
| + uint32 hash;
|
| + uint32 pad1;
|
| + uint8 reuse_count;
|
| + uint8 refetch_count;
|
| + int8 state; // Current EntryState.
|
| + uint8 flags; // Any combination of EntryFlags.
|
| + int32 key_len;
|
| + int32 data_size[4]; // We can store up to 4 data streams for each
|
| + CacheAddr data_addr[4]; // entry.
|
| + uint32 data_hash[4];
|
| + uint64 creation_time;
|
| + uint64 last_modified_time;
|
| + uint64 last_access_time;
|
| + int32 pad[3];
|
| + uint32 self_hash;
|
| };
|
| COMPILE_ASSERT(sizeof(EntryRecord) == 104, bad_EntryRecord);
|
|
|
| struct ShortEntryRecord {
|
| - uint32 hash;
|
| - uint32 pad1;
|
| - uint8 reuse_count;
|
| - uint8 refetch_count;
|
| - int8 state; // Current EntryState.
|
| - uint8 flags;
|
| - int32 key_len;
|
| - uint64 last_access_time;
|
| - uint32 long_hash[5];
|
| - uint32 self_hash;
|
| + uint32 hash;
|
| + uint32 pad1;
|
| + uint8 reuse_count;
|
| + uint8 refetch_count;
|
| + int8 state; // Current EntryState.
|
| + uint8 flags;
|
| + int32 key_len;
|
| + uint64 last_access_time;
|
| + uint32 long_hash[5];
|
| + uint32 self_hash;
|
| };
|
| COMPILE_ASSERT(sizeof(ShortEntryRecord) == 48, bad_ShortEntryRecord);
|
|
|
|
|