You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2026/10/26 07:49:24 UTC

(opendal-yinyang) branch xuanwo/linux-fuse-foundation updated: fix: remove unused inode table accessors

This is an automated email from the ASF dual-hosted git repository.

Xuanwo pushed a commit to branch xuanwo/linux-fuse-foundation
in repository https://gitbox.apache.org/repos/asf/opendal-yinyang.git


The following commit(s) were added to refs/heads/xuanwo/linux-fuse-foundation by this push:
     new d1acc1f  fix: remove unused inode table accessors
d1acc1f is described below

commit d1acc1ff5f63b7141ea69aaf78ea0a1cac164595
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Mon Oct 26 15:49:17 2026 +0800

    fix: remove unused inode table accessors
    
    InodeTable stored the root identity but never read it, and the root()
    accessor had no caller. Drop both instead of silencing the lint.
    lookup_count is only exercised by unit tests, so gate it on test builds.
    
    Co-authored-by: Chojan Shang <ps...@apache.org>
---
 src/fuse/inode.rs | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/fuse/inode.rs b/src/fuse/inode.rs
index 9ef397b..40e4c57 100644
--- a/src/fuse/inode.rs
+++ b/src/fuse/inode.rs
@@ -47,7 +47,6 @@ pub struct CachedInfo {
 
 /// Stable NodeId <-> inode mapping with kernel lookup counters.
 pub struct InodeTable {
-    root: NodeId,
     by_inode: BTreeMap<u64, NodeId>,
     by_node: BTreeMap<NodeId, u64>,
     lookups: BTreeMap<u64, u64>,
@@ -57,7 +56,6 @@ pub struct InodeTable {
 impl InodeTable {
     pub fn new(root: NodeId) -> Self {
         Self {
-            root,
             by_inode: [(ROOT_INODE, root)].into_iter().collect(),
             by_node: [(root, ROOT_INODE)].into_iter().collect(),
             lookups: BTreeMap::new(),
@@ -105,6 +103,7 @@ impl InodeTable {
         }
     }
 
+    #[cfg(test)]
     pub fn lookup_count(&self, inode: u64) -> u64 {
         self.lookups.get(&inode).copied().unwrap_or(0)
     }
@@ -117,10 +116,6 @@ impl InodeTable {
     pub fn cached(&self, id: NodeId) -> Option<CachedInfo> {
         self.info.get(&id).copied()
     }
-
-    pub fn root(&self) -> NodeId {
-        self.root
-    }
 }
 
 fn derive(id: NodeId) -> Result<u64, &'static str> {