aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.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_mount.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_mount.c')
-rw-r--r--fs/xfs/xfs_mount.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 7a9986db47e2..85b6aaa89e51 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -597,8 +597,7 @@ xfs_mount_reset_sbqflags(
597 return 0; 597 return 0;
598 598
599 tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SBCHANGE); 599 tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SBCHANGE);
600 error = xfs_trans_reserve(tp, 0, XFS_QM_SBCHANGE_LOG_RES(mp), 600 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_qm_sbchange, 0, 0);
601 0, 0, XFS_DEFAULT_LOG_COUNT);
602 if (error) { 601 if (error) {
603 xfs_trans_cancel(tp, 0); 602 xfs_trans_cancel(tp, 0);
604 xfs_alert(mp, "%s: Superblock update failed!", __func__); 603 xfs_alert(mp, "%s: Superblock update failed!", __func__);
@@ -1071,8 +1070,7 @@ xfs_log_sbcount(xfs_mount_t *mp)
1071 return 0; 1070 return 0;
1072 1071
1073 tp = _xfs_trans_alloc(mp, XFS_TRANS_SB_COUNT, KM_SLEEP); 1072 tp = _xfs_trans_alloc(mp, XFS_TRANS_SB_COUNT, KM_SLEEP);
1074 error = xfs_trans_reserve(tp, 0, XFS_SB_LOG_RES(mp), 0, 0, 1073 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_sb, 0, 0);
1075 XFS_DEFAULT_LOG_COUNT);
1076 if (error) { 1074 if (error) {
1077 xfs_trans_cancel(tp, 0); 1075 xfs_trans_cancel(tp, 0);
1078 return error; 1076 return error;
@@ -1392,8 +1390,7 @@ xfs_mount_log_sb(
1392 XFS_SB_VERSIONNUM)); 1390 XFS_SB_VERSIONNUM));
1393 1391
1394 tp = xfs_trans_alloc(mp, XFS_TRANS_SB_UNIT); 1392 tp = xfs_trans_alloc(mp, XFS_TRANS_SB_UNIT);
1395 error = xfs_trans_reserve(tp, 0, XFS_SB_LOG_RES(mp), 0, 0, 1393 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_sb, 0, 0);
1396 XFS_DEFAULT_LOG_COUNT);
1397 if (error) { 1394 if (error) {
1398 xfs_trans_cancel(tp, 0); 1395 xfs_trans_cancel(tp, 0);
1399 return error; 1396 return error;