aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/disk_location.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-02-09 11:38:42 -0800
committerChris Lu <chris.lu@gmail.com>2021-02-09 11:38:42 -0800
commit2bf5ea87d6788fc1b82d36ffaed42ce0345b955e (patch)
treeb83fdc9ec478696ff43ebdf05f556ac6cd4e5724 /weed/storage/disk_location.go
parentd221a937df38ff587e2392a313681b0a0f48138b (diff)
parent821c46edf10097200b986bd17dc01d3991cf57ff (diff)
downloadseaweedfs-2bf5ea87d6788fc1b82d36ffaed42ce0345b955e.tar.xz
seaweedfs-2bf5ea87d6788fc1b82d36ffaed42ce0345b955e.zip
Merge branch 'support_ssd_volume'
Diffstat (limited to 'weed/storage/disk_location.go')
-rw-r--r--weed/storage/disk_location.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/weed/storage/disk_location.go b/weed/storage/disk_location.go
index 76eab64a3..a7be3a559 100644
--- a/weed/storage/disk_location.go
+++ b/weed/storage/disk_location.go
@@ -19,6 +19,7 @@ import (
type DiskLocation struct {
Directory string
IdxDirectory string
+ DiskType DiskType
MaxVolumeCount int
OriginalMaxVolumeCount int
MinFreeSpacePercent float32
@@ -32,7 +33,7 @@ type DiskLocation struct {
isDiskSpaceLow bool
}
-func NewDiskLocation(dir string, maxVolumeCount int, minFreeSpacePercent float32, idxDir string) *DiskLocation {
+func NewDiskLocation(dir string, maxVolumeCount int, minFreeSpacePercent float32, idxDir string, diskType DiskType) *DiskLocation {
dir = util.ResolvePath(dir)
if idxDir == "" {
idxDir = dir
@@ -42,6 +43,7 @@ func NewDiskLocation(dir string, maxVolumeCount int, minFreeSpacePercent float32
location := &DiskLocation{
Directory: dir,
IdxDirectory: idxDir,
+ DiskType: diskType,
MaxVolumeCount: maxVolumeCount,
OriginalMaxVolumeCount: maxVolumeCount,
MinFreeSpacePercent: minFreeSpacePercent,
@@ -371,3 +373,10 @@ func (l *DiskLocation) CheckDiskSpace() {
}
}
+
+func (l *DiskLocation) GetDiskType() string {
+ if l.DiskType == SsdType {
+ return "SSD"
+ }
+ return "HDD"
+}