]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: saner xfs_trans_commit interface
authorChristoph Hellwig <hch@lst.de>
Thu, 30 Jul 2015 23:13:58 +0000 (09:13 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 30 Jul 2015 23:13:58 +0000 (09:13 +1000)
Remove the unused xfs_trans_commit flags argument.  Unlike the kernel
libxfs always ignored the flags argument anyway.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
12 files changed:
include/xfs_trans.h
libxfs/trans.c
libxfs/util.c
libxfs/xfs_attr.c
libxfs/xfs_bmap.c
libxfs/xfs_sb.c
libxfs/xfs_shared.h
mkfs/proto.c
mkfs/xfs_mkfs.c
repair/phase5.c
repair/phase6.c
repair/phase7.c

index 9180575403a804630a8b622193f5e9e244fd2013..5467c7f1187394e5e7a7d48d9957e2da56150287 100644 (file)
@@ -89,7 +89,7 @@ int   xfs_trans_roll(struct xfs_trans **, struct xfs_inode *);
 xfs_trans_t    *libxfs_trans_alloc(struct xfs_mount *, int);
 int    libxfs_trans_reserve(struct xfs_trans *, struct xfs_trans_res *,
                                     uint, uint);
-int    libxfs_trans_commit(struct xfs_trans *, uint);
+int    libxfs_trans_commit(struct xfs_trans *);
 void   libxfs_trans_cancel(struct xfs_trans *);
 struct xfs_buf *libxfs_trans_getsb(struct xfs_trans *, struct xfs_mount *, int);
 
index ef9c510f02e6e55a059954b7c3770c4bb8d14584..03889502acd3a2e011117771603cf185db841543 100644 (file)
@@ -128,7 +128,7 @@ libxfs_trans_roll(
         * is in progress. The caller takes the responsibility to cancel
         * the duplicate transaction that gets returned.
         */
-       error = xfs_trans_commit(trans, 0);
+       error = xfs_trans_commit(trans);
        if (error)
                return error;
 
@@ -806,8 +806,7 @@ xfs_trans_free_items(
  */
 int
 libxfs_trans_commit(
-       xfs_trans_t     *tp,
-       uint            flags)
+       xfs_trans_t     *tp)
 {
        xfs_sb_t        *sbp;
 
index 491c358be388cd9d9c25492f1dcf472f09781f52..e250765641ff0cfb174c43d7fc1d4f2424b98cab 100644 (file)
@@ -590,7 +590,7 @@ libxfs_alloc_file_space(
                if (error)
                        goto error0;
 
-               error = xfs_trans_commit(tp, 0);
+               error = xfs_trans_commit(tp);
                if (error)
                        break;
 
index b4c1e92c1afb4168a41651596bdae94520a9e368..bdde0f616738eae4945e4bcff63f545977ada962 100644 (file)
@@ -315,8 +315,7 @@ xfs_attr_set(
                                xfs_trans_ichgtime(args.trans, dp,
                                                        XFS_ICHGTIME_CHG);
                        }
-                       err2 = xfs_trans_commit(args.trans,
-                                                XFS_TRANS_RELEASE_LOG_RES);
+                       err2 = xfs_trans_commit(args.trans);
                        xfs_iunlock(dp, XFS_ILOCK_EXCL);
 
                        return error ? error : err2;
@@ -378,7 +377,7 @@ xfs_attr_set(
         * Commit the last in the sequence of transactions.
         */
        xfs_trans_log_inode(args.trans, dp, XFS_ILOG_CORE);
-       error = xfs_trans_commit(args.trans, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(args.trans);
        xfs_iunlock(dp, XFS_ILOCK_EXCL);
 
        return error;
@@ -494,7 +493,7 @@ xfs_attr_remove(
         * Commit the last in the sequence of transactions.
         */
        xfs_trans_log_inode(args.trans, dp, XFS_ILOG_CORE);
-       error = xfs_trans_commit(args.trans, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(args.trans);
        xfs_iunlock(dp, XFS_ILOCK_EXCL);
 
        return error;
index a2e77645dc3beb836f8c799798086ba135afcc90..2fd0b44060cb7e43a958d131c25f7a151353670d 100644 (file)
@@ -1207,7 +1207,7 @@ xfs_bmap_add_attrfork(
        error = xfs_bmap_finish(&tp, &flist, &committed);
        if (error)
                goto bmap_cancel;
-       error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
+       error = xfs_trans_commit(tp);
        xfs_iunlock(ip, XFS_ILOCK_EXCL);
        return error;
 
@@ -5918,8 +5918,7 @@ xfs_bmap_split_extent(
        if (error)
                goto out;
 
-       return xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
-
+       return xfs_trans_commit(tp);
 
 out:
        xfs_trans_cancel(tp);
index b24851323641452eb449a4d28bd54142930b4024..72e6d897bc0d296e8c6670ebe90025d7911a1354 100644 (file)
@@ -782,5 +782,5 @@ xfs_sync_sb(
        xfs_log_sb(tp);
        if (wait)
                xfs_trans_set_sync(tp);
-       return xfs_trans_commit(tp, 0);
+       return xfs_trans_commit(tp);
 }
index 930cc7d295ecc1cb24838a0f7fdebef3326a6791..5be529707903fb42bc4ebccc176e57b7a3470d96 100644 (file)
@@ -181,11 +181,6 @@ int        xfs_log_calc_minimum_size(struct xfs_mount *);
 #define XFS_TRANS_RESERVE      0x20    /* OK to use reserved data blocks */
 #define XFS_TRANS_FREEZE_PROT  0x40    /* Transaction has elevated writer
                                           count in superblock */
-/*
- * Values for call flags parameter.
- */
-#define        XFS_TRANS_RELEASE_LOG_RES       0x4
-
 /*
  * Field values for xfs_trans_mod_sb.
  */
index b69ff1ba47aae17d8b98504847936f331bd260bd..09325a4b6e900d00781c0d814f3ce9752def43ec 100644 (file)
@@ -215,7 +215,7 @@ rsvfile(
        ip->i_d.di_flags |= XFS_DIFLAG_PREALLOC;
 
        libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
-       libxfs_trans_commit(tp, 0);
+       libxfs_trans_commit(tp);
 }
 
 static int
@@ -484,7 +484,7 @@ parseproto(
                error = -libxfs_bmap_finish(&tp, &flist, &committed);
                if (error)
                        fail(_("Pre-allocated file creation failed"), error);
-               libxfs_trans_commit(tp, 0);
+               libxfs_trans_commit(tp);
                rsvfile(mp, ip, llen);
                IRELE(ip);
                return;
@@ -566,7 +566,7 @@ parseproto(
                error = -libxfs_bmap_finish(&tp, &flist, &committed);
                if (error)
                        fail(_("Directory creation failed"), error);
-               libxfs_trans_commit(tp, 0);
+               libxfs_trans_commit(tp);
                /*
                 * RT initialization.  Do this here to ensure that
                 * the RT inodes get placed after the root inode.
@@ -594,7 +594,7 @@ parseproto(
                fail(_("Error encountered creating file from prototype file"),
                        error);
        }
-       libxfs_trans_commit(tp, 0);
+       libxfs_trans_commit(tp);
        IRELE(ip);
 }
 
@@ -668,7 +668,7 @@ rtinit(
        rsumip->i_d.di_size = mp->m_rsumsize;
        libxfs_trans_log_inode(tp, rsumip, XFS_ILOG_CORE);
        libxfs_log_sb(tp);
-       libxfs_trans_commit(tp, 0);
+       libxfs_trans_commit(tp);
        mp->m_rsumip = rsumip;
        /*
         * Next, give the bitmap file some zero-filled blocks.
@@ -704,7 +704,7 @@ rtinit(
        if (error) {
                fail(_("Completion of the realtime bitmap failed"), error);
        }
-       libxfs_trans_commit(tp, 0);
+       libxfs_trans_commit(tp);
 
        /*
         * Give the summary file some zero-filled blocks.
@@ -739,7 +739,7 @@ rtinit(
        if (error) {
                fail(_("Completion of the realtime summary failed"), error);
        }
-       libxfs_trans_commit(tp, 0);
+       libxfs_trans_commit(tp);
 
        /*
         * Free the whole area using transactions.
@@ -763,7 +763,7 @@ rtinit(
                if (error) {
                        fail(_("Error completing the realtime space"), error);
                }
-               libxfs_trans_commit(tp, 0);
+               libxfs_trans_commit(tp);
        }
 }
 
index e14f06dd0b02898af51c13286f3225f3078d522e..e134f8772e6e744a52b241d7fa30f7cbade0a53a 100644 (file)
@@ -3029,7 +3029,7 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
 
                libxfs_alloc_fix_freelist(&args, 0);
                xfs_perag_put(args.pag);
-               libxfs_trans_commit(tp, 0);
+               libxfs_trans_commit(tp);
        }
 
        /*
index e34740f5890c09d9c74b0756b2b140ac3d66069b..f42eaafbc9a658562217300ef11a0071692e0631 100644 (file)
@@ -1471,7 +1471,7 @@ build_agf_agfl(xfs_mount_t        *mp,
                        do_error(_("failed to fix AGFL on AG %d, error %d\n"),
                                        agno, error);
                }
-               libxfs_trans_commit(tp, 0);
+               libxfs_trans_commit(tp);
        }
 
 #ifdef XR_BLD_FREE_TRACE
index ed047ecdf53d9fe46e8fc18306c273c5ce490069..5817743e117e3cc156a8256cf953f721c2b7a46f 100644 (file)
@@ -545,7 +545,7 @@ mk_rbmino(xfs_mount_t *mp)
         * commit changes
         */
        libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
-       libxfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_SYNC);
+       libxfs_trans_commit(tp);
 
        /*
         * then allocate blocks for file and fill with zeroes (stolen
@@ -584,7 +584,7 @@ mk_rbmino(xfs_mount_t *mp)
                _("allocation of the realtime bitmap failed, error = %d\n"),
                        error);
        }
-       libxfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_SYNC);
+       libxfs_trans_commit(tp);
 }
 
 static int
@@ -653,7 +653,7 @@ _("can't access block %" PRIu64 " (fsbno %" PRIu64 ") of realtime bitmap inode %
                bno++;
        }
 
-       libxfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_SYNC);
+       libxfs_trans_commit(tp);
        return(0);
 }
 
@@ -725,7 +725,7 @@ _("can't access block %" PRIu64 " (fsbno %" PRIu64 ") of realtime summary inode
                bno++;
        }
 
-       libxfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_SYNC);
+       libxfs_trans_commit(tp);
        return(0);
 }
 
@@ -801,7 +801,7 @@ mk_rsumino(xfs_mount_t *mp)
         * commit changes
         */
        libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
-       libxfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_SYNC);
+       libxfs_trans_commit(tp);
 
        /*
         * then allocate blocks for file and fill with zeroes (stolen
@@ -845,7 +845,7 @@ mk_rsumino(xfs_mount_t *mp)
        _("allocation of the realtime summary ino failed, error = %d\n"),
                        error);
        }
-       libxfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_SYNC);
+       libxfs_trans_commit(tp);
 }
 
 /*
@@ -919,7 +919,7 @@ mk_root_dir(xfs_mount_t *mp)
        ip->d_ops = mp->m_dir_inode_ops;
        libxfs_dir_init(tp, ip, ip);
 
-       libxfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_SYNC);
+       libxfs_trans_commit(tp);
 
        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));
@@ -1060,7 +1060,7 @@ mk_orphanage(xfs_mount_t *mp)
        }
 
 
-       libxfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_SYNC);
+       libxfs_trans_commit(tp);
        IRELE(ip);
        IRELE(pip);
        add_inode_reached(irec,ino_offset);
@@ -1168,8 +1168,7 @@ mv_orphanage(
        _("bmap finish failed (err - %d), filesystem may be out of space\n"),
                                        err);
 
-                       libxfs_trans_commit(tp,
-                               XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_SYNC);
+                       libxfs_trans_commit(tp);
                } else  {
                        err = -libxfs_trans_reserve(tp, &M_RES(mp)->tr_rename,
                                                   nres, 0);
@@ -1216,8 +1215,7 @@ mv_orphanage(
        _("bmap finish failed (%d), filesystem may be out of space\n"),
                                        err);
 
-                       libxfs_trans_commit(tp,
-                               XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_SYNC);
+                       libxfs_trans_commit(tp);
                }
 
        } else  {
@@ -1256,7 +1254,7 @@ mv_orphanage(
        _("bmap finish failed (%d), filesystem may be out of space\n"),
                                err);
 
-               libxfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_SYNC);
+               libxfs_trans_commit(tp);
        }
        IRELE(ino_p);
        IRELE(orphanage_ip);
@@ -1354,7 +1352,7 @@ longform_dir2_rebuild(
 
        error = -libxfs_bmap_finish(&tp, &flist, &committed);
 
-       libxfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_SYNC);
+       libxfs_trans_commit(tp);
 
        if (ino == mp->m_sb.sb_rootino)
                need_root_dotdot = 0;
@@ -1395,8 +1393,7 @@ _("name create failed in ino %" PRIu64 " (%d), filesystem may be out of space\n"
                        goto out_bmap_cancel;
                }
 
-               libxfs_trans_commit(tp,
-                               XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_SYNC);
+               libxfs_trans_commit(tp);
        }
 
        return;
@@ -1450,7 +1447,7 @@ dir2_kill_block(
                do_error(_("shrink_inode failed inode %" PRIu64 " block %u\n"),
                        ip->i_ino, da_bno);
        libxfs_bmap_finish(&tp, &flist, &committed);
-       libxfs_trans_commit(tp, 0);
+       libxfs_trans_commit(tp);
 }
 
 /*
@@ -1926,7 +1923,7 @@ _("entry \"%s\" in dir inode %" PRIu64 " inconsistent with .. value (%" PRIu64 "
        if (needlog)
                libxfs_dir2_data_log_header(&da, bp);
        libxfs_bmap_finish(&tp, &flist, &committed);
-       libxfs_trans_commit(tp, 0);
+       libxfs_trans_commit(tp);
 
        /* record the largest free space in the freetab for later checking */
        bf = M_DIROPS(mp)->data_bestfree_p(d);
@@ -2945,9 +2942,7 @@ process_dir_inode(
                        if (dirty)  {
                                libxfs_trans_log_inode(tp, ip,
                                        XFS_ILOG_CORE | XFS_ILOG_DDATA);
-                               libxfs_trans_commit(tp,
-                                       XFS_TRANS_RELEASE_LOG_RES |
-                                       XFS_TRANS_SYNC);
+                               libxfs_trans_commit(tp);
                        } else  {
                                libxfs_trans_cancel(tp);
                        }
@@ -2995,8 +2990,7 @@ process_dir_inode(
 
                error = -libxfs_bmap_finish(&tp, &flist, &committed);
                ASSERT(error == 0);
-               libxfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES |
-                                                       XFS_TRANS_SYNC);
+               libxfs_trans_commit(tp);
 
                need_root_dotdot = 0;
        } else if (need_root_dotdot && ino == mp->m_sb.sb_rootino)  {
@@ -3057,8 +3051,7 @@ process_dir_inode(
 
                        error = -libxfs_bmap_finish(&tp, &flist, &committed);
                        ASSERT(error == 0);
-                       libxfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES
-                                       |XFS_TRANS_SYNC);
+                       libxfs_trans_commit(tp);
                }
        }
        IRELE(ip);
index d796658dcc9fcd483bafdd570e33d411d53964c9..56c0379f0a8e3bb8997e6b10a7174b258d0da93a 100644 (file)
@@ -101,8 +101,7 @@ update_inode_nlinks(
                 * we're not allocating anything
                 */
                ASSERT(error == 0);
-               error = -libxfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES |
-                               XFS_TRANS_SYNC);
+               error = -libxfs_trans_commit(tp);
 
                ASSERT(error == 0);
        }