MCPcopy
hub / github.com/etcd-io/bbolt / commitFreelist

Method commitFreelist

tx.go:285–298  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

283}
284
285func (tx *Tx) commitFreelist() error {
286 // Allocate new pages for the new free list. This will overestimate
287 // the size of the freelist but not underestimate the size (which would be bad).
288 p, err := tx.allocate((tx.db.freelist.EstimatedWritePageSize() / tx.db.pageSize) + 1)
289 if err != nil {
290 tx.rollback()
291 return err
292 }
293
294 tx.db.freelist.Write(p)
295 tx.meta.SetFreelist(p.Id())
296
297 return nil
298}
299
300// Rollback closes the transaction and ignores all previous updates. Read-only
301// transactions must be rolled back and not committed.

Callers 1

CommitMethod · 0.95

Calls 6

allocateMethod · 0.95
rollbackMethod · 0.95
SetFreelistMethod · 0.80
IdMethod · 0.80
WriteMethod · 0.65

Tested by

no test coverage detected