aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_qm.c
diff options
context:
space:
mode:
authorJie Liu <jeff.liu@oracle.com>2013-08-12 06:49:59 -0400
committerBen Myers <bpm@sgi.com>2013-08-12 18:47:34 -0400
commit3d3c8b5222b92447bffaa4127ee18c757f32a460 (patch)
tree250f3b61679231944b5272d18d17e6ceabfc62d1 /fs/xfs/xfs_qm.c
parent783cb6d172358892d6af394ebe2876bcbfcc6499 (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.c')
-rw-r--r--fs/xfs/xfs_qm.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index 35a6f568e9c9..479c933d7cdf 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -865,11 +865,9 @@ xfs_qm_qino_alloc(
865 } 865 }
866 866
867 tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QINOCREATE); 867 tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QINOCREATE);
868 if ((error = xfs_trans_reserve(tp, 868 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_create,
869 XFS_QM_QINOCREATE_SPACE_RES(mp), 869 XFS_QM_QINOCREATE_SPACE_RES(mp), 0);
870 XFS_CREATE_LOG_RES(mp), 0, 870 if (error) {
871 XFS_TRANS_PERM_LOG_RES,
872 XFS_CREATE_LOG_COUNT))) {
873 xfs_trans_cancel(tp, 0); 871 xfs_trans_cancel(tp, 0);
874 return error; 872 return error;
875 } 873 }
@@ -1740,8 +1738,7 @@ xfs_qm_write_sb_changes(
1740 int error; 1738 int error;
1741 1739
1742 tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SBCHANGE); 1740 tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SBCHANGE);
1743 error = xfs_trans_reserve(tp, 0, XFS_QM_SBCHANGE_LOG_RES(mp), 1741 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_qm_sbchange, 0, 0);
1744 0, 0, XFS_DEFAULT_LOG_COUNT);
1745 if (error) { 1742 if (error) {
1746 xfs_trans_cancel(tp, 0); 1743 xfs_trans_cancel(tp, 0);
1747 return error; 1744 return error;