MCPcopy Index your code
hub / github.com/plexdrive/plexdrive / initJournal

Method initJournal

chunk/storage.go:211–219  ·  view source on GitHub ↗

initJournal initializes the journal

(journal []byte)

Source from the content-addressed store, hash-verified

209
210// initJournal initializes the journal
211func (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
222func (s *Storage) allocateMmapRegions(maxMmapSize int64) error {

Callers 2

NewStorageFunction · 0.95
relocateJournalMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected