endpoint: zfs abstraction: use new api (fixup)

This commit is contained in:
Christian Schwarz 2020-04-05 19:58:59 +02:00
parent b16a9ede46
commit f70393378f

View File

@ -567,8 +567,18 @@ func listAbstractionsImplFS(ctx context.Context, fs string, query *ListZFSHoldsA
return
}
// we need filesystem versions for any abstraction type
fsvs, err := zfs.ZFSListFilesystemVersions(fsp, nil)
whatTypes := zfs.VersionTypeSet{}
for what := range query.What {
if e := what.BookmarkExtractor(); e != nil {
whatTypes[zfs.Bookmark] = true
}
if e := what.HoldExtractor(); e != nil {
whatTypes[zfs.Snapshot] = true
}
}
fsvs, err := zfs.ZFSListFilesystemVersions(fsp, zfs.ListFilesystemVersionsOptions{
Types: whatTypes,
})
if err != nil {
errCb(err, fs, "list filesystem versions")
return