diff options
Diffstat (limited to 'go/src')
-rw-r--r-- | go/src/cow-dedupe/dedupe.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/go/src/cow-dedupe/dedupe.go b/go/src/cow-dedupe/dedupe.go index 62fd85d..ba7701c 100644 --- a/go/src/cow-dedupe/dedupe.go +++ b/go/src/cow-dedupe/dedupe.go @@ -47,22 +47,24 @@ func getFiemaps(paths []string) map[string][]string { errhandle(cmd.Start()) rd := bufio.NewReader(stdout) for { + // read filename filename, err := rd.ReadString('\x00') if filename == "" && err == io.EOF { break } + errhandle(err) filename = strings.TrimSuffix(filename, "\x00") if !strings.HasPrefix(filename, "/") { panic("ugly filename") } - errhandle(err) + // read extents fiemap, err := rd.ReadString('\x00') + errhandle(err) fiemap = strings.TrimSuffix(fiemap, "\x00") if !(strings.HasPrefix(fiemap, "logical=") || fiemap == "") { panic("ugly fiemap") } - errhandle(err) - + // do stuff ret[fiemap] = append(ret[fiemap], filename) cnt++ sl.Put(fmt.Sprintf("Mapping extents... %d", cnt)) @@ -133,6 +135,7 @@ func main() { fiemap2filenames := getFiemaps(os.Args[1:]) + fmt.Fprintf(os.Stderr, "building list of spanning files...") filename2fiemap := map[string]string{} for fiemap, filenames := range fiemap2filenames { for _, filename := range filenames { @@ -150,6 +153,7 @@ func main() { i++ } + fmt.Fprintf(os.Stderr, " done\n") checksum2filenames := getChecksums(spanningFiles) checksum2fiemaps := map[string][]string{} |