|
|
@ -461,7 +461,8 @@ func (s *Store) GetVolumeSizeLimit() uint64 { |
|
|
|
func (s *Store) MaybeAdjustVolumeMax() (hasChanges bool) { |
|
|
|
volumeSizeLimit := s.GetVolumeSizeLimit() |
|
|
|
for _, diskLocation := range s.Locations { |
|
|
|
if diskLocation.MaxVolumeCount == 0 { |
|
|
|
if diskLocation.OriginalMaxVolumeCount == 0 { |
|
|
|
currentMaxVolumeCount := diskLocation.MaxVolumeCount |
|
|
|
diskStatus := stats.NewDiskStatus(diskLocation.Directory) |
|
|
|
unusedSpace := diskLocation.UnUsedSpace(volumeSizeLimit) |
|
|
|
unclaimedSpaces := int64(diskStatus.Free) - int64(unusedSpace) |
|
|
@ -473,7 +474,7 @@ func (s *Store) MaybeAdjustVolumeMax() (hasChanges bool) { |
|
|
|
diskLocation.MaxVolumeCount = maxVolumeCount |
|
|
|
glog.V(0).Infof("disk %s max %d unclaimedSpace:%dMB, unused:%dMB volumeSizeLimit:%dMB", |
|
|
|
diskLocation.Directory, maxVolumeCount, unclaimedSpaces/1024/1024, unusedSpace/1024/1024, volumeSizeLimit/1024/1024) |
|
|
|
hasChanges = true |
|
|
|
hasChanges = hasChanges || currentMaxVolumeCount != diskLocation.MaxVolumeCount |
|
|
|
} |
|
|
|
} |
|
|
|
return |
|
|
|