[pbs-devel] [PATCH proxmox-backup v4 01/14] datastore: limit scope of snapshot/group destroy methods to crate
Christian Ebner
c.ebner at proxmox.com
Mon Nov 10 12:56:14 CET 2025
Commit 800e960c5 ("api/datastore: move snapshot deletion into
dedicated datastore helper") moved the snapshot destroy and the group
destroy was already only used inside. By scoping these they are
better encapsulated to limit potential future use.
Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
pbs-datastore/src/backup_info.rs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/pbs-datastore/src/backup_info.rs b/pbs-datastore/src/backup_info.rs
index 4b10b6435..29ca6f901 100644
--- a/pbs-datastore/src/backup_info.rs
+++ b/pbs-datastore/src/backup_info.rs
@@ -221,7 +221,10 @@ impl BackupGroup {
///
/// Returns `BackupGroupDeleteStats`, containing the number of deleted snapshots
/// and number of protected snaphsots, which therefore were not removed.
- pub fn destroy(&self, backend: &DatastoreBackend) -> Result<BackupGroupDeleteStats, Error> {
+ pub(crate) fn destroy(
+ &self,
+ backend: &DatastoreBackend,
+ ) -> Result<BackupGroupDeleteStats, Error> {
let _guard = self
.lock()
.with_context(|| format!("while destroying group '{self:?}'"))?;
@@ -611,7 +614,7 @@ impl BackupDir {
/// Destroy the whole snapshot, bails if it's protected
///
/// Setting `force` to true skips locking and thus ignores if the backup is currently in use.
- pub fn destroy(&self, force: bool, backend: &DatastoreBackend) -> Result<(), Error> {
+ pub(crate) fn destroy(&self, force: bool, backend: &DatastoreBackend) -> Result<(), Error> {
let (_guard, _manifest_guard);
if !force {
_guard = self
--
2.47.3
More information about the pbs-devel
mailing list