hardlink works now
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user