diff options
Diffstat (limited to 'weed/storage/disk_location.go')
| -rw-r--r-- | weed/storage/disk_location.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/weed/storage/disk_location.go b/weed/storage/disk_location.go index 02f5f5923..aac824318 100644 --- a/weed/storage/disk_location.go +++ b/weed/storage/disk_location.go @@ -386,6 +386,19 @@ func (l *DiskLocation) VolumesLen() int { return len(l.volumes) } +func (l *DiskLocation) LocalVolumesLen() int { + l.volumesLock.RLock() + defer l.volumesLock.RUnlock() + + count := 0 + for _, v := range l.volumes { + if !v.HasRemoteFile() { + count++ + } + } + return count +} + func (l *DiskLocation) SetStopping() { l.volumesLock.Lock() for _, v := range l.volumes { |
