all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH backup v4 1/2] pxar-fuse: use ReplyBufState::is_full() when possible
@ 2024-02-14  8:23 Maximiliano Sandoval
  2024-02-14  8:23 ` [pbs-devel] [PATCH backup v4 2/2] api: use if-let pattern for error-only handling Maximiliano Sandoval
  2024-03-25 17:03 ` [pbs-devel] applied-series: [PATCH backup v4 1/2] pxar-fuse: use ReplyBufState::is_full() when possible Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Maximiliano Sandoval @ 2024-02-14  8:23 UTC (permalink / raw)
  To: pbs-devel

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
Differences from vN-1:
 - Separate into two commits
 - Leave unrelated changes for a follow up patch

 pbs-pxar-fuse/src/lib.rs | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/pbs-pxar-fuse/src/lib.rs b/pbs-pxar-fuse/src/lib.rs
index 98d28c57..bf196b6c 100644
--- a/pbs-pxar-fuse/src/lib.rs
+++ b/pbs-pxar-fuse/src/lib.rs
@@ -525,9 +525,11 @@ impl SessionImpl {
             let file = file?.decode_entry().await?;
             let stat = to_stat(to_inode(&file), &file)?;
             let name = file.file_name();
-            match request.add_entry(name, &stat, next, 1, f64::MAX, f64::MAX)? {
-                ReplyBufState::Ok => (),
-                ReplyBufState::Full => return Ok(lookups),
+            if request
+                .add_entry(name, &stat, next, 1, f64::MAX, f64::MAX)?
+                .is_full()
+            {
+                return Ok(lookups);
             }
             lookups.push(self.make_lookup(request.inode, stat.st_ino, &file)?);
         }
@@ -537,9 +539,11 @@ impl SessionImpl {
             let file = dir.lookup_self().await?;
             let stat = to_stat(to_inode(&file), &file)?;
             let name = OsStr::new(".");
-            match request.add_entry(name, &stat, next, 1, f64::MAX, f64::MAX)? {
-                ReplyBufState::Ok => (),
-                ReplyBufState::Full => return Ok(lookups),
+            if request
+                .add_entry(name, &stat, next, 1, f64::MAX, f64::MAX)?
+                .is_full()
+            {
+                return Ok(lookups);
             }
             lookups.push(LookupRef::clone(&dir_lookup));
         }
@@ -551,9 +555,11 @@ impl SessionImpl {
             let file = parent_dir.lookup_self().await?;
             let stat = to_stat(to_inode(&file), &file)?;
             let name = OsStr::new("..");
-            match request.add_entry(name, &stat, next, 1, f64::MAX, f64::MAX)? {
-                ReplyBufState::Ok => (),
-                ReplyBufState::Full => return Ok(lookups),
+            if request
+                .add_entry(name, &stat, next, 1, f64::MAX, f64::MAX)?
+                .is_full()
+            {
+                return Ok(lookups);
             }
             lookups.push(lookup);
         }
@@ -619,9 +625,8 @@ impl SessionImpl {
         let xattrs = self.listxattrs(request.inode).await?;
 
         for entry in xattrs {
-            match request.add_c_string(entry.name()) {
-                ReplyBufState::Ok => (),
-                ReplyBufState::Full => return Ok(ReplyBufState::Full),
+            if request.add_c_string(entry.name()).is_full() {
+                return Ok(ReplyBufState::Full);
             }
         }
 
-- 
2.39.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-25 17:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-14  8:23 [pbs-devel] [PATCH backup v4 1/2] pxar-fuse: use ReplyBufState::is_full() when possible Maximiliano Sandoval
2024-02-14  8:23 ` [pbs-devel] [PATCH backup v4 2/2] api: use if-let pattern for error-only handling Maximiliano Sandoval
2024-03-25 17:03 ` [pbs-devel] applied-series: [PATCH backup v4 1/2] pxar-fuse: use ReplyBufState::is_full() when possible Thomas Lamprecht

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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal