fix(vfs): Z-04 — implement webdav quota report
This commit is contained in:
@@ -885,6 +885,22 @@ impl DavFileSystem for CarrierFs {
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
|
||||
fn get_quota(&self) -> FsFuture<'_, (u64, Option<u64>)> {
|
||||
Box::pin(async move {
|
||||
self.touch();
|
||||
let inner = self.inner.lock().unwrap_or_else(|e| e.into_inner());
|
||||
let total_capacity = inner.manifest.total_blocks as u64 * crate::crypto::CHUNK_SIZE as u64;
|
||||
let used_bytes = inner
|
||||
.manifest
|
||||
.inodes
|
||||
.values()
|
||||
.filter(|i| !i.is_dir)
|
||||
.map(|i| i.size)
|
||||
.sum::<u64>();
|
||||
Ok((used_bytes, Some(total_capacity)))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// Datei-Handle für Dateien innerhalb des Carrier-Dateisystems mit Streaming und Chunk-Pufferung.
|
||||
|
||||
Reference in New Issue
Block a user