示例#1
0
文件: memoryfs.go 项目: amkimian/pmfs
// Simply returns the next free node id
func (mfs *MemoryFileSystem) GetFreeBlockNode(NodeType fs.BlockNodeType) fs.BlockNode {
	var node fs.BlockNode
	node.Type = NodeType
	node.Id = mfs.UnusedNodeStart
	mfs.UnusedNodeStart = mfs.UnusedNodeStart + 1
	return node
}
示例#2
0
文件: memoryfs.go 项目: amkimian/pmfs
func (mfs *MemoryFileSystem) GetFreeDataBlockNode(parent fs.BlockNode, key string) fs.BlockNode {
	var node fs.BlockNode
	node.Type = fs.DATA
	node.RelativeTo = parent.Id
	node.Id = mfs.UnusedNodeStart
	mfs.UnusedNodeStart = mfs.UnusedNodeStart + 1
	return node
}