On Mon, Jan 31, 2022 at 04:59:49PM -0600, Eric Sandeen wrote: > On 1/19/22 6:19 PM, Darrick J. Wong wrote: > > From: Dave Chinner <dchinner@xxxxxxxxxx> > > > > Source kernel commit: 0560f31a09e523090d1ab2bfe21c69d028c2bdf2 > > > > Replace m_flags feature checks with xfs_has_<feature>() calls and > > rework the setup code to set flags in m_features. > > > > Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx> > > Reviewed-by: Darrick J. Wong <djwong@xxxxxxxxxx> > > Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> > > --- > > include/xfs_mount.h | 11 +++++++++++ > > libxfs/xfs_attr.c | 4 ++-- > > libxfs/xfs_attr_leaf.c | 41 +++++++++++++++++++++++------------------ > > libxfs/xfs_bmap.c | 4 ++-- > > libxfs/xfs_ialloc.c | 10 ++++------ > > 5 files changed, 42 insertions(+), 28 deletions(-) > > > > > > diff --git a/include/xfs_mount.h b/include/xfs_mount.h > > index a995140d..d4b4ccdc 100644 > > --- a/include/xfs_mount.h > > +++ b/include/xfs_mount.h > > @@ -197,6 +197,17 @@ __XFS_HAS_FEAT(inobtcounts, INOBTCNT) > > __XFS_HAS_FEAT(bigtime, BIGTIME) > > __XFS_HAS_FEAT(needsrepair, NEEDSREPAIR) > > > > +/* Kernel mount features that we don't support */ > > +#define __XFS_UNSUPP_FEAT(name) \ > > +static inline bool xfs_has_ ## name (struct xfs_mount *mp) \ > > +{ \ > > + return false; \ > > +} > > +__XFS_UNSUPP_FEAT(wsync) > > +__XFS_UNSUPP_FEAT(noattr2) > > +__XFS_UNSUPP_FEAT(ikeep) > > +__XFS_UNSUPP_FEAT(swalloc) > > So I'd like to add small_inums to the above list: > > +__XFS_UNSUPP_FEAT(small_inums) > > and use that in xfs_set_inode_alloc() here as was done in kernelspace, i.e.: > > diff --git a/libxfs/init.c b/libxfs/init.c > index 7d94b721..364c3578 100644 > --- a/libxfs/init.c > +++ b/libxfs/init.c > @@ -540,7 +540,7 @@ xfs_set_inode_alloc( > * sufficiently large, set XFS_MOUNT_32BITINODES if we must alter > * the allocator to accommodate the request. > */ > - if ((mp->m_flags & XFS_MOUNT_SMALL_INUMS) && ino > XFS_MAXINUMBER_32) > + if (xfs_has_small_inums(mp) && ino > XFS_MAXINUMBER_32) > mp->m_flags |= XFS_MOUNT_32BITINODES; > else > mp->m_flags &= ~XFS_MOUNT_32BITINODES; > > > That will let us keep this "backport libxfs" series more or less the > same as kernelspace, without needing to gut xfs_set_inode_alloc() as > got proposed in > > [PATCH v1.1 39/45] libxfs: remove pointless *XFS_MOUNT* flags > > and followups to preserve userspace inode allocation behavior. > > If we want to remove dead code from the userspace-specific version of > xfs_set_inode_alloc() I think we can/should do that separately. Ok, that sounds good to me. --D > Thanks, > -Eric >