aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume_super_block.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-12-08 19:44:16 -0800
committerChris Lu <chris.lu@gmail.com>2019-12-08 19:44:16 -0800
commit10bd3c6b4b49ca94dacbd2e065544f1df259fe3c (patch)
tree8ee126a13124485d025b47366fad686c589a6058 /weed/storage/volume_super_block.go
parent2b8e20f1227648b977fd2a95feba5d6b55e4f5c1 (diff)
downloadseaweedfs-10bd3c6b4b49ca94dacbd2e065544f1df259fe3c.tar.xz
seaweedfs-10bd3c6b4b49ca94dacbd2e065544f1df259fe3c.zip
refactoring
Diffstat (limited to 'weed/storage/volume_super_block.go')
-rw-r--r--weed/storage/volume_super_block.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/storage/volume_super_block.go b/weed/storage/volume_super_block.go
index 911cd5455..6e5122190 100644
--- a/weed/storage/volume_super_block.go
+++ b/weed/storage/volume_super_block.go
@@ -78,7 +78,7 @@ func (v *Volume) maybeWriteSuperBlock() error {
datSize, _, e := v.DataBackend.GetStat()
if e != nil {
- glog.V(0).Infof("failed to stat datafile %s: %v", v.DataBackend.String(), e)
+ glog.V(0).Infof("failed to stat datafile %s: %v", v.DataBackend.Name(), e)
return e
}
if datSize == 0 {
@@ -87,7 +87,7 @@ func (v *Volume) maybeWriteSuperBlock() error {
if e != nil && os.IsPermission(e) {
//read-only, but zero length - recreate it!
var dataFile *os.File
- if dataFile, e = os.Create(v.DataBackend.String()); e == nil {
+ if dataFile, e = os.Create(v.DataBackend.Name()); e == nil {
v.DataBackend = backend.NewDiskFile(dataFile)
if _, e = v.DataBackend.WriteAt(v.SuperBlock.Bytes(), 0); e == nil {
v.readOnly = false
@@ -108,7 +108,7 @@ func ReadSuperBlock(datBackend backend.BackendStorageFile) (superBlock SuperBloc
header := make([]byte, _SuperBlockSize)
if _, e := datBackend.ReadAt(header, 0); e != nil {
- err = fmt.Errorf("cannot read volume %s super block: %v", datBackend.String(), e)
+ err = fmt.Errorf("cannot read volume %s super block: %v", datBackend.Name(), e)
return
}
@@ -127,7 +127,7 @@ func ReadSuperBlock(datBackend backend.BackendStorageFile) (superBlock SuperBloc
superBlock.Extra = &master_pb.SuperBlockExtra{}
err = proto.Unmarshal(extraData, superBlock.Extra)
if err != nil {
- err = fmt.Errorf("cannot read volume %s super block extra: %v", datBackend.String(), err)
+ err = fmt.Errorf("cannot read volume %s super block extra: %v", datBackend.Name(), err)
return
}
}