From: Darrick J. Wong Date: Thu, 21 Nov 2024 00:24:11 +0000 (-0800) Subject: libxfs: constify the xfs_inode predicates X-Git-Tag: v6.13.0~176 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b99309ee42d6a31fc49eb9f5cfdbf0d4b95ddb32;p=thirdparty%2Fxfsprogs-dev.git libxfs: constify the xfs_inode predicates Change the xfs_inode predicates to take a const struct xfs_inode pointer because they do not change the inode. Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- diff --git a/include/xfs_inode.h b/include/xfs_inode.h index 6f2d2398..30e17169 100644 --- a/include/xfs_inode.h +++ b/include/xfs_inode.h @@ -248,7 +248,7 @@ typedef struct xfs_inode { struct inode i_vnode; } xfs_inode_t; -static inline bool xfs_inode_has_attr_fork(struct xfs_inode *ip) +static inline bool xfs_inode_has_attr_fork(const struct xfs_inode *ip) { return ip->i_forkoff > 0; } @@ -372,17 +372,17 @@ static inline void drop_nlink(struct inode *inode) inode->i_nlink--; } -static inline bool xfs_is_reflink_inode(struct xfs_inode *ip) +static inline bool xfs_is_reflink_inode(const struct xfs_inode *ip) { return ip->i_diflags2 & XFS_DIFLAG2_REFLINK; } -static inline bool xfs_inode_has_bigtime(struct xfs_inode *ip) +static inline bool xfs_inode_has_bigtime(const struct xfs_inode *ip) { return ip->i_diflags2 & XFS_DIFLAG2_BIGTIME; } -static inline bool xfs_inode_has_large_extent_counts(struct xfs_inode *ip) +static inline bool xfs_inode_has_large_extent_counts(const struct xfs_inode *ip) { return ip->i_diflags2 & XFS_DIFLAG2_NREXT64; } @@ -392,12 +392,12 @@ static inline bool xfs_inode_has_large_extent_counts(struct xfs_inode *ip) * Decide if this file is a realtime file whose data allocation unit is larger * than a single filesystem block. */ -static inline bool xfs_inode_has_bigrtalloc(struct xfs_inode *ip) +static inline bool xfs_inode_has_bigrtalloc(const struct xfs_inode *ip) { return XFS_IS_REALTIME_INODE(ip) && ip->i_mount->m_sb.sb_rextsize > 1; } -static inline bool xfs_is_always_cow_inode(struct xfs_inode *ip) +static inline bool xfs_is_always_cow_inode(const struct xfs_inode *ip) { return false; }