diff options
| author | Dmitriy Pavlov <Dimonyga@gmail.com> | 2025-09-05 16:37:05 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-05 06:37:05 -0700 |
| commit | 0ac3c654801e63bdf4b9284b811fd98347987ffc (patch) | |
| tree | 5df242890e2903ed91f9db1125bb81382b07216c | |
| parent | b3b1316b54840409a0fca079108dc2b4868b558f (diff) | |
| download | seaweedfs-0ac3c654801e63bdf4b9284b811fd98347987ffc.tar.xz seaweedfs-0ac3c654801e63bdf4b9284b811fd98347987ffc.zip | |
revert changes collectStatForOneVolume (#7199)
| -rw-r--r-- | weed/storage/store.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/weed/storage/store.go b/weed/storage/store.go index 77cd6c824..1d625dd69 100644 --- a/weed/storage/store.go +++ b/weed/storage/store.go @@ -250,7 +250,19 @@ func collectStatForOneVolume(vid needle.VolumeId, v *Volume) (s *VolumeInfo) { DiskId: v.diskId, } s.RemoteStorageName, s.RemoteStorageKey = v.RemoteStorageNameKey() - s.Size, _, _ = v.FileStat() + + v.dataFileAccessLock.RLock() + defer v.dataFileAccessLock.RUnlock() + + if v.nm == nil { + return + } + + s.FileCount = v.nm.FileCount() + s.DeleteCount = v.nm.DeletedCount() + s.DeletedByteCount = v.nm.DeletedSize() + s.Size = v.nm.ContentSize() + return } |
