Advertise support for large xattrs on TrueNAS

SB_LARGEXATTR is used in TrueNAS SCALE to indicate to the kernel
that the filesystem supports large-size xattrs (greater than 64KiB).

This flag is used to evaluate whether to allow large xattr read
or write requests (up to 2 MiB).

Signed-off-by: Andrew Walker <awalker@ixsystems.com>
This commit is contained in:
Andrew Walker 2021-03-22 15:26:19 -04:00 committed by Ameer Hamza
parent fd0406e5b3
commit 6343ecfcfe
1 changed files with 6 additions and 0 deletions

View File

@ -336,9 +336,15 @@ xattr_changed_cb(void *arg, uint64_t newval)
zfsvfs_t *zfsvfs = arg;
if (newval == ZFS_XATTR_OFF) {
#ifdef SB_LARGEXATTR
zfsvfs->z_sb->s_flags &= ~SB_LARGEXATTR;
#endif
zfsvfs->z_flags &= ~ZSB_XATTR;
} else {
zfsvfs->z_flags |= ZSB_XATTR;
#ifdef SB_LARGEXATTR
zfsvfs->z_sb->s_flags |= SB_LARGEXATTR;
#endif
if (newval == ZFS_XATTR_SA)
zfsvfs->z_xattr_sa = B_TRUE;