func (m *fileSystemMount) fillEntry(out *fuse.EntryOut) { splitDuration(m.options.EntryTimeout, &out.EntryValid, &out.EntryValidNsec) splitDuration(m.options.AttrTimeout, &out.AttrValid, &out.AttrValidNsec) m.setOwner(&out.Attr) if out.Mode&fuse.S_IFDIR == 0 && out.Nlink == 0 { out.Nlink = 1 } }
// childLookup fills entry information for a newly created child inode func (c *rawBridge) childLookup(out *fuse.EntryOut, n *Inode, context *fuse.Context) { n.Node().GetAttr((*fuse.Attr)(&out.Attr), nil, context) n.mount.fillEntry(out) out.Ino = c.fsConn().lookupUpdate(n) out.NodeId = out.Ino if out.Nlink == 0 { // With Nlink == 0, newer kernels will refuse link // operations. out.Nlink = 1 } }