From e1d458a38421d08c4a92e5b47feef9ca0d51514f Mon Sep 17 00:00:00 2001 From: Moritz Gmeiner Date: Thu, 31 Jul 2025 23:52:06 +0200 Subject: [PATCH] FatFuse: moved drop -> destroy --- fat-fuse/src/fuse.rs | 13 ++++++++++++- fat-fuse/src/lib.rs | 15 --------------- fat-mount/src/main.rs | 2 -- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/fat-fuse/src/fuse.rs b/fat-fuse/src/fuse.rs index 6a77fb4..adb0cb5 100644 --- a/fat-fuse/src/fuse.rs +++ b/fat-fuse/src/fuse.rs @@ -20,7 +20,18 @@ impl Filesystem for FatFuse { Ok(()) } - fn destroy(&mut self) {} + fn destroy(&mut self) { + debug!("inode_table: {}", self.inode_table.len()); + + debug!("ino_by_first_cluster: {}", self.ino_by_first_cluster.len()); + for (&first_cluster, &ino) in self.ino_by_first_cluster.iter() { + debug!("{} -> {}", first_cluster, ino); + } + + debug!("ino_by_fh: {}", self.ino_by_fh.len()); + + debug!("ino_by_path: {}", self.ino_by_path.len()); + } fn lookup( &mut self, diff --git a/fat-fuse/src/lib.rs b/fat-fuse/src/lib.rs index 0605514..5291746 100644 --- a/fat-fuse/src/lib.rs +++ b/fat-fuse/src/lib.rs @@ -28,21 +28,6 @@ pub struct FatFuse { ino_by_path: FxHashMap, u64>, } -impl Drop for FatFuse { - fn drop(&mut self) { - println!("inode_table: {}", self.inode_table.len()); - - println!("ino_by_first_cluster: {}", self.ino_by_first_cluster.len()); - for (&first_cluster, &ino) in self.ino_by_first_cluster.iter() { - println!("{} -> {}", first_cluster, ino); - } - - println!("ino_by_fh: {}", self.ino_by_fh.len()); - - println!("ino_by_path: {}", self.ino_by_path.len()); - } -} - /// SAFETY /// /// do NOT leak Rc from this type diff --git a/fat-mount/src/main.rs b/fat-mount/src/main.rs index e75213c..c63f238 100644 --- a/fat-mount/src/main.rs +++ b/fat-mount/src/main.rs @@ -34,7 +34,5 @@ fn main() -> anyhow::Result<()> { rx.recv().unwrap(); - println!("done"); - Ok(()) }