mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-04-30 00:23:09 +00:00
pxar-fuse: use ReplyBufState::is_full() when possible
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
0f7204a4da
commit
87b4b63e55
@ -525,9 +525,11 @@ impl SessionImpl {
|
|||||||
let file = file?.decode_entry().await?;
|
let file = file?.decode_entry().await?;
|
||||||
let stat = to_stat(to_inode(&file), &file)?;
|
let stat = to_stat(to_inode(&file), &file)?;
|
||||||
let name = file.file_name();
|
let name = file.file_name();
|
||||||
match request.add_entry(name, &stat, next, 1, f64::MAX, f64::MAX)? {
|
if request
|
||||||
ReplyBufState::Ok => (),
|
.add_entry(name, &stat, next, 1, f64::MAX, f64::MAX)?
|
||||||
ReplyBufState::Full => return Ok(lookups),
|
.is_full()
|
||||||
|
{
|
||||||
|
return Ok(lookups);
|
||||||
}
|
}
|
||||||
lookups.push(self.make_lookup(request.inode, stat.st_ino, &file)?);
|
lookups.push(self.make_lookup(request.inode, stat.st_ino, &file)?);
|
||||||
}
|
}
|
||||||
@ -537,9 +539,11 @@ impl SessionImpl {
|
|||||||
let file = dir.lookup_self().await?;
|
let file = dir.lookup_self().await?;
|
||||||
let stat = to_stat(to_inode(&file), &file)?;
|
let stat = to_stat(to_inode(&file), &file)?;
|
||||||
let name = OsStr::new(".");
|
let name = OsStr::new(".");
|
||||||
match request.add_entry(name, &stat, next, 1, f64::MAX, f64::MAX)? {
|
if request
|
||||||
ReplyBufState::Ok => (),
|
.add_entry(name, &stat, next, 1, f64::MAX, f64::MAX)?
|
||||||
ReplyBufState::Full => return Ok(lookups),
|
.is_full()
|
||||||
|
{
|
||||||
|
return Ok(lookups);
|
||||||
}
|
}
|
||||||
lookups.push(LookupRef::clone(&dir_lookup));
|
lookups.push(LookupRef::clone(&dir_lookup));
|
||||||
}
|
}
|
||||||
@ -551,9 +555,11 @@ impl SessionImpl {
|
|||||||
let file = parent_dir.lookup_self().await?;
|
let file = parent_dir.lookup_self().await?;
|
||||||
let stat = to_stat(to_inode(&file), &file)?;
|
let stat = to_stat(to_inode(&file), &file)?;
|
||||||
let name = OsStr::new("..");
|
let name = OsStr::new("..");
|
||||||
match request.add_entry(name, &stat, next, 1, f64::MAX, f64::MAX)? {
|
if request
|
||||||
ReplyBufState::Ok => (),
|
.add_entry(name, &stat, next, 1, f64::MAX, f64::MAX)?
|
||||||
ReplyBufState::Full => return Ok(lookups),
|
.is_full()
|
||||||
|
{
|
||||||
|
return Ok(lookups);
|
||||||
}
|
}
|
||||||
lookups.push(lookup);
|
lookups.push(lookup);
|
||||||
}
|
}
|
||||||
@ -619,9 +625,8 @@ impl SessionImpl {
|
|||||||
let xattrs = self.listxattrs(request.inode).await?;
|
let xattrs = self.listxattrs(request.inode).await?;
|
||||||
|
|
||||||
for entry in xattrs {
|
for entry in xattrs {
|
||||||
match request.add_c_string(entry.name()) {
|
if request.add_c_string(entry.name()).is_full() {
|
||||||
ReplyBufState::Ok => (),
|
return Ok(ReplyBufState::Full);
|
||||||
ReplyBufState::Full => return Ok(ReplyBufState::Full),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user