aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_trans.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_trans.c')
-rw-r--r--fs/xfs/xfs_trans.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index c05da5871a51..7a99ed3b187f 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -303,7 +303,7 @@ xfs_trans_dup(
303 tp->t_blk_res = tp->t_blk_res_used; 303 tp->t_blk_res = tp->t_blk_res_used;
304 ntp->t_rtx_res = tp->t_rtx_res - tp->t_rtx_res_used; 304 ntp->t_rtx_res = tp->t_rtx_res - tp->t_rtx_res_used;
305 tp->t_rtx_res = tp->t_rtx_res_used; 305 tp->t_rtx_res = tp->t_rtx_res_used;
306 PFLAGS_DUP(&tp->t_pflags, &ntp->t_pflags); 306 ntp->t_pflags = tp->t_pflags;
307 307
308 XFS_TRANS_DUP_DQINFO(tp->t_mountp, tp, ntp); 308 XFS_TRANS_DUP_DQINFO(tp->t_mountp, tp, ntp);
309 309
@@ -335,14 +335,11 @@ xfs_trans_reserve(
335 uint logcount) 335 uint logcount)
336{ 336{
337 int log_flags; 337 int log_flags;
338 int error; 338 int error = 0;
339 int rsvd; 339 int rsvd = (tp->t_flags & XFS_TRANS_RESERVE) != 0;
340
341 error = 0;
342 rsvd = (tp->t_flags & XFS_TRANS_RESERVE) != 0;
343 340
344 /* Mark this thread as being in a transaction */ 341 /* Mark this thread as being in a transaction */
345 PFLAGS_SET_FSTRANS(&tp->t_pflags); 342 current_set_flags_nested(&tp->t_pflags, PF_FSTRANS);
346 343
347 /* 344 /*
348 * Attempt to reserve the needed disk blocks by decrementing 345 * Attempt to reserve the needed disk blocks by decrementing
@@ -353,7 +350,7 @@ xfs_trans_reserve(
353 error = xfs_mod_incore_sb(tp->t_mountp, XFS_SBS_FDBLOCKS, 350 error = xfs_mod_incore_sb(tp->t_mountp, XFS_SBS_FDBLOCKS,
354 -blocks, rsvd); 351 -blocks, rsvd);
355 if (error != 0) { 352 if (error != 0) {
356 PFLAGS_RESTORE_FSTRANS(&tp->t_pflags); 353 current_restore_flags_nested(&tp->t_pflags, PF_FSTRANS);
357 return (XFS_ERROR(ENOSPC)); 354 return (XFS_ERROR(ENOSPC));
358 } 355 }
359 tp->t_blk_res += blocks; 356 tp->t_blk_res += blocks;
@@ -426,9 +423,9 @@ undo_blocks:
426 tp->t_blk_res = 0; 423 tp->t_blk_res = 0;
427 } 424 }
428 425
429 PFLAGS_RESTORE_FSTRANS(&tp->t_pflags); 426 current_restore_flags_nested(&tp->t_pflags, PF_FSTRANS);
430 427
431 return (error); 428 return error;
432} 429}
433 430
434 431
@@ -819,7 +816,7 @@ shut_us_down:
819 if (commit_lsn == -1 && !shutdown) 816 if (commit_lsn == -1 && !shutdown)
820 shutdown = XFS_ERROR(EIO); 817 shutdown = XFS_ERROR(EIO);
821 } 818 }
822 PFLAGS_RESTORE_FSTRANS(&tp->t_pflags); 819 current_restore_flags_nested(&tp->t_pflags, PF_FSTRANS);
823 xfs_trans_free_items(tp, shutdown? XFS_TRANS_ABORT : 0); 820 xfs_trans_free_items(tp, shutdown? XFS_TRANS_ABORT : 0);
824 xfs_trans_free_busy(tp); 821 xfs_trans_free_busy(tp);
825 xfs_trans_free(tp); 822 xfs_trans_free(tp);
@@ -884,7 +881,7 @@ shut_us_down:
884 * had pinned, clean up, free trans structure, and return error. 881 * had pinned, clean up, free trans structure, and return error.
885 */ 882 */
886 if (error || commit_lsn == -1) { 883 if (error || commit_lsn == -1) {
887 PFLAGS_RESTORE_FSTRANS(&tp->t_pflags); 884 current_restore_flags_nested(&tp->t_pflags, PF_FSTRANS);
888 xfs_trans_uncommit(tp, flags|XFS_TRANS_ABORT); 885 xfs_trans_uncommit(tp, flags|XFS_TRANS_ABORT);
889 return XFS_ERROR(EIO); 886 return XFS_ERROR(EIO);
890 } 887 }
@@ -926,7 +923,7 @@ shut_us_down:
926 /* 923 /*
927 * Mark this thread as no longer being in a transaction 924 * Mark this thread as no longer being in a transaction
928 */ 925 */
929 PFLAGS_RESTORE_FSTRANS(&tp->t_pflags); 926 current_restore_flags_nested(&tp->t_pflags, PF_FSTRANS);
930 927
931 /* 928 /*
932 * Once all the items of the transaction have been copied 929 * Once all the items of the transaction have been copied
@@ -1182,7 +1179,7 @@ xfs_trans_cancel(
1182 } 1179 }
1183 1180
1184 /* mark this thread as no longer being in a transaction */ 1181 /* mark this thread as no longer being in a transaction */
1185 PFLAGS_RESTORE_FSTRANS(&tp->t_pflags); 1182 current_restore_flags_nested(&tp->t_pflags, PF_FSTRANS);
1186 1183
1187 xfs_trans_free_items(tp, flags); 1184 xfs_trans_free_items(tp, flags);
1188 xfs_trans_free_busy(tp); 1185 xfs_trans_free_busy(tp);