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.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
refactoring
Chris Lu576573711a2e
diff --git a/weed/storage/volume.go b/weed/storage/volume.goindex 2053cd6796..701d887604 100644--- a/weed/storage/volume.go+++ b/weed/storage/volume.go@@ -299,23 +299,6 @@ func (v *Volume) ContentSize() uint64 {return v.nm.ContentSize()}-func checkFile(filename string) (exists, canRead, canWrite bool, modTime time.Time) {- exists = true- fi, err := os.Stat(filename)- if os.IsNotExist(err) {- exists = false- return- }- if fi.Mode()&0400 != 0 {- canRead = true- }- if fi.Mode()&0200 != 0 {- canWrite = true- }- modTime = fi.ModTime()- return-}-// volume is expired if modified time + volume ttl < now// except when volume is empty// or when the volume does not have a ttldiff --git a/weed/storage/volume_loading.go b/weed/storage/volume_loading.goindex 9684716205..f2099de83d 100644--- a/weed/storage/volume_loading.go+++ b/weed/storage/volume_loading.go@@ -3,6 +3,7 @@ package storageimport ("fmt""os"+ "time""github.com/chrislusf/seaweedfs/weed/glog")@@ -87,3 +88,20 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind}return e}++func checkFile(filename string) (exists, canRead, canWrite bool, modTime time.Time) {+ exists = true+ fi, err := os.Stat(filename)+ if os.IsNotExist(err) {+ exists = false+ return+ }+ if fi.Mode()&0400 != 0 {+ canRead = true+ }+ if fi.Mode()&0200 != 0 {+ canWrite = true+ }+ modTime = fi.ModTime()+ return+}