diff --git a/send.go b/send.go index 5038e9e..0f324bb 100644 --- a/send.go +++ b/send.go @@ -77,7 +77,7 @@ func Send(w io.Writer, parent string, subvols ...string) error { if err != nil { return fmt.Errorf("cannot find subvolume %s: %v", rel, err) } - rootID = si.RootID + rootID = objectID(si.RootID) parentID, err = findGoodParent(mfs.f, rootID, cloneSrc) if err != nil { return fmt.Errorf("cannot find good parent for %v: %v", rel, err) @@ -205,8 +205,8 @@ func findGoodParent(mnt *os.File, rootID objectID, cloneSrc []objectID) (objectI return 0, fmt.Errorf("get parent failed: %v", err) } for _, id := range cloneSrc { - if id == parent.RootID { - return parent.RootID, nil + if id == objectID(parent.RootID) { + return objectID(parent.RootID), nil } } var ( @@ -236,10 +236,10 @@ func findGoodParent(mnt *os.File, rootID objectID, cloneSrc []objectID) (objectI } } if bestParent != nil { - return bestParent.RootID, nil + return objectID(bestParent.RootID), nil } if !parent.ParentUUID.IsZero() { - return findGoodParent(mnt, parent.RootID, cloneSrc) + return findGoodParent(mnt, objectID(parent.RootID), cloneSrc) } return 0, ErrNotFound } diff --git a/subvolume.go b/subvolume.go index 2e52886..0d2d808 100644 --- a/subvolume.go +++ b/subvolume.go @@ -204,7 +204,7 @@ func listSubVolumes(f *os.File, filter func(SubvolInfo) bool) (map[objectID]Subv // m[obj.ObjectID] = o case rootItemKey: o := m[obj.ObjectID] - o.RootID = obj.ObjectID + o.RootID = uint64(obj.ObjectID) robj := asRootItem(obj.Data).Decode() o.fillFromItem(&robj) m[obj.ObjectID] = o @@ -251,7 +251,7 @@ func listSubVolumes(f *os.File, filter func(SubvolInfo) bool) (map[objectID]Subv } type SubvolInfo struct { - RootID objectID + RootID uint64 UUID UUID ParentUUID UUID @@ -368,12 +368,12 @@ func subvolSearchByRootID(mnt *os.File, rootID objectID, path string) (*SubvolIn return nil, err } info := &SubvolInfo{ - RootID: rootID, + RootID: uint64(rootID), Path: path, } info.fillFromItem(robj) if path == "" { - info.Path, err = subvolidResolve(mnt, info.RootID) + info.Path, err = subvolidResolve(mnt, objectID(info.RootID)) } return info, err }