diff options
Diffstat (limited to 'weed/filesys/dir.go')
| -rw-r--r-- | weed/filesys/dir.go | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index 50ca6df5d..578c40014 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -63,7 +63,7 @@ func (dir *Dir) Attr(ctx context.Context, attr *fuse.Attr) error { attr.Gid = dir.entry.Attributes.Gid attr.Uid = dir.entry.Attributes.Uid - glog.V(4).Infof("dir Attr %s, attr: %+v", dir.FullPath(), attr) + glog.V(5).Infof("dir Attr %s, attr: %+v", dir.FullPath(), attr) return nil } @@ -101,7 +101,7 @@ func (dir *Dir) Fsync(ctx context.Context, req *fuse.FsyncRequest) error { } func (dir *Dir) newFile(name string, entry *filer_pb.Entry) fs.Node { - return dir.wfs.fsNodeCache.EnsureFsNode(util.NewFullPath(dir.FullPath(), name), func() fs.Node { + f := dir.wfs.fsNodeCache.EnsureFsNode(util.NewFullPath(dir.FullPath(), name), func() fs.Node { return &File{ Name: name, dir: dir, @@ -110,14 +110,17 @@ func (dir *Dir) newFile(name string, entry *filer_pb.Entry) fs.Node { entryViewCache: nil, } }) + f.(*File).dir = dir // in case dir node was created later + return f } func (dir *Dir) newDirectory(fullpath util.FullPath, entry *filer_pb.Entry) fs.Node { - return dir.wfs.fsNodeCache.EnsureFsNode(fullpath, func() fs.Node { + d := dir.wfs.fsNodeCache.EnsureFsNode(fullpath, func() fs.Node { return &Dir{name: entry.Name, wfs: dir.wfs, entry: entry, parent: dir} }) - + d.(*Dir).parent = dir // in case dir node was created later + return d } func (dir *Dir) Create(ctx context.Context, req *fuse.CreateRequest, @@ -237,7 +240,7 @@ func (dir *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse. return nil, fuse.ENOENT } } else { - glog.V(4).Infof("dir Lookup cache hit %s", fullFilePath) + glog.V(5).Infof("dir Lookup cache hit %s", fullFilePath) } if entry != nil { @@ -265,7 +268,7 @@ func (dir *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse. func (dir *Dir) ReadDirAll(ctx context.Context) (ret []fuse.Dirent, err error) { - glog.V(4).Infof("dir ReadDirAll %s", dir.FullPath()) + glog.V(5).Infof("dir ReadDirAll %s", dir.FullPath()) processEachEntryFn := func(entry *filer_pb.Entry, isLast bool) error { fullpath := util.NewFullPath(dir.FullPath(), entry.Name) @@ -427,7 +430,7 @@ func (dir *Dir) Listxattr(ctx context.Context, req *fuse.ListxattrRequest, resp } func (dir *Dir) Forget() { - glog.V(4).Infof("Forget dir %s", dir.FullPath()) + glog.V(5).Infof("Forget dir %s", dir.FullPath()) dir.wfs.fsNodeCache.DeleteFsNode(util.FullPath(dir.FullPath())) } |
