diff options
author | Jie Liu <jeff.liu@oracle.com> | 2013-08-12 06:49:59 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-08-12 18:47:34 -0400 |
commit | 3d3c8b5222b92447bffaa4127ee18c757f32a460 (patch) | |
tree | 250f3b61679231944b5272d18d17e6ceabfc62d1 /fs/xfs/xfs_qm_syscalls.c | |
parent | 783cb6d172358892d6af394ebe2876bcbfcc6499 (diff) |
xfs: refactor xfs_trans_reserve() interface
With the new xfs_trans_res structure has been introduced, the log
reservation size, log count as well as log flags are pre-initialized
at mount time. So it's time to refine xfs_trans_reserve() interface
to be more neat.
Also, introduce a new helper M_RES() to return a pointer to the
mp->m_resv structure to simplify the input.
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_qm_syscalls.c')
-rw-r--r-- | fs/xfs/xfs_qm_syscalls.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c index 6fdccc324f7e..5290af2411c4 100644 --- a/fs/xfs/xfs_qm_syscalls.c +++ b/fs/xfs/xfs_qm_syscalls.c | |||
@@ -247,9 +247,7 @@ xfs_qm_scall_trunc_qfile( | |||
247 | xfs_ilock(ip, XFS_IOLOCK_EXCL); | 247 | xfs_ilock(ip, XFS_IOLOCK_EXCL); |
248 | 248 | ||
249 | tp = xfs_trans_alloc(mp, XFS_TRANS_TRUNCATE_FILE); | 249 | tp = xfs_trans_alloc(mp, XFS_TRANS_TRUNCATE_FILE); |
250 | error = xfs_trans_reserve(tp, 0, XFS_ITRUNCATE_LOG_RES(mp), 0, | 250 | error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); |
251 | XFS_TRANS_PERM_LOG_RES, | ||
252 | XFS_ITRUNCATE_LOG_COUNT); | ||
253 | if (error) { | 251 | if (error) { |
254 | xfs_trans_cancel(tp, 0); | 252 | xfs_trans_cancel(tp, 0); |
255 | xfs_iunlock(ip, XFS_IOLOCK_EXCL); | 253 | xfs_iunlock(ip, XFS_IOLOCK_EXCL); |
@@ -540,8 +538,7 @@ xfs_qm_scall_setqlim( | |||
540 | xfs_dqunlock(dqp); | 538 | xfs_dqunlock(dqp); |
541 | 539 | ||
542 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SETQLIM); | 540 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SETQLIM); |
543 | error = xfs_trans_reserve(tp, 0, XFS_QM_SETQLIM_LOG_RES(mp), | 541 | error = xfs_trans_reserve(tp, &M_RES(mp)->tr_qm_setqlim, 0, 0); |
544 | 0, 0, XFS_DEFAULT_LOG_COUNT); | ||
545 | if (error) { | 542 | if (error) { |
546 | xfs_trans_cancel(tp, 0); | 543 | xfs_trans_cancel(tp, 0); |
547 | goto out_rele; | 544 | goto out_rele; |
@@ -675,8 +672,7 @@ xfs_qm_log_quotaoff_end( | |||
675 | 672 | ||
676 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QUOTAOFF_END); | 673 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QUOTAOFF_END); |
677 | 674 | ||
678 | error = xfs_trans_reserve(tp, 0, XFS_QM_QUOTAOFF_END_LOG_RES(mp), | 675 | error = xfs_trans_reserve(tp, &M_RES(mp)->tr_qm_equotaoff, 0, 0); |
679 | 0, 0, XFS_DEFAULT_LOG_COUNT); | ||
680 | if (error) { | 676 | if (error) { |
681 | xfs_trans_cancel(tp, 0); | 677 | xfs_trans_cancel(tp, 0); |
682 | return (error); | 678 | return (error); |
@@ -709,8 +705,7 @@ xfs_qm_log_quotaoff( | |||
709 | uint oldsbqflag=0; | 705 | uint oldsbqflag=0; |
710 | 706 | ||
711 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QUOTAOFF); | 707 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QUOTAOFF); |
712 | error = xfs_trans_reserve(tp, 0, XFS_QM_QUOTAOFF_LOG_RES(mp), | 708 | error = xfs_trans_reserve(tp, &M_RES(mp)->tr_qm_quotaoff, 0, 0); |
713 | 0, 0, XFS_DEFAULT_LOG_COUNT); | ||
714 | if (error) | 709 | if (error) |
715 | goto error0; | 710 | goto error0; |
716 | 711 | ||