aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_utils.c')
-rw-r--r--fs/xfs/xfs_utils.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/xfs/xfs_utils.c b/fs/xfs/xfs_utils.c
index 9014d7e44488..20ffec308e1e 100644
--- a/fs/xfs/xfs_utils.c
+++ b/fs/xfs/xfs_utils.c
@@ -222,7 +222,7 @@ xfs_dir_ialloc(
222 } 222 }
223 223
224 ntp = xfs_trans_dup(tp); 224 ntp = xfs_trans_dup(tp);
225 code = xfs_trans_commit(tp, 0, NULL); 225 code = xfs_trans_commit(tp, 0);
226 tp = ntp; 226 tp = ntp;
227 if (committed != NULL) { 227 if (committed != NULL) {
228 *committed = 1; 228 *committed = 1;
@@ -420,7 +420,11 @@ xfs_truncate_file(
420 * in a transaction. 420 * in a transaction.
421 */ 421 */
422 xfs_ilock(ip, XFS_IOLOCK_EXCL); 422 xfs_ilock(ip, XFS_IOLOCK_EXCL);
423 xfs_itruncate_start(ip, XFS_ITRUNC_DEFINITE, (xfs_fsize_t)0); 423 error = xfs_itruncate_start(ip, XFS_ITRUNC_DEFINITE, (xfs_fsize_t)0);
424 if (error) {
425 xfs_iunlock(ip, XFS_IOLOCK_EXCL);
426 return error;
427 }
424 428
425 tp = xfs_trans_alloc(mp, XFS_TRANS_TRUNCATE_FILE); 429 tp = xfs_trans_alloc(mp, XFS_TRANS_TRUNCATE_FILE);
426 if ((error = xfs_trans_reserve(tp, 0, XFS_ITRUNCATE_LOG_RES(mp), 0, 430 if ((error = xfs_trans_reserve(tp, 0, XFS_ITRUNCATE_LOG_RES(mp), 0,
@@ -460,8 +464,7 @@ xfs_truncate_file(
460 XFS_TRANS_ABORT); 464 XFS_TRANS_ABORT);
461 } else { 465 } else {
462 xfs_ichgtime(ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); 466 xfs_ichgtime(ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
463 error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES, 467 error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
464 NULL);
465 } 468 }
466 xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL); 469 xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
467 470