inode cache: reduced memory usage, refactored for more generality