]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: remove the flags argument to xfs_trans_cancel
authorChristoph Hellwig <hch@lst.de>
Thu, 30 Jul 2015 23:12:58 +0000 (09:12 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 30 Jul 2015 23:12:58 +0000 (09:12 +1000)
Synchronize with the kernel changes that dropped the argument.  Unlike the
kernel libxfs always ignored the flags anyway.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
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
repair/phase6.c
repair/phase7.c

index 46c29554a94a5e91af593964bdb3d250f6f29266..9180575403a804630a8b622193f5e9e244fd2013 100644 (file)
@@ -90,7 +90,7 @@ 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);
-void   libxfs_trans_cancel(struct xfs_trans *, int);
+void   libxfs_trans_cancel(struct xfs_trans *);
 struct xfs_buf *libxfs_trans_getsb(struct xfs_trans *, struct xfs_mount *, int);
 
 int    libxfs_trans_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
index 866c37965e3c1a8c88032710e832023d7b42ccc0..ef9c510f02e6e55a059954b7c3770c4bb8d14584 100644 (file)
@@ -200,8 +200,7 @@ libxfs_trans_reserve(
 
 void
 libxfs_trans_cancel(
-       xfs_trans_t     *tp,
-       int             flags)
+       xfs_trans_t     *tp)
 {
 #ifdef XACT_DEBUG
        xfs_trans_t     *otp = tp;
index daebbe207017445d858223359bd5b45b40e16260..491c358be388cd9d9c25492f1dcf472f09781f52 100644 (file)
@@ -572,7 +572,7 @@ libxfs_alloc_file_space(
                         * Free the transaction structure.
                         */
                        ASSERT(error == -ENOSPC);
-                       xfs_trans_cancel(tp, 0);
+                       xfs_trans_cancel(tp);
                        break;
                }
                xfs_trans_ijoin(tp, ip, 0);
@@ -605,7 +605,7 @@ libxfs_alloc_file_space(
 
 error0:        /* Cancel bmap, cancel trans */
        xfs_bmap_cancel(&free_list);
-       xfs_trans_cancel(tp, 0);
+       xfs_trans_cancel(tp);
        return error;
 }
 
index f8c24f6d89f1c1d1701b0dd4ae80564a72524d65..b4c1e92c1afb4168a41651596bdae94520a9e368 100644 (file)
@@ -261,7 +261,7 @@ xfs_attr_set(
        tres.tr_logflags = XFS_TRANS_PERM_LOG_RES;
        error = xfs_trans_reserve(args.trans, &tres, args.total, 0);
        if (error) {
-               xfs_trans_cancel(args.trans, 0);
+               xfs_trans_cancel(args.trans);
                return error;
        }
        xfs_ilock(dp, XFS_ILOCK_EXCL);
@@ -271,7 +271,7 @@ xfs_attr_set(
                                       XFS_QMOPT_RES_REGBLKS);
        if (error) {
                xfs_iunlock(dp, XFS_ILOCK_EXCL);
-               xfs_trans_cancel(args.trans, XFS_TRANS_RELEASE_LOG_RES);
+               xfs_trans_cancel(args.trans);
                return error;
        }
 
@@ -384,10 +384,8 @@ xfs_attr_set(
        return error;
 
 out:
-       if (args.trans) {
-               xfs_trans_cancel(args.trans,
-                       XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT);
-       }
+       if (args.trans)
+               xfs_trans_cancel(args.trans);
        xfs_iunlock(dp, XFS_ILOCK_EXCL);
        return error;
 }
@@ -457,7 +455,7 @@ xfs_attr_remove(
        error = xfs_trans_reserve(args.trans, &M_RES(mp)->tr_attrrm,
                                  XFS_ATTRRM_SPACE_RES(mp), 0);
        if (error) {
-               xfs_trans_cancel(args.trans, 0);
+               xfs_trans_cancel(args.trans);
                return error;
        }
 
@@ -502,10 +500,8 @@ xfs_attr_remove(
        return error;
 
 out:
-       if (args.trans) {
-               xfs_trans_cancel(args.trans,
-                       XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT);
-       }
+       if (args.trans)
+               xfs_trans_cancel(args.trans);
        xfs_iunlock(dp, XFS_ILOCK_EXCL);
        return error;
 }
index e6d1e6c0d7becb4495f5e5a125ea28c7499acd49..a2e77645dc3beb836f8c799798086ba135afcc90 100644 (file)
@@ -1104,7 +1104,6 @@ xfs_bmap_add_attrfork(
        int                     committed;      /* xaction was committed */
        int                     logflags;       /* logging flags */
        int                     error;          /* error return value */
-       int                     cancel_flags = 0;
 
        ASSERT(XFS_IFORK_Q(ip) == 0);
 
@@ -1116,17 +1115,15 @@ xfs_bmap_add_attrfork(
                tp->t_flags |= XFS_TRANS_RESERVE;
        error = xfs_trans_reserve(tp, &M_RES(mp)->tr_addafork, blks, 0);
        if (error) {
-               xfs_trans_cancel(tp, 0);
+               xfs_trans_cancel(tp);
                return error;
        }
-       cancel_flags = XFS_TRANS_RELEASE_LOG_RES;
        xfs_ilock(ip, XFS_ILOCK_EXCL);
        error = xfs_trans_reserve_quota_nblks(tp, ip, blks, 0, rsvd ?
                        XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_FORCE_RES :
                        XFS_QMOPT_RES_REGBLKS);
        if (error)
                goto trans_cancel;
-       cancel_flags |= XFS_TRANS_ABORT;
        if (XFS_IFORK_Q(ip))
                goto trans_cancel;
        if (ip->i_d.di_aformat != XFS_DINODE_FMT_EXTENTS) {
@@ -1217,7 +1214,7 @@ xfs_bmap_add_attrfork(
 bmap_cancel:
        xfs_bmap_cancel(&flist);
 trans_cancel:
-       xfs_trans_cancel(tp, cancel_flags);
+       xfs_trans_cancel(tp);
        xfs_iunlock(ip, XFS_ILOCK_EXCL);
        return error;
 }
@@ -5903,7 +5900,7 @@ xfs_bmap_split_extent(
        error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write,
                        XFS_DIOSTRAT_SPACE_RES(mp, 0), 0);
        if (error) {
-               xfs_trans_cancel(tp, 0);
+               xfs_trans_cancel(tp);
                return error;
        }
 
@@ -5925,6 +5922,6 @@ xfs_bmap_split_extent(
 
 
 out:
-       xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT);
+       xfs_trans_cancel(tp);
        return error;
 }
index fdb3eafe9544228a3315db0a9b0e7573b41f3f34..b24851323641452eb449a4d28bd54142930b4024 100644 (file)
@@ -775,7 +775,7 @@ xfs_sync_sb(
        tp = _xfs_trans_alloc(mp, XFS_TRANS_SB_CHANGE, KM_SLEEP);
        error = xfs_trans_reserve(tp, &M_RES(mp)->tr_sb, 0, 0);
        if (error) {
-               xfs_trans_cancel(tp, 0);
+               xfs_trans_cancel(tp);
                return error;
        }
 
index 8dda4b321343ba6bf28ebc98516225b1e677dc6d..930cc7d295ecc1cb24838a0f7fdebef3326a6791 100644 (file)
@@ -185,7 +185,6 @@ int xfs_log_calc_minimum_size(struct xfs_mount *);
  * Values for call flags parameter.
  */
 #define        XFS_TRANS_RELEASE_LOG_RES       0x4
-#define        XFS_TRANS_ABORT                 0x8
 
 /*
  * Field values for xfs_trans_mod_sb.
index 1e0b4c294a934f930043bb9468188d32f96a08d8..ed047ecdf53d9fe46e8fc18306c273c5ce490069 100644 (file)
@@ -1403,7 +1403,7 @@ _("name create failed in ino %" PRIu64 " (%d), filesystem may be out of space\n"
 
 out_bmap_cancel:
        libxfs_bmap_cancel(&flist);
-       libxfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT);
+       libxfs_trans_cancel(tp);
        return;
 }
 
@@ -2949,8 +2949,7 @@ process_dir_inode(
                                        XFS_TRANS_RELEASE_LOG_RES |
                                        XFS_TRANS_SYNC);
                        } else  {
-                               libxfs_trans_cancel(tp,
-                                       XFS_TRANS_RELEASE_LOG_RES);
+                               libxfs_trans_cancel(tp);
                        }
                        break;
 
index fe4a84aecaafd87f78360480f2e492e0f364e31c..d796658dcc9fcd483bafdd570e33d411d53964c9 100644 (file)
@@ -93,7 +93,7 @@ update_inode_nlinks(
        set_nlinks(&ip->i_d, ino, nlinks, &dirty);
 
        if (!dirty)  {
-               libxfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES);
+               libxfs_trans_cancel(tp);
        } else  {
                libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
                /*