From 7dd27917bd8ac190807e9485c4c4a28452aad744 Mon Sep 17 00:00:00 2001 From: Szymon Walter Date: Mon, 19 Mar 2018 20:42:27 +0100 Subject: [PATCH] add `in_use` method for `Inode` to check whether there are any hard links --- src/sys/inode.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sys/inode.rs b/src/sys/inode.rs index f40015f..3e6241b 100644 --- a/src/sys/inode.rs +++ b/src/sys/inode.rs @@ -119,6 +119,10 @@ impl Inode { Ok(inode) } + + pub fn in_use(&self) -> bool { + self.hard_links > 0 + } } bitflags! {