aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/file.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-01-19 12:06:19 -0800
committerChris Lu <chris.lu@gmail.com>2020-01-19 12:06:19 -0800
commit39edcfde4cdd867a5c36211f9e355e2a470f87d5 (patch)
treea8ed79898440f9636f13121e6c7d74c06ce499eb /weed/filesys/file.go
parente9bb0c179fff7016bc4150be8082383f1425a2c7 (diff)
downloadseaweedfs-39edcfde4cdd867a5c36211f9e355e2a470f87d5.tar.xz
seaweedfs-39edcfde4cdd867a5c36211f9e355e2a470f87d5.zip
filer: set inode
avoid "getcwd: No such file or directory"
Diffstat (limited to 'weed/filesys/file.go')
-rw-r--r--weed/filesys/file.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/filesys/file.go b/weed/filesys/file.go
index afe78ee0f..b0df344fa 100644
--- a/weed/filesys/file.go
+++ b/weed/filesys/file.go
@@ -10,6 +10,7 @@ import (
"github.com/chrislusf/seaweedfs/weed/filer2"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
+ "github.com/chrislusf/seaweedfs/weed/util"
"github.com/seaweedfs/fuse"
"github.com/seaweedfs/fuse/fs"
)
@@ -40,12 +41,13 @@ func (file *File) fullpath() string {
func (file *File) Attr(ctx context.Context, attr *fuse.Attr) error {
- glog.V(4).Infof("file Attr %s", file.fullpath())
+ glog.V(4).Infof("file Attr %s, open:%v, existing attr: %+v", file.fullpath(), file.isOpen, attr)
if err := file.maybeLoadEntry(ctx); err != nil {
return err
}
+ attr.Inode = uint64(util.HashStringToLong(file.fullpath()))
attr.Mode = os.FileMode(file.entry.Attributes.FileMode)
attr.Size = filer2.TotalSize(file.entry.Chunks)
attr.Mtime = time.Unix(file.entry.Attributes.Mtime, 0)