Trouble with GenerateInode
Not entirely sure what's going on. I can see GenerateInode being invoked but the inodes are not assigned.
I wrote a cheaper function to try and get some generation going, and while it prints: ls -i and similar don't return the dynamic inode value. Hard coding this in GetAttr results in the behaviour expected, with the caveat I'm not holding onto the parent inode values to augment this.
func (f *FS) GenerateInode(parentInode uint64, name string) uint64 {
fmt.Printf("PI: %d | GI: %d | %s\n", parentInode, uint64((parentInode & 0x00000000FFFFFFFF) << 32) | uint64(crc32.ChecksumIEEE([]byte(name))), name)
return uint64(uint64(crc32.ChecksumIEEE([]byte(name)))
}
I think the next step is to add tests for GenerateInode, it seems I never got around to do that.
I wrote a unit test for GenerateInode in commit ac2adf203b6787dd54f98a7d05456aad3444bbd6 and it seems to work just fine. Please provide more information, ideally a small filesystem implementation that demonstrates the issue.