fuse2: remove path from packed inodes to save memory

This commit is contained in:
Thomas Waldmann 2025-11-24 22:12:34 +01:00
parent a842234843
commit 8eb676b047
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01

View file

@ -97,7 +97,11 @@ class FuseBackend:
if item is None:
self.inodes.pop(ino, None)
else:
self.inodes[ino] = msgpack.packb(item.as_dict())
# Remove path from the item dict before packing to save memory.
# The path is already encoded in the DirEntry tree structure
item_dict = item.as_dict()
item_dict.pop("path", None)
self.inodes[ino] = msgpack.packb(item_dict)
def _create_filesystem(self):
self.set_inode(self.root.ino, self.default_dir)