Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

refactor

Chris Lu55e060cf619d
diff --git a/weed/filesys/dirty_page.go b/weed/filesys/dirty_page.go
index ab191a07a6..25f1d31c28 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 3e0567dee6..3ccd996ae5 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{