libgocryptfs/internal/fusefrontend_reverse/ino_map.go

20 lines
276 B
Go
Raw Normal View History

package fusefrontend_reverse
import (
"sync/atomic"
)
2016-10-02 06:14:18 +02:00
func newInoGen() *inoGenT {
var ino uint64 = 1
return &inoGenT{&ino}
}
type inoGenT struct {
ino *uint64
}
// Get the next inode counter value
func (i *inoGenT) next() uint64 {
return atomic.AddUint64(i.ino, 1)
}