aboutsummaryrefslogtreecommitdiff
path: root/weed/filer2
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-12-25 22:45:44 -0800
committerChris Lu <chris.lu@gmail.com>2018-12-25 22:45:44 -0800
commit253f190f48ca1f66d1aa16ed423f43f01f710178 (patch)
treea62278f3c42510a52d4ed349c65e2567aa59f741 /weed/filer2
parenta508d560216f1f44b37aaefcc0d446a357adad57 (diff)
downloadseaweedfs-253f190f48ca1f66d1aa16ed423f43f01f710178.tar.xz
seaweedfs-253f190f48ca1f66d1aa16ed423f43f01f710178.zip
weed mount add symlink support
Diffstat (limited to 'weed/filer2')
-rw-r--r--weed/filer2/entry.go23
-rw-r--r--weed/filer2/entry_codec.go24
2 files changed, 25 insertions, 22 deletions
diff --git a/weed/filer2/entry.go b/weed/filer2/entry.go
index f5c883d44..f17a11727 100644
--- a/weed/filer2/entry.go
+++ b/weed/filer2/entry.go
@@ -8,17 +8,18 @@ import (
)
type Attr struct {
- Mtime time.Time // time of last modification
- Crtime time.Time // time of creation (OS X only)
- Mode os.FileMode // file mode
- Uid uint32 // owner uid
- Gid uint32 // group gid
- Mime string // mime type
- Replication string // replication
- Collection string // collection name
- TtlSec int32 // ttl in seconds
- UserName string
- GroupNames []string
+ Mtime time.Time // time of last modification
+ Crtime time.Time // time of creation (OS X only)
+ Mode os.FileMode // file mode
+ Uid uint32 // owner uid
+ Gid uint32 // group gid
+ Mime string // mime type
+ Replication string // replication
+ Collection string // collection name
+ TtlSec int32 // ttl in seconds
+ UserName string
+ GroupNames []string
+ SymlinkTarget string
}
func (attr Attr) IsDirectory() bool {
diff --git a/weed/filer2/entry_codec.go b/weed/filer2/entry_codec.go
index 71b0dea40..e50b3fa9a 100644
--- a/weed/filer2/entry_codec.go
+++ b/weed/filer2/entry_codec.go
@@ -35,17 +35,18 @@ func (entry *Entry) DecodeAttributesAndChunks(blob []byte) error {
func EntryAttributeToPb(entry *Entry) *filer_pb.FuseAttributes {
return &filer_pb.FuseAttributes{
- Crtime: entry.Attr.Crtime.Unix(),
- Mtime: entry.Attr.Mtime.Unix(),
- FileMode: uint32(entry.Attr.Mode),
- Uid: entry.Uid,
- Gid: entry.Gid,
- Mime: entry.Mime,
- Collection: entry.Attr.Collection,
- Replication: entry.Attr.Replication,
- TtlSec: entry.Attr.TtlSec,
- UserName: entry.Attr.UserName,
- GroupName: entry.Attr.GroupNames,
+ Crtime: entry.Attr.Crtime.Unix(),
+ Mtime: entry.Attr.Mtime.Unix(),
+ FileMode: uint32(entry.Attr.Mode),
+ Uid: entry.Uid,
+ Gid: entry.Gid,
+ Mime: entry.Mime,
+ Collection: entry.Attr.Collection,
+ Replication: entry.Attr.Replication,
+ TtlSec: entry.Attr.TtlSec,
+ UserName: entry.Attr.UserName,
+ GroupName: entry.Attr.GroupNames,
+ SymlinkTarget: entry.Attr.SymlinkTarget,
}
}
@@ -64,6 +65,7 @@ func PbToEntryAttribute(attr *filer_pb.FuseAttributes) Attr {
t.TtlSec = attr.TtlSec
t.UserName = attr.UserName
t.GroupNames = attr.GroupName
+ t.SymlinkTarget = attr.SymlinkTarget
return t
}