From 9b4ce658826067910e913f1416a1bb80150f879e Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 23 Aug 2012 23:24:32 -0700 Subject: [PATCH] simplify volume.go file --- weed-fs/src/pkg/storage/volume.go | 13 ------------- weed-fs/src/pkg/storage/volume_id.go | 14 ++++++++++++++ weed-fs/src/pkg/storage/volume_info.go | 10 ++++++++++ 3 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 weed-fs/src/pkg/storage/volume_id.go create mode 100644 weed-fs/src/pkg/storage/volume_info.go diff --git a/weed-fs/src/pkg/storage/volume.go b/weed-fs/src/pkg/storage/volume.go index 519ebab4d..a77cdd07c 100644 --- a/weed-fs/src/pkg/storage/volume.go +++ b/weed-fs/src/pkg/storage/volume.go @@ -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 diff --git a/weed-fs/src/pkg/storage/volume_id.go b/weed-fs/src/pkg/storage/volume_id.go new file mode 100644 index 000000000..952663a81 --- /dev/null +++ b/weed-fs/src/pkg/storage/volume_id.go @@ -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) +} diff --git a/weed-fs/src/pkg/storage/volume_info.go b/weed-fs/src/pkg/storage/volume_info.go new file mode 100644 index 000000000..cc2cccdca --- /dev/null +++ b/weed-fs/src/pkg/storage/volume_info.go @@ -0,0 +1,10 @@ +package storage + +import ( + +) + +type VolumeInfo struct { + Id VolumeId + Size int64 +}