aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_fsops.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_fsops.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_fsops.c')
-rw-r--r--fs/xfs/xfs_fsops.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index 614eb0cc3608..e64ee5288b86 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -203,8 +203,9 @@ xfs_growfs_data_private(
203 203
204 tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFS); 204 tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFS);
205 tp->t_flags |= XFS_TRANS_RESERVE; 205 tp->t_flags |= XFS_TRANS_RESERVE;
206 if ((error = xfs_trans_reserve(tp, XFS_GROWFS_SPACE_RES(mp), 206 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_growdata,
207 XFS_GROWDATA_LOG_RES(mp), 0, 0, 0))) { 207 XFS_GROWFS_SPACE_RES(mp), 0);
208 if (error) {
208 xfs_trans_cancel(tp, 0); 209 xfs_trans_cancel(tp, 0);
209 return error; 210 return error;
210 } 211 }
@@ -739,8 +740,7 @@ xfs_fs_log_dummy(
739 int error; 740 int error;
740 741
741 tp = _xfs_trans_alloc(mp, XFS_TRANS_DUMMY1, KM_SLEEP); 742 tp = _xfs_trans_alloc(mp, XFS_TRANS_DUMMY1, KM_SLEEP);
742 error = xfs_trans_reserve(tp, 0, XFS_SB_LOG_RES(mp), 0, 0, 743 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_sb, 0, 0);
743 XFS_DEFAULT_LOG_COUNT);
744 if (error) { 744 if (error) {
745 xfs_trans_cancel(tp, 0); 745 xfs_trans_cancel(tp, 0);
746 return error; 746 return error;