diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-09-24 03:06:44 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-09-24 03:06:48 -0700 |
| commit | 5e239afdfc64ef39c5d4f41ec16410e726614eee (patch) | |
| tree | 8f1088f327777603dbdcb1d137ddc26efd18dfa6 /weed/filer/entry_codec.go | |
| parent | c7d7b1a0f6e396e481c184c419e89675435f0e18 (diff) | |
| download | seaweedfs-5e239afdfc64ef39c5d4f41ec16410e726614eee.tar.xz seaweedfs-5e239afdfc64ef39c5d4f41ec16410e726614eee.zip | |
hardlink works now
Diffstat (limited to 'weed/filer/entry_codec.go')
| -rw-r--r-- | weed/filer/entry_codec.go | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/weed/filer/entry_codec.go b/weed/filer/entry_codec.go index fb6448b30..21531ad7a 100644 --- a/weed/filer/entry_codec.go +++ b/weed/filer/entry_codec.go @@ -13,9 +13,11 @@ import ( func (entry *Entry) EncodeAttributesAndChunks() ([]byte, error) { message := &filer_pb.Entry{ - Attributes: EntryAttributeToPb(entry), - Chunks: entry.Chunks, - Extended: entry.Extended, + Attributes: EntryAttributeToPb(entry), + Chunks: entry.Chunks, + Extended: entry.Extended, + HardLinkId: int64(entry.HardLinkId), + HardLinkCounter: entry.HardLinkCounter, } return proto.Marshal(message) } @@ -34,6 +36,9 @@ func (entry *Entry) DecodeAttributesAndChunks(blob []byte) error { entry.Chunks = message.Chunks + entry.HardLinkId = HardLinkId(message.HardLinkId) + entry.HardLinkCounter = message.HardLinkCounter + return nil } @@ -61,6 +66,10 @@ func PbToEntryAttribute(attr *filer_pb.FuseAttributes) Attr { t := Attr{} + if attr == nil { + return t + } + t.Crtime = time.Unix(attr.Crtime, 0) t.Mtime = time.Unix(attr.Mtime, 0) t.Mode = os.FileMode(attr.FileMode) @@ -106,6 +115,13 @@ func EqualEntry(a, b *Entry) bool { return false } } + + if a.HardLinkId != b.HardLinkId { + return false + } + if a.HardLinkCounter != b.HardLinkCounter { + return false + } return true } |
