mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
simplify volume.go file
This commit is contained in:
parent
0c32e2e965
commit
9b4ce65882
|
@ -5,7 +5,6 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"strconv"
|
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -13,18 +12,6 @@ const (
|
||||||
SuperBlockSize = 8
|
SuperBlockSize = 8
|
||||||
)
|
)
|
||||||
|
|
||||||
type VolumeId uint32
|
|
||||||
type VolumeInfo struct {
|
|
||||||
Id VolumeId
|
|
||||||
Size int64
|
|
||||||
}
|
|
||||||
func NewVolumeId(vid string) (VolumeId,error) {
|
|
||||||
volumeId, err := strconv.ParseUint(vid, 10, 64)
|
|
||||||
return VolumeId(volumeId), err
|
|
||||||
}
|
|
||||||
func (vid *VolumeId) String() string{
|
|
||||||
return strconv.FormatUint(uint64(*vid), 10)
|
|
||||||
}
|
|
||||||
type Volume struct {
|
type Volume struct {
|
||||||
Id VolumeId
|
Id VolumeId
|
||||||
dir string
|
dir string
|
||||||
|
|
14
weed-fs/src/pkg/storage/volume_id.go
Normal file
14
weed-fs/src/pkg/storage/volume_id.go
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
package storage
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strconv"
|
||||||
|
)
|
||||||
|
|
||||||
|
type VolumeId uint32
|
||||||
|
func NewVolumeId(vid string) (VolumeId,error) {
|
||||||
|
volumeId, err := strconv.ParseUint(vid, 10, 64)
|
||||||
|
return VolumeId(volumeId), err
|
||||||
|
}
|
||||||
|
func (vid *VolumeId) String() string{
|
||||||
|
return strconv.FormatUint(uint64(*vid), 10)
|
||||||
|
}
|
10
weed-fs/src/pkg/storage/volume_info.go
Normal file
10
weed-fs/src/pkg/storage/volume_info.go
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
package storage
|
||||||
|
|
||||||
|
import (
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
type VolumeInfo struct {
|
||||||
|
Id VolumeId
|
||||||
|
Size int64
|
||||||
|
}
|
Loading…
Reference in a new issue