diff --git a/endpoint/endpoint_zfs_abstraction.go b/endpoint/endpoint_zfs_abstraction.go index f368c7f..de3139b 100644 --- a/endpoint/endpoint_zfs_abstraction.go +++ b/endpoint/endpoint_zfs_abstraction.go @@ -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