MCPcopy
hub / github.com/kopia/kopia / populateAttributes

Function populateAttributes

internal/fusemount/fusefs.go:50–60  ·  view source on GitHub ↗
(a *fuse.Attr, e fs.Entry)

Source from the content-addressed store, hash-verified

48}
49
50func populateAttributes(a *fuse.Attr, e fs.Entry) {
51 a.Mode = goModeToUnixMode(e.Mode())
52 a.Size = uint64(e.Size()) //nolint:gosec
53 a.Mtime = uint64(e.ModTime().Unix()) //nolint:gosec
54 a.Ctime = a.Mtime
55 a.Atime = a.Mtime
56 a.Nlink = 1
57 a.Uid = e.Owner().UserID
58 a.Gid = e.Owner().GroupID
59 a.Blocks = (a.Size + fakeBlockSize - 1) / fakeBlockSize
60}
61
62func (n *fuseNode) Getattr(_ context.Context, _ gofusefs.FileHandle, a *fuse.AttrOut) syscall.Errno {
63 populateAttributes(&a.Attr, n.entry)

Callers 2

GetattrMethod · 0.85
LookupMethod · 0.85

Calls 5

goModeToUnixModeFunction · 0.85
OwnerMethod · 0.65
ModeMethod · 0.45
SizeMethod · 0.45
ModTimeMethod · 0.45

Tested by

no test coverage detected