diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-05-10 15:03:31 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-05-10 15:03:31 -0700 |
| commit | 1ca1ec906ade638491dfc590af314b9d3808e11d (patch) | |
| tree | f94ff6da657c7f7a8669389de65f6eb4b4e9088d /weed/filesys/dir.go | |
| parent | 69b7dd398d9fa34635687f05e29ead35605bb52e (diff) | |
| download | seaweedfs-1ca1ec906ade638491dfc590af314b9d3808e11d.tar.xz seaweedfs-1ca1ec906ade638491dfc590af314b9d3808e11d.zip | |
add weedfuse
Diffstat (limited to 'weed/filesys/dir.go')
| -rw-r--r-- | weed/filesys/dir.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index 7b6cf2000..0e9e92e16 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -34,9 +34,7 @@ func (dir *Dir) Attr(ctx context.Context, attr *fuse.Attr) error { attr.Valid = time.Second if dir.Path == dir.wfs.option.FilerMountRootPath { - attr.Uid = dir.wfs.option.MountUid - attr.Gid = dir.wfs.option.MountGid - attr.Mode = dir.wfs.option.MountMode + dir.setRootDirAttributes(attr) return nil } @@ -72,6 +70,16 @@ func (dir *Dir) Attr(ctx context.Context, attr *fuse.Attr) error { return nil } +func (dir *Dir) setRootDirAttributes(attr *fuse.Attr) { + attr.Uid = dir.wfs.option.MountUid + attr.Gid = dir.wfs.option.MountGid + attr.Mode = dir.wfs.option.MountMode + attr.Crtime = dir.wfs.option.MountCtime + attr.Ctime = dir.wfs.option.MountCtime + attr.Mtime = dir.wfs.option.MountMtime + attr.Atime = dir.wfs.option.MountMtime +} + func (dir *Dir) newFile(name string, entry *filer_pb.Entry) *File { return &File{ Name: name, |
