initJournal initializes the journal
(journal []byte)
| 209 | |
| 210 | // initJournal initializes the journal |
| 211 | func (s *Storage) initJournal(journal []byte) { |
| 212 | h := (*journalHeader)(unsafe.Pointer(&journal[0])) |
| 213 | h.magic = journalMagic |
| 214 | h.version = journalVersion |
| 215 | h.headerSize = uint8(headerSize) |
| 216 | h.maxChunks = uint32(s.MaxChunks) |
| 217 | h.chunkSize = uint32(s.ChunkSize) |
| 218 | h.checksum = crc32.Checksum(journal[:12], crc32Table) |
| 219 | } |
| 220 | |
| 221 | // allocateMmapRegions creates memory mappings to fit all chunks |
| 222 | func (s *Storage) allocateMmapRegions(maxMmapSize int64) error { |
no outgoing calls
no test coverage detected