Re: [PATCH RFC DRAFT DOESNOTBUILD] inode: free up more space

Christoph Hellwig
2025-07-22T05:49:13Z

On Mon, Jul 21, 2025 at 04:55:52PM -0700, Eric Biggers wrote:
> I wrote a prototype that puts the fsverity_info structs in an
> rhashtable, keyed by the ownening 'struct inode *'. It passes the
> 'verity' group of xfstests on ext4. However, I'm working on checking
> how bad the performance and code size overhead is, and whether my
> implementation is actually correct in all cases. Unfortunately, the
> rhashtable API and implementation is kind of a mess, and it seems it's
> often not as efficient as it should be.

While not exactly the prettiest API I think it isn't too bad if you
stick to the simple parts. Having spent some time with it I'd be
happy to look over your code.

> I suppose an XArray would be the main alternative. But XArray needs
> 'unsigned long' indices, and it doesn't work efficiently when they are
> pointers. (And i_ino won't do, since i_ino isn't unique.)

I'm not sure an xarray is a good fit, as the xarray works best when
the indices are clustered, which they probably won't be here.
But the unsigned long should not be a problem, just hash the inode
pointer instead of i_ino.