zfs,endpoint: use zfs destroy batch syntax if available

refs #72
This commit is contained in:
Christian Schwarz
2019-08-12 01:19:08 +02:00
parent 77d3a1ad4d
commit 07956c2299
7 changed files with 594 additions and 38 deletions

View File

@ -154,15 +154,3 @@ func ZFSListFilesystemVersions(fs *DatasetPath, filter FilesystemVersionFilter)
}
return
}
func ZFSDestroyFilesystemVersion(filesystem *DatasetPath, version *FilesystemVersion) (err error) {
datasetPath := version.ToAbsPath(filesystem)
// Sanity check...
if !strings.ContainsAny(datasetPath, "@#") {
return fmt.Errorf("sanity check failed: no @ or # character found in %q", datasetPath)
}
return ZFSDestroy(datasetPath)
}