aboutsummaryrefslogtreecommitdiff
path: root/verifysetup/cmd/setup.go
diff options
context:
space:
mode:
authoraxtloss <axtlos@getcryst.al>2024-02-17 19:07:53 +0100
committeraxtloss <axtlos@getcryst.al>2024-02-17 19:14:02 +0100
commit63d3b78538e2e40bd199ee771bcdf9413e542319 (patch)
tree2381993e25d50aa2f40f478babf52ed4e30c4088 /verifysetup/cmd/setup.go
parentf57eeabfad55a691ec62e2bda98d4f467d3729b3 (diff)
downloadfsverify-63d3b78538e2e40bd199ee771bcdf9413e542319.tar.gz
fsverify-63d3b78538e2e40bd199ee771bcdf9413e542319.tar.bz2
Multithread fsverify
Diffstat (limited to 'verifysetup/cmd/setup.go')
-rw-r--r--verifysetup/cmd/setup.go16
1 files changed, 4 insertions, 12 deletions
diff --git a/verifysetup/cmd/setup.go b/verifysetup/cmd/setup.go
index 149f41a..81c4dff 100644
--- a/verifysetup/cmd/setup.go
+++ b/verifysetup/cmd/setup.go
@@ -58,17 +58,6 @@ func checksumBlock(blockStart int, blockEnd int, bundleSize int, diskBytes []byt
fmt.Printf("Node from %d to %d finished.\n", blockStart, blockEnd)
}
-func copyByteArea(start int, end int, reader *bytes.Reader) ([]byte, error) {
- bytes := make([]byte, end-start)
- n, err := reader.ReadAt(bytes, int64(start))
- if err != nil {
- return nil, err
- } else if n != end-start {
- return nil, fmt.Errorf("Unable to read requested size. Got %d, expected %d", n, end-start)
- }
- return bytes, nil
-}
-
func SetupCommand(_ *cobra.Command, args []string) error {
if len(args) != 2 {
return fmt.Errorf("Usage: verifysetup setup [partition] [procCount]")
@@ -104,7 +93,7 @@ func SetupCommand(_ *cobra.Command, args []string) error {
var waitGroup sync.WaitGroup
nodeChannels := make([]chan verify.Node, procCount+1)
for i := 0; i < procCount; i++ {
- diskBytesCopy, err := copyByteArea(i*(int(bundleSize)), (i+1)*(int(bundleSize)), reader)
+ diskBytesCopy, err := verify.CopyByteArea(i*(int(bundleSize)), (i+1)*(int(bundleSize)), reader)
if err != nil {
return err
}
@@ -141,5 +130,8 @@ func SetupCommand(_ *cobra.Command, args []string) error {
return err
}
fmt.Println(string(signature))
+
+ //header, err := core.
+
return nil
}