xfs: widen flags argument to the xfs_iflags_* helpers
authorDarrick J. Wong <djwong@kernel.org>
Thu, 2 May 2024 14:48:37 +0000 (07:48 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 2 May 2024 14:48:37 +0000 (07:48 -0700)
xfs_inode.i_flags is an unsigned long, so make these helpers take that
as the flags argument instead of unsigned short.  This is needed for the
next patch.

While we're at it, remove the iflags variable from xfs_iget_cache_miss
because we no longer need it.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Andrey Albershteyn <aalbersh@redhat.com>
fs/xfs/xfs_icache.c
fs/xfs/xfs_inode.h

index 74f1812b03cbd2e94da4992296da5280e8d22701..0953163a2d8492ee86a1f22df07dae2ae887f5d8 100644 (file)
@@ -613,7 +613,6 @@ xfs_iget_cache_miss(
        struct xfs_inode        *ip;
        int                     error;
        xfs_agino_t             agino = XFS_INO_TO_AGINO(mp, ino);
-       int                     iflags;
 
        ip = xfs_inode_alloc(mp, ino);
        if (!ip)
@@ -693,13 +692,12 @@ xfs_iget_cache_miss(
         * memory barrier that ensures this detection works correctly at lookup
         * time.
         */
-       iflags = XFS_INEW;
        if (flags & XFS_IGET_DONTCACHE)
                d_mark_dontcache(VFS_I(ip));
        ip->i_udquot = NULL;
        ip->i_gdquot = NULL;
        ip->i_pdquot = NULL;
-       xfs_iflags_set(ip, iflags);
+       xfs_iflags_set(ip, XFS_INEW);
 
        /* insert the new inode */
        spin_lock(&pag->pag_ici_lock);
index 9fd4d29a5713700c87854329993de14f42874903..292b90b5f2ac8479f8afa2be5bae71092f714461 100644 (file)
@@ -207,13 +207,13 @@ xfs_new_eof(struct xfs_inode *ip, xfs_fsize_t new_size)
  * i_flags helper functions
  */
 static inline void
-__xfs_iflags_set(xfs_inode_t *ip, unsigned short flags)
+__xfs_iflags_set(xfs_inode_t *ip, unsigned long flags)
 {
        ip->i_flags |= flags;
 }
 
 static inline void
-xfs_iflags_set(xfs_inode_t *ip, unsigned short flags)
+xfs_iflags_set(xfs_inode_t *ip, unsigned long flags)
 {
        spin_lock(&ip->i_flags_lock);
        __xfs_iflags_set(ip, flags);
@@ -221,7 +221,7 @@ xfs_iflags_set(xfs_inode_t *ip, unsigned short flags)
 }
 
 static inline void
-xfs_iflags_clear(xfs_inode_t *ip, unsigned short flags)
+xfs_iflags_clear(xfs_inode_t *ip, unsigned long flags)
 {
        spin_lock(&ip->i_flags_lock);
        ip->i_flags &= ~flags;
@@ -229,13 +229,13 @@ xfs_iflags_clear(xfs_inode_t *ip, unsigned short flags)
 }
 
 static inline int
-__xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
+__xfs_iflags_test(xfs_inode_t *ip, unsigned long flags)
 {
        return (ip->i_flags & flags);
 }
 
 static inline int
-xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
+xfs_iflags_test(xfs_inode_t *ip, unsigned long flags)
 {
        int ret;
        spin_lock(&ip->i_flags_lock);
@@ -245,7 +245,7 @@ xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
 }
 
 static inline int
-xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags)
+xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned long flags)
 {
        int ret;
 
@@ -258,7 +258,7 @@ xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags)
 }
 
 static inline int
-xfs_iflags_test_and_set(xfs_inode_t *ip, unsigned short flags)
+xfs_iflags_test_and_set(xfs_inode_t *ip, unsigned long flags)
 {
        int ret;