diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-05-09 15:28:54 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-05-09 15:28:54 -0700 |
| commit | 55e060cf619d07f47c0fa1f6e7bf74f94130edec (patch) | |
| tree | ed8a923e57c04792115a31fc3c4e35e012485947 | |
| parent | 735e65be17c7d4664462b13bfce0e660c8f6e65d (diff) | |
| download | seaweedfs-55e060cf619d07f47c0fa1f6e7bf74f94130edec.tar.xz seaweedfs-55e060cf619d07f47c0fa1f6e7bf74f94130edec.zip | |
refactor
| -rw-r--r-- | weed/filesys/dirty_page.go | 4 | ||||
| -rw-r--r-- | weed/filesys/filehandle.go | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/weed/filesys/dirty_page.go b/weed/filesys/dirty_page.go index ab191a07a..25f1d31c2 100644 --- a/weed/filesys/dirty_page.go +++ b/weed/filesys/dirty_page.go @@ -144,3 +144,7 @@ func min(x, y int64) int64 { func (pages *ContinuousDirtyPages) ReadDirtyDataAt(data []byte, startOffset int64) (maxStop int64) { return pages.intervals.ReadDataAt(data, startOffset) } + +func (pages *ContinuousDirtyPages) GetStorageOptions() (collection, replication string) { + return pages.collection, pages.replication +} diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index 3e0567dee..3ccd996ae 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -267,8 +267,7 @@ func (fh *FileHandle) doFlush(ctx context.Context, header fuse.Header) error { } entry.Attributes.Mtime = time.Now().Unix() entry.Attributes.FileMode = uint32(os.FileMode(entry.Attributes.FileMode) &^ fh.f.wfs.option.Umask) - entry.Attributes.Collection = fh.dirtyPages.collection - entry.Attributes.Replication = fh.dirtyPages.replication + entry.Attributes.Collection, entry.Attributes.Replication = fh.dirtyPages.GetStorageOptions() } request := &filer_pb.CreateEntryRequest{ |
