Пример #1
0
func (m *fileSystemMount) fillEntry(out *raw.EntryOut) {
	splitDuration(m.options.EntryTimeout, &out.EntryValid, &out.EntryValidNsec)
	splitDuration(m.options.AttrTimeout, &out.AttrValid, &out.AttrValidNsec)
	m.setOwner(&out.Attr)
	if out.Mode&S_IFDIR == 0 && out.Nlink == 0 {
		out.Nlink = 1
	}
}
Пример #2
0
// Generate EntryOut and increase the lookup count for an inode.
func (c *FileSystemConnector) childLookup(out *raw.EntryOut, fsi FsNode) {
	n := fsi.Inode()
	fsi.GetAttr((*Attr)(&out.Attr), nil, nil)
	n.mount.fillEntry(out)
	out.Ino = c.lookupUpdate(n)
	out.NodeId = out.Ino
	if out.Nlink == 0 {
		// With Nlink == 0, newer kernels will refuse link
		// operations.
		out.Nlink = 1
	}
}