diff options
author | Christoph Hellwig <hch@lst.de> | 2015-06-04 13:48:20 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2015-06-04 13:48:20 +1000 |
commit | f78c3901074e113a04150230087f1d76033bb0a4 (patch) | |
tree | 1c5bcd4b88cfd62dd370b06051c9f15f6e67e4d9 /fs/xfs/xfs_trans.c | |
parent | 70393313dd0b26a6a79e2737b6dff1f1937b936d (diff) |
xfs: fix xfs_log_done interface
Instead of the confusing flags argument pass a boolean flag to indicate if
we want to release or regrant a log reservation.
Also ensure that xfs_log_done always drop the reference on the log ticket,
to both simplify the code and make the logic in xfs_trans_roll easier
to understand.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_trans.c')
-rw-r--r-- | fs/xfs/xfs_trans.c | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index fb1bd17ea8ce..0582a27107d4 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c @@ -251,14 +251,7 @@ xfs_trans_reserve( */ undo_log: if (resp->tr_logres > 0) { - int log_flags; - - if (resp->tr_logflags & XFS_TRANS_PERM_LOG_RES) { - log_flags = XFS_LOG_REL_PERM_RESERV; - } else { - log_flags = 0; - } - xfs_log_done(tp->t_mountp, tp->t_ticket, NULL, log_flags); + xfs_log_done(tp->t_mountp, tp->t_ticket, NULL, false); tp->t_ticket = NULL; tp->t_log_res = 0; tp->t_flags &= ~XFS_TRANS_PERM_LOG_RES; @@ -954,13 +947,7 @@ out_unreserve: */ xfs_trans_unreserve_and_mod_dquots(tp); if (tp->t_ticket) { - int log_flags = 0; - - if (regrant) - ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES); - else - log_flags = XFS_LOG_REL_PERM_RESERV; - commit_lsn = xfs_log_done(mp, tp->t_ticket, NULL, log_flags); + commit_lsn = xfs_log_done(mp, tp->t_ticket, NULL, regrant); if (commit_lsn == -1 && !error) error = -EIO; } @@ -1014,13 +1001,8 @@ xfs_trans_cancel( xfs_trans_unreserve_and_mod_sb(tp); xfs_trans_unreserve_and_mod_dquots(tp); - if (tp->t_ticket) { - uint log_flags = 0; - - if (tp->t_flags & XFS_TRANS_PERM_LOG_RES) - log_flags = XFS_LOG_REL_PERM_RESERV; - xfs_log_done(mp, tp->t_ticket, NULL, log_flags); - } + if (tp->t_ticket) + xfs_log_done(mp, tp->t_ticket, NULL, false); /* mark this thread as no longer being in a transaction */ current_restore_flags_nested(&tp->t_pflags, PF_FSTRANS); @@ -1073,13 +1055,6 @@ xfs_trans_roll( trans = *tpp; /* - * transaction commit worked ok so we can drop the extra ticket - * reference that we gained in xfs_trans_dup() - */ - xfs_log_ticket_put(trans->t_ticket); - - - /* * Reserve space in the log for th next transaction. * This also pushes items in the "AIL", the list of logged items, * out to disk if they are taking up space at the tail of the log |