aboutsummaryrefslogtreecommitdiff
path: root/weed/filer/entry.go
diff options
context:
space:
mode:
authorhilimd <68371223+hilimd@users.noreply.github.com>2020-09-25 09:45:56 +0800
committerGitHub <noreply@github.com>2020-09-25 09:45:56 +0800
commit76e24a5660a2192603b7d6d84aef1924ab95cb94 (patch)
tree72e1b320c3487aa5f6cb3cd5fc849bfd94108ec8 /weed/filer/entry.go
parent48c578410fea2128f81356250b2cd9d56074d878 (diff)
parent043b0631369bec00b33eb53cdf2cdef3eced006c (diff)
downloadseaweedfs-76e24a5660a2192603b7d6d84aef1924ab95cb94.tar.xz
seaweedfs-76e24a5660a2192603b7d6d84aef1924ab95cb94.zip
Merge pull request #20 from chrislusf/master
sync
Diffstat (limited to 'weed/filer/entry.go')
-rw-r--r--weed/filer/entry.go34
1 files changed, 26 insertions, 8 deletions
diff --git a/weed/filer/entry.go b/weed/filer/entry.go
index 4a73de19a..421e51432 100644
--- a/weed/filer/entry.go
+++ b/weed/filer/entry.go
@@ -37,6 +37,9 @@ type Entry struct {
// the following is for files
Chunks []*filer_pb.FileChunk `json:"chunks,omitempty"`
+
+ HardLinkId HardLinkId
+ HardLinkCounter int32
}
func (entry *Entry) Size() uint64 {
@@ -56,11 +59,13 @@ func (entry *Entry) ToProtoEntry() *filer_pb.Entry {
return nil
}
return &filer_pb.Entry{
- Name: entry.FullPath.Name(),
- IsDirectory: entry.IsDirectory(),
- Attributes: EntryAttributeToPb(entry),
- Chunks: entry.Chunks,
- Extended: entry.Extended,
+ Name: entry.FullPath.Name(),
+ IsDirectory: entry.IsDirectory(),
+ Attributes: EntryAttributeToPb(entry),
+ Chunks: entry.Chunks,
+ Extended: entry.Extended,
+ HardLinkId: entry.HardLinkId,
+ HardLinkCounter: entry.HardLinkCounter,
}
}
@@ -75,11 +80,24 @@ func (entry *Entry) ToProtoFullEntry() *filer_pb.FullEntry {
}
}
+func (entry *Entry) Clone() *Entry {
+ return &Entry{
+ FullPath: entry.FullPath,
+ Attr: entry.Attr,
+ Chunks: entry.Chunks,
+ Extended: entry.Extended,
+ HardLinkId: entry.HardLinkId,
+ HardLinkCounter: entry.HardLinkCounter,
+ }
+}
+
func FromPbEntry(dir string, entry *filer_pb.Entry) *Entry {
return &Entry{
- FullPath: util.NewFullPath(dir, entry.Name),
- Attr: PbToEntryAttribute(entry.Attributes),
- Chunks: entry.Chunks,
+ FullPath: util.NewFullPath(dir, entry.Name),
+ Attr: PbToEntryAttribute(entry.Attributes),
+ Chunks: entry.Chunks,
+ HardLinkId: HardLinkId(entry.HardLinkId),
+ HardLinkCounter: entry.HardLinkCounter,
}
}