Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ea79766 authored by Dave Chinner's avatar Dave Chinner
Browse files

Merge branch 'xfs-commit-cleanup' into for-next

Conflicts:
	fs/xfs/xfs_attr_inactive.c
parents 4497f287 f78c3901
Loading
Loading
Loading
Loading
+10 −15
Original line number Original line Diff line number Diff line
@@ -266,7 +266,7 @@ xfs_attr_set(
	tres.tr_logflags = XFS_TRANS_PERM_LOG_RES;
	tres.tr_logflags = XFS_TRANS_PERM_LOG_RES;
	error = xfs_trans_reserve(args.trans, &tres, args.total, 0);
	error = xfs_trans_reserve(args.trans, &tres, args.total, 0);
	if (error) {
	if (error) {
		xfs_trans_cancel(args.trans, 0);
		xfs_trans_cancel(args.trans);
		return error;
		return error;
	}
	}
	xfs_ilock(dp, XFS_ILOCK_EXCL);
	xfs_ilock(dp, XFS_ILOCK_EXCL);
@@ -276,7 +276,7 @@ xfs_attr_set(
				       XFS_QMOPT_RES_REGBLKS);
				       XFS_QMOPT_RES_REGBLKS);
	if (error) {
	if (error) {
		xfs_iunlock(dp, XFS_ILOCK_EXCL);
		xfs_iunlock(dp, XFS_ILOCK_EXCL);
		xfs_trans_cancel(args.trans, XFS_TRANS_RELEASE_LOG_RES);
		xfs_trans_cancel(args.trans);
		return error;
		return error;
	}
	}


@@ -320,8 +320,7 @@ xfs_attr_set(
				xfs_trans_ichgtime(args.trans, dp,
				xfs_trans_ichgtime(args.trans, dp,
							XFS_ICHGTIME_CHG);
							XFS_ICHGTIME_CHG);
			}
			}
			err2 = xfs_trans_commit(args.trans,
			err2 = xfs_trans_commit(args.trans);
						 XFS_TRANS_RELEASE_LOG_RES);
			xfs_iunlock(dp, XFS_ILOCK_EXCL);
			xfs_iunlock(dp, XFS_ILOCK_EXCL);


			return error ? error : err2;
			return error ? error : err2;
@@ -383,16 +382,14 @@ xfs_attr_set(
	 * Commit the last in the sequence of transactions.
	 * Commit the last in the sequence of transactions.
	 */
	 */
	xfs_trans_log_inode(args.trans, dp, XFS_ILOG_CORE);
	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);
	xfs_iunlock(dp, XFS_ILOCK_EXCL);


	return error;
	return error;


out:
out:
	if (args.trans) {
	if (args.trans)
		xfs_trans_cancel(args.trans,
		xfs_trans_cancel(args.trans);
			XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT);
	}
	xfs_iunlock(dp, XFS_ILOCK_EXCL);
	xfs_iunlock(dp, XFS_ILOCK_EXCL);
	return error;
	return error;
}
}
@@ -462,7 +459,7 @@ xfs_attr_remove(
	error = xfs_trans_reserve(args.trans, &M_RES(mp)->tr_attrrm,
	error = xfs_trans_reserve(args.trans, &M_RES(mp)->tr_attrrm,
				  XFS_ATTRRM_SPACE_RES(mp), 0);
				  XFS_ATTRRM_SPACE_RES(mp), 0);
	if (error) {
	if (error) {
		xfs_trans_cancel(args.trans, 0);
		xfs_trans_cancel(args.trans);
		return error;
		return error;
	}
	}


@@ -501,16 +498,14 @@ xfs_attr_remove(
	 * Commit the last in the sequence of transactions.
	 * Commit the last in the sequence of transactions.
	 */
	 */
	xfs_trans_log_inode(args.trans, dp, XFS_ILOG_CORE);
	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);
	xfs_iunlock(dp, XFS_ILOCK_EXCL);


	return error;
	return error;


out:
out:
	if (args.trans) {
	if (args.trans)
		xfs_trans_cancel(args.trans,
		xfs_trans_cancel(args.trans);
			XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT);
	}
	xfs_iunlock(dp, XFS_ILOCK_EXCL);
	xfs_iunlock(dp, XFS_ILOCK_EXCL);
	return error;
	return error;
}
}
+6 −10
Original line number Original line Diff line number Diff line
@@ -1112,7 +1112,6 @@ xfs_bmap_add_attrfork(
	int			committed;	/* xaction was committed */
	int			committed;	/* xaction was committed */
	int			logflags;	/* logging flags */
	int			logflags;	/* logging flags */
	int			error;		/* error return value */
	int			error;		/* error return value */
	int			cancel_flags = 0;


	ASSERT(XFS_IFORK_Q(ip) == 0);
	ASSERT(XFS_IFORK_Q(ip) == 0);


@@ -1124,17 +1123,15 @@ xfs_bmap_add_attrfork(
		tp->t_flags |= XFS_TRANS_RESERVE;
		tp->t_flags |= XFS_TRANS_RESERVE;
	error = xfs_trans_reserve(tp, &M_RES(mp)->tr_addafork, blks, 0);
	error = xfs_trans_reserve(tp, &M_RES(mp)->tr_addafork, blks, 0);
	if (error) {
	if (error) {
		xfs_trans_cancel(tp, 0);
		xfs_trans_cancel(tp);
		return error;
		return error;
	}
	}
	cancel_flags = XFS_TRANS_RELEASE_LOG_RES;
	xfs_ilock(ip, XFS_ILOCK_EXCL);
	xfs_ilock(ip, XFS_ILOCK_EXCL);
	error = xfs_trans_reserve_quota_nblks(tp, ip, blks, 0, rsvd ?
	error = xfs_trans_reserve_quota_nblks(tp, ip, blks, 0, rsvd ?
			XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_FORCE_RES :
			XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_FORCE_RES :
			XFS_QMOPT_RES_REGBLKS);
			XFS_QMOPT_RES_REGBLKS);
	if (error)
	if (error)
		goto trans_cancel;
		goto trans_cancel;
	cancel_flags |= XFS_TRANS_ABORT;
	if (XFS_IFORK_Q(ip))
	if (XFS_IFORK_Q(ip))
		goto trans_cancel;
		goto trans_cancel;
	if (ip->i_d.di_aformat != XFS_DINODE_FMT_EXTENTS) {
	if (ip->i_d.di_aformat != XFS_DINODE_FMT_EXTENTS) {
@@ -1218,14 +1215,14 @@ xfs_bmap_add_attrfork(
	error = xfs_bmap_finish(&tp, &flist, &committed);
	error = xfs_bmap_finish(&tp, &flist, &committed);
	if (error)
	if (error)
		goto bmap_cancel;
		goto bmap_cancel;
	error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
	error = xfs_trans_commit(tp);
	xfs_iunlock(ip, XFS_ILOCK_EXCL);
	xfs_iunlock(ip, XFS_ILOCK_EXCL);
	return error;
	return error;


bmap_cancel:
bmap_cancel:
	xfs_bmap_cancel(&flist);
	xfs_bmap_cancel(&flist);
trans_cancel:
trans_cancel:
	xfs_trans_cancel(tp, cancel_flags);
	xfs_trans_cancel(tp);
	xfs_iunlock(ip, XFS_ILOCK_EXCL);
	xfs_iunlock(ip, XFS_ILOCK_EXCL);
	return error;
	return error;
}
}
@@ -5926,7 +5923,7 @@ xfs_bmap_split_extent(
	error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write,
	error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write,
			XFS_DIOSTRAT_SPACE_RES(mp, 0), 0);
			XFS_DIOSTRAT_SPACE_RES(mp, 0), 0);
	if (error) {
	if (error) {
		xfs_trans_cancel(tp, 0);
		xfs_trans_cancel(tp);
		return error;
		return error;
	}
	}


@@ -5944,10 +5941,9 @@ xfs_bmap_split_extent(
	if (error)
	if (error)
		goto out;
		goto out;


	return xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
	return xfs_trans_commit(tp);



out:
out:
	xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT);
	xfs_trans_cancel(tp);
	return error;
	return error;
}
}
+2 −2
Original line number Original line Diff line number Diff line
@@ -818,12 +818,12 @@ xfs_sync_sb(
	tp = _xfs_trans_alloc(mp, XFS_TRANS_SB_CHANGE, KM_SLEEP);
	tp = _xfs_trans_alloc(mp, XFS_TRANS_SB_CHANGE, KM_SLEEP);
	error = xfs_trans_reserve(tp, &M_RES(mp)->tr_sb, 0, 0);
	error = xfs_trans_reserve(tp, &M_RES(mp)->tr_sb, 0, 0);
	if (error) {
	if (error) {
		xfs_trans_cancel(tp, 0);
		xfs_trans_cancel(tp);
		return error;
		return error;
	}
	}


	xfs_log_sb(tp);
	xfs_log_sb(tp);
	if (wait)
	if (wait)
		xfs_trans_set_sync(tp);
		xfs_trans_set_sync(tp);
	return xfs_trans_commit(tp, 0);
	return xfs_trans_commit(tp);
}
}
+0 −6
Original line number Original line Diff line number Diff line
@@ -181,12 +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_RESERVE	0x20    /* OK to use reserved data blocks */
#define XFS_TRANS_FREEZE_PROT	0x40	/* Transaction has elevated writer
#define XFS_TRANS_FREEZE_PROT	0x40	/* Transaction has elevated writer
					   count in superblock */
					   count in superblock */
/*
 * Values for call flags parameter.
 */
#define	XFS_TRANS_RELEASE_LOG_RES	0x4
#define	XFS_TRANS_ABORT			0x8

/*
/*
 * Field values for xfs_trans_mod_sb.
 * Field values for xfs_trans_mod_sb.
 */
 */
+3 −3
Original line number Original line Diff line number Diff line
@@ -109,7 +109,7 @@ xfs_setfilesize_trans_alloc(


	error = xfs_trans_reserve(tp, &M_RES(mp)->tr_fsyncts, 0, 0);
	error = xfs_trans_reserve(tp, &M_RES(mp)->tr_fsyncts, 0, 0);
	if (error) {
	if (error) {
		xfs_trans_cancel(tp, 0);
		xfs_trans_cancel(tp);
		return error;
		return error;
	}
	}


@@ -145,7 +145,7 @@ xfs_setfilesize(
	isize = xfs_new_eof(ip, offset + size);
	isize = xfs_new_eof(ip, offset + size);
	if (!isize) {
	if (!isize) {
		xfs_iunlock(ip, XFS_ILOCK_EXCL);
		xfs_iunlock(ip, XFS_ILOCK_EXCL);
		xfs_trans_cancel(tp, 0);
		xfs_trans_cancel(tp);
		return 0;
		return 0;
	}
	}


@@ -155,7 +155,7 @@ xfs_setfilesize(
	xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
	xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);


	return xfs_trans_commit(tp, 0);
	return xfs_trans_commit(tp);
}
}


STATIC int
STATIC int
Loading