コード例 #1
0
func (b *baseBlockset) makeID(i torus.INodeRef) torus.BlockRef {
	id := atomic.AddUint64(&b.ids, 1)
	return torus.BlockRef{
		INodeRef: i,
		Index:    torus.IndexID(id),
	}
}
コード例 #2
0
func generateLinearFile(vol torus.VolumeID, in torus.INodeID, size int) ([]torus.BlockRef, torus.INodeID) {
	var out []torus.BlockRef
	for x := 1; x <= size; x++ {
		out = append(out, torus.BlockRef{
			INodeRef: torus.NewINodeRef(vol, in),
			Index:    torus.IndexID(x),
		})
	}
	return out, in + 1
}