From: Christoph Hellwig Date: Thu, 30 Jul 2015 23:13:58 +0000 (+1000) Subject: xfs: saner xfs_trans_commit interface X-Git-Tag: v4.2.0-rc1~4^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de5a3f467f9e3417f149f3bcbef7717f609796d8;p=thirdparty%2Fxfsprogs-dev.git xfs: saner xfs_trans_commit interface Remove the unused xfs_trans_commit flags argument. Unlike the kernel libxfs always ignored the flags argument anyway. Signed-off-by: Christoph Hellwig Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- diff --git a/include/xfs_trans.h b/include/xfs_trans.h index 918057540..5467c7f11 100644 --- a/include/xfs_trans.h +++ b/include/xfs_trans.h @@ -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); diff --git a/libxfs/trans.c b/libxfs/trans.c index ef9c510f0..03889502a 100644 --- a/libxfs/trans.c +++ b/libxfs/trans.c @@ -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; diff --git a/libxfs/util.c b/libxfs/util.c index 491c358be..e25076564 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -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; diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index b4c1e92c1..bdde0f616 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -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; diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index a2e77645d..2fd0b4406 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -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); diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c index b24851323..72e6d897b 100644 --- a/libxfs/xfs_sb.c +++ b/libxfs/xfs_sb.c @@ -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); } diff --git a/libxfs/xfs_shared.h b/libxfs/xfs_shared.h index 930cc7d29..5be529707 100644 --- a/libxfs/xfs_shared.h +++ b/libxfs/xfs_shared.h @@ -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. */ diff --git a/mkfs/proto.c b/mkfs/proto.c index b69ff1ba4..09325a4b6 100644 --- a/mkfs/proto.c +++ b/mkfs/proto.c @@ -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); } } diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index e14f06dd0..e134f8772 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -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); } /* diff --git a/repair/phase5.c b/repair/phase5.c index e34740f58..f42eaafbc 100644 --- a/repair/phase5.c +++ b/repair/phase5.c @@ -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 diff --git a/repair/phase6.c b/repair/phase6.c index ed047ecdf..5817743e1 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -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); diff --git a/repair/phase7.c b/repair/phase7.c index d796658dc..56c0379f0 100644 --- a/repair/phase7.c +++ b/repair/phase7.c @@ -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); }