]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: clean up IRELE/iput callsites
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 9 Oct 2018 16:49:46 +0000 (11:49 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 9 Oct 2018 16:49:46 +0000 (11:49 -0500)
Replace the IRELE macro with a proper function so that we can do proper
typechecking.  This is the userspace cleanup in the same vein as the
kernel patch with the same subject.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
db/attrset.c
include/xfs_inode.h
libxfs/init.c
libxfs/rdwr.c
mkfs/proto.c
repair/phase6.c
repair/phase7.c

index dc82a6c6be488053df5da5965cb144f5701ceabd..56972506b53d2834ba69d8c5ee0c49b6b6ae801d 100644 (file)
@@ -159,7 +159,7 @@ attr_set_f(
 out:
        mp->m_flags &= ~LIBXFS_MOUNT_COMPAT_ATTR;
        if (ip)
-               IRELE(ip);
+               libxfs_irele(ip);
        if (value)
                free(value);
        return 0;
@@ -234,6 +234,6 @@ attr_remove_f(
 out:
        mp->m_flags &= ~LIBXFS_MOUNT_COMPAT_ATTR;
        if (ip)
-               IRELE(ip);
+               libxfs_irele(ip);
        return 0;
 }
index f573f23bf4f4b25a3d935f9d7229d855a4889757..79ec3a2d46e99165f116ceeafde86af2fac0bb34 100644 (file)
@@ -155,8 +155,6 @@ extern bool libxfs_inode_verify_forks(struct xfs_inode *ip,
 extern int     libxfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
                                uint, struct xfs_inode **,
                                struct xfs_ifork_ops *);
-extern void    libxfs_iput(struct xfs_inode *);
-
-#define IRELE(ip) libxfs_iput(ip)
+extern void    libxfs_irele(struct xfs_inode *ip);
 
 #endif /* __XFS_INODE_H__ */
index 36d637c5efa18788538b33651e6703eedf16911f..d7543d4aa549b11680c5d3c9e8a691a9d3c89122 100644 (file)
@@ -838,9 +838,9 @@ void
 libxfs_rtmount_destroy(xfs_mount_t *mp)
 {
        if (mp->m_rsumip)
-               IRELE(mp->m_rsumip);
+               libxfs_irele(mp->m_rsumip);
        if (mp->m_rbmip)
-               IRELE(mp->m_rbmip);
+               libxfs_irele(mp->m_rbmip);
        mp->m_rsumip = mp->m_rbmip = NULL;
 }
 
index 14a4633e9fa60d3a722d11b257b879ed74e67adf..0ee3ba864fb47ea89ede31e7a0ef722c02495fbb 100644 (file)
@@ -1402,7 +1402,7 @@ libxfs_iget(
        }
 
        if (!libxfs_inode_verify_forks(ip, ifork_ops)) {
-               libxfs_iput(ip);
+               libxfs_irele(ip);
                return -EFSCORRUPTED;
        }
 
@@ -1435,7 +1435,8 @@ libxfs_idestroy(xfs_inode_t *ip)
 }
 
 void
-libxfs_iput(xfs_inode_t *ip)
+libxfs_irele(
+       struct xfs_inode        *ip)
 {
        if (ip->i_itemp)
                kmem_zone_free(xfs_ili_zone, ip->i_itemp);
index dc82f093c8ac77e42d8f3471136dcbce14346ec5..687c53ab7e3761bb344ba2bb5784172e8b7fae49 100644 (file)
@@ -479,7 +479,7 @@ parseproto(
                if (error)
                        fail(_("Space preallocation failed."), error);
                rsvfile(mp, ip, llen);
-               IRELE(ip);
+               libxfs_irele(ip);
                return;
 
        case IF_BLOCK:
@@ -573,7 +573,7 @@ parseproto(
                                break;
                        parseproto(mp, ip, fsxp, pp, name);
                }
-               IRELE(ip);
+               libxfs_irele(ip);
                return;
        default:
                ASSERT(0);
@@ -585,7 +585,7 @@ parseproto(
                fail(_("Error encountered creating file from prototype file"),
                        error);
        }
-       IRELE(ip);
+       libxfs_irele(ip);
 }
 
 void
index 8c0165ca2bc143039f6846376eaf03249306af67..e2e4446a00cdf270b43778dc589696b26899370c 100644 (file)
@@ -612,7 +612,7 @@ mk_rbmino(xfs_mount_t *mp)
                _("allocation of the realtime bitmap failed, error = %d\n"),
                        error);
        }
-       IRELE(ip);
+       libxfs_irele(ip);
 }
 
 static int
@@ -678,7 +678,7 @@ _("can't access block %" PRIu64 " (fsbno %" PRIu64 ") of realtime bitmap inode %
        error = -libxfs_trans_commit(tp);
        if (error)
                do_error(_("%s: commit failed, error %d\n"), __func__, error);
-       IRELE(ip);
+       libxfs_irele(ip);
        return(0);
 }
 
@@ -733,7 +733,7 @@ fill_rsumino(xfs_mount_t *mp)
                        do_warn(
 _("can't access block %" PRIu64 " (fsbno %" PRIu64 ") of realtime summary inode %" PRIu64 "\n"),
                                bno, map.br_startblock, mp->m_sb.sb_rsumino);
-                       IRELE(ip);
+                       libxfs_irele(ip);
                        return(1);
                }
 
@@ -748,7 +748,7 @@ _("can't access block %" PRIu64 " (fsbno %" PRIu64 ") of realtime summary inode
        error = -libxfs_trans_commit(tp);
        if (error)
                do_error(_("%s: commit failed, error %d\n"), __func__, error);
-       IRELE(ip);
+       libxfs_irele(ip);
        return(0);
 }
 
@@ -852,7 +852,7 @@ mk_rsumino(xfs_mount_t *mp)
        _("allocation of the realtime summary ino failed, error = %d\n"),
                        error);
        }
-       IRELE(ip);
+       libxfs_irele(ip);
 }
 
 /*
@@ -920,7 +920,7 @@ mk_root_dir(xfs_mount_t *mp)
        if (error)
                do_error(_("%s: commit failed, error %d\n"), __func__, error);
 
-       IRELE(ip);
+       libxfs_irele(ip);
 
        irec = find_inode_rec(mp, XFS_INO_TO_AGNO(mp, mp->m_sb.sb_rootino),
                                XFS_INO_TO_AGINO(mp, mp->m_sb.sb_rootino));
@@ -1054,8 +1054,8 @@ mk_orphanage(xfs_mount_t *mp)
                do_error(_("%s directory creation failed -- bmapf error %d\n"),
                        ORPHANAGE, error);
        }
-       IRELE(ip);
-       IRELE(pip);
+       libxfs_irele(ip);
+       libxfs_irele(pip);
        add_inode_reached(irec,ino_offset);
 
        return(ino);
@@ -1233,8 +1233,8 @@ mv_orphanage(
                        do_error(
        _("orphanage name create failed (%d)\n"), err);
        }
-       IRELE(ino_p);
-       IRELE(orphanage_ip);
+       libxfs_irele(ino_p);
+       libxfs_irele(orphanage_ip);
 }
 
 static int
@@ -3050,7 +3050,7 @@ process_dir_inode(
        _("root inode \".\" entry recreation failed (%d)\n"), error);
                }
        }
-       IRELE(ip);
+       libxfs_irele(ip);
 }
 
 /*
index 09d11fcd7bf5a79dd12733e01e53191807deab3c..c2a60a93ea66c59325e5ed86fe9240d0fe862f90 100644 (file)
@@ -77,7 +77,7 @@ update_inode_nlinks(
 
                ASSERT(error == 0);
        }
-       IRELE(ip);
+       libxfs_irele(ip);
 }
 
 /*