From: Robert Obkircher <r.obkircher@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH v1 proxmox-backup 1/3] client: pxar: improve variable names
Date: Wed, 6 May 2026 13:49:24 +0200 [thread overview]
Message-ID: <20260506115016.171006-2-r.obkircher@proxmox.com> (raw)
In-Reply-To: <20260506115016.171006-1-r.obkircher@proxmox.com>
The Option can hold at most one result, and the closure computes more
than just the mode.
Signed-off-by: Robert Obkircher <r.obkircher@proxmox.com>
---
pbs-client/src/pxar/create.rs | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/pbs-client/src/pxar/create.rs b/pbs-client/src/pxar/create.rs
index d18021c4c..08c5c9b44 100644
--- a/pbs-client/src/pxar/create.rs
+++ b/pbs-client/src/pxar/create.rs
@@ -676,9 +676,9 @@ impl Archiver {
let match_path = PathBuf::from("/").join(full_path.clone());
- let mut stat_results: Option<FileStat> = None;
+ let mut stat_result: Option<FileStat> = None;
- let get_file_mode = || {
+ let do_stat = || {
nix::sys::stat::fstatat(
Some(dir_fd),
file_name,
@@ -689,9 +689,9 @@ impl Archiver {
let match_result = self
.patterns
.matches(match_path.as_os_str().as_bytes(), || {
- Ok::<_, Errno>(match &stat_results {
+ Ok::<_, Errno>(match &stat_result {
Some(result) => result.st_mode,
- None => stat_results.insert(get_file_mode()?).st_mode,
+ None => stat_result.insert(do_stat()?).st_mode,
})
});
@@ -711,10 +711,10 @@ impl Archiver {
}
}
- let stat = match stat_results {
- Some(mode) => mode,
- None => match get_file_mode() {
- Ok(mode) => mode,
+ let stat = match stat_result {
+ Some(stat) => stat,
+ None => match do_stat() {
+ Ok(stat) => stat,
Err(Errno::ESTALE) => {
self.report_stale_file_handle(Some(&full_path));
continue;
--
2.47.3
next prev parent reply other threads:[~2026-05-06 11:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-06 11:49 [PATCH v1 proxmox-backup 0/3] improve fstatat error handling Robert Obkircher
2026-05-06 11:49 ` Robert Obkircher [this message]
2026-05-07 8:38 ` [PATCH v1 proxmox-backup 1/3] client: pxar: improve variable names Christian Ebner
2026-05-06 11:49 ` [PATCH v1 proxmox-backup 2/3] client: pxar: consistently ignore vanished files and warn about them Robert Obkircher
2026-05-07 8:38 ` Christian Ebner
2026-05-07 15:50 ` Robert Obkircher
2026-05-08 9:38 ` Christian Ebner
2026-05-08 11:40 ` Robert Obkircher
2026-05-08 13:26 ` Christian Ebner
2026-05-08 14:03 ` Robert Obkircher
2026-05-08 14:12 ` Christian Ebner
2026-05-06 11:49 ` [PATCH v1 proxmox-backup 3/3] client: pxar: skip files on fstatat permission errors Robert Obkircher
2026-05-07 8:42 ` Christian Ebner
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=20260506115016.171006-2-r.obkircher@proxmox.com \
--to=r.obkircher@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.