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

Christoph Hellwig
2025-07-16T11:22:01Z

On Tue, Jul 15, 2025 at 04:35:24PM +0200, Christian Brauner wrote:
> Unless there are severe performance penalties for the extra pointer
> dereferences getting our hands on 16 bytes is a good reason to at least
> consider doing this.
>
> I've drafted one way of doing this using ext4 as my victim^wexample. I'd
> like to hear some early feedback whether this is something we would want
> to pursue.

I like getting rid of the fields. But adding all these indirect calls
is a bit nasty.

Given that all these fields should be in the file system specific inode
that also embeddeds the vfs struct inode, what about just putting the
relative offset into struct inode_operations.

e.g. something like

struct inode_operations {
...
ptrdiff_t i_crypto_offset;
}

struct inode_operations foofs_iops {
...

.i_crypto_offset = offsetoff(struct foofs_inode), vfs_inode) -
offsetoff(struct foofs_inode, crypt_info);
}

static inline struct fscrypt_inode_info CRYPT_I(struct inode *inode)
{
return ((void *)inode) - inode->i_op->i_cryto_offset;
}