]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: add a xfs_noquota_inode predicate
authorChristoph Hellwig <hch@lst.de>
Fri, 12 Apr 2024 05:48:54 +0000 (07:48 +0200)
committerChristoph Hellwig <hch@lst.de>
Sat, 13 Apr 2024 04:27:34 +0000 (06:27 +0200)
Source kernel commit: 415b06be5965b9dd36b6a9287962dbc38b7f4c3a

All remaining uses of xfs_is_noquota_inode are used to check if quota
accounting should not be applied to an inode, and unless used in asserts
is always combined with a metadir check as we never apply quotas to
metadir inodes.

Combine these checks into a single xfs_noquota_inode that explains the
logic.  Note that for dqadjust this now means we have to read the
inode first before skipping them, but that's a small price to pay for
more obvious code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
libxfs/xfs_format.h

index c42a76060bded23a0c692bc9c57caee71490ad1a..b276b4729558f5ed3c7bf29c1c796be3d2a76a33 100644 (file)
@@ -442,14 +442,6 @@ static inline bool xfs_sb_version_haslogxattrs(struct xfs_sb *sbp)
                 XFS_SB_FEAT_INCOMPAT_LOG_XATTRS);
 }
 
-static inline bool
-xfs_is_quota_inode(struct xfs_sb *sbp, xfs_ino_t ino)
-{
-       return (ino == sbp->sb_uquotino ||
-               ino == sbp->sb_gquotino ||
-               ino == sbp->sb_pquotino);
-}
-
 #define XFS_SB_DADDR           ((xfs_daddr_t)0) /* daddr in filesystem/ag */
 #define        XFS_SB_BLOCK(mp)        XFS_HDR_BLOCK(mp, XFS_SB_DADDR)