From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup v2 2/3] GC: rename helper to cond_sweep_chunk
Date: Wed, 15 Oct 2025 12:13:41 +0200 [thread overview]
Message-ID: <20251015101349.872639-3-f.gruenbichler@proxmox.com> (raw)
In-Reply-To: <20251015101349.872639-1-f.gruenbichler@proxmox.com>
and make it take self, to make it more clear that the chunk store should be
locked at this point.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Christian Ebner <c.ebner@proxmox.com>
---
pbs-datastore/src/chunk_store.rs | 5 +++--
pbs-datastore/src/datastore.rs | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/pbs-datastore/src/chunk_store.rs b/pbs-datastore/src/chunk_store.rs
index f8e5457b7..065eb4a08 100644
--- a/pbs-datastore/src/chunk_store.rs
+++ b/pbs-datastore/src/chunk_store.rs
@@ -408,7 +408,7 @@ impl ChunkStore {
chunk_count += 1;
- Self::check_atime_and_update_gc_status(
+ self.cond_sweep_chunk(
stat.st_atime,
min_atime,
oldest_writer,
@@ -435,7 +435,8 @@ impl ChunkStore {
/// status accordingly.
///
/// If the chunk should be removed, the [`remove_callback`] is executed.
- pub(super) fn check_atime_and_update_gc_status<T: FnOnce() -> Result<(), Error>>(
+ pub(super) fn cond_sweep_chunk<T: FnOnce() -> Result<(), Error>>(
+ &self,
atime: i64,
min_atime: i64,
oldest_writer: i64,
diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
index 21998a157..f1237af32 100644
--- a/pbs-datastore/src/datastore.rs
+++ b/pbs-datastore/src/datastore.rs
@@ -1664,7 +1664,7 @@ impl DataStore {
.extension()
.is_some_and(|ext| ext == "bad");
- ChunkStore::check_atime_and_update_gc_status(
+ self.inner.chunk_store.cond_sweep_chunk(
atime,
min_atime,
oldest_writer,
--
2.47.3
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2025-10-15 10:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-15 10:13 [pbs-devel] [PATCH proxmox-backup v2 0/3] GC refactor follow-ups Fabian Grünbichler
2025-10-15 10:13 ` [pbs-devel] [PATCH proxmox-backup v2 1/3] GC: refactor chunk removal helper Fabian Grünbichler
2025-10-15 10:13 ` Fabian Grünbichler [this message]
2025-10-15 10:13 ` [pbs-devel] [PATCH proxmox-backup v2 3/3] GC: mark cond_sweep_chunk helper as unafe Fabian Grünbichler
2025-10-15 10:50 ` [pbs-devel] [PATCH proxmox-backup v2 0/3] GC refactor follow-ups Christian Ebner
2025-10-15 12:57 ` [pbs-devel] applied-series: " Fabian Grünbichler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251015101349.872639-3-f.gruenbichler@proxmox.com \
--to=f.gruenbichler@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox