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.go | |
| parent | c7d7b1a0f6e396e481c184c419e89675435f0e18 (diff) | |
| download | seaweedfs-5e239afdfc64ef39c5d4f41ec16410e726614eee.tar.xz seaweedfs-5e239afdfc64ef39c5d4f41ec16410e726614eee.zip | |
hardlink works now
Diffstat (limited to 'weed/filer/entry.go')
| -rw-r--r-- | weed/filer/entry.go | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/weed/filer/entry.go b/weed/filer/entry.go index 4a73de19a..45ede0e8e 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: int64(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, } } |
