prepare for flexible super block

This commit is contained in:
Chris Lu
2018-06-24 11:37:08 -07:00
parent b46cf2bb0e
commit 9ba335a7c4
5 changed files with 45 additions and 35 deletions

View File

@@ -48,11 +48,7 @@ func main() {
}
defer datFile.Close()
header := make([]byte, storage.SuperBlockSize)
if _, e := datFile.Read(header); e != nil {
glog.Fatalf("cannot read volume %s super block: %v", fileName+".dat", e)
}
superBlock, err := storage.ParseSuperBlock(header)
superBlock, err := storage.ReadSuperBlock(datFile)
if err != nil {
glog.Fatalf("cannot parse existing super block: %v", err)