simplify volume.go file

This commit is contained in:
Chris Lu 2012-08-23 23:24:32 -07:00
parent 0c32e2e965
commit 9b4ce65882
3 changed files with 24 additions and 13 deletions

View file

@ -5,7 +5,6 @@ import (
"log"
"os"
"path"
"strconv"
"sync"
)
@ -13,18 +12,6 @@ const (
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 {
Id VolumeId
dir string

View 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)
}

View file

@ -0,0 +1,10 @@
package storage
import (
)
type VolumeInfo struct {
Id VolumeId
Size int64
}