Cache uid and gid for top directories in internal/fuse

This commit is contained in:
greatroar
2020-02-17 16:26:53 +01:00
parent f2bf06a419
commit 1b502fa9ef
5 changed files with 64 additions and 32 deletions

View File

@@ -98,8 +98,6 @@ func newDirFromSnapshot(ctx context.Context, root *Root, inode uint64, snapshot
return &dir{
root: root,
node: &restic.Node{
UID: uint32(os.Getuid()),
GID: uint32(os.Getgid()),
AccessTime: snapshot.Time,
ModTime: snapshot.Time,
ChangeTime: snapshot.Time,
@@ -114,11 +112,8 @@ func (d *dir) Attr(ctx context.Context, a *fuse.Attr) error {
debug.Log("called")
a.Inode = d.inode
a.Mode = os.ModeDir | d.node.Mode
if !d.root.cfg.OwnerIsRoot {
a.Uid = d.node.UID
a.Gid = d.node.GID
}
a.Uid = d.root.uid
a.Gid = d.root.gid
a.Atime = d.node.AccessTime
a.Ctime = d.node.ChangeTime
a.Mtime = d.node.ModTime