Re: [PATCH v4 06/15] ceph: move fscrypt to filesystem inode

Eric Biggers
2025-07-25T00:34:54Z

On Wed, Jul 23, 2025 at 12:57:44PM +0200, Christian Brauner wrote:
> +#ifdef CONFIG_FS_ENCRYPTION
> + .inode_info_offs = offsetof(struct ceph_inode_info, i_crypt_info) -
> + offsetof(struct ceph_inode_info, netfs),
> +#endif

This should use the offset to the VFS inode:

offsetof(struct ceph_inode_info, netfs.inode)

> +/*
> + * struct inode must be the first member so we can easily calculate offsets for
> + * e.g., fscrypt or fsverity when embedded in filesystem specific inodes.
> + */
> +static_assert(__same_type(((struct netfs_inode *)NULL)->inode, struct inode));
> +static_assert(offsetof(struct netfs_inode, inode) == 0);

Then no need for this.

- Eric