aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorJeff Liu <jeff.liu@oracle.com>2013-01-28 08:27:25 -0500
committerBen Myers <bpm@sgi.com>2013-02-01 15:46:35 -0500
commita7bd794a0f489a66ad595f2bcab0eac8f232e409 (patch)
tree70157837040a6839f2371955925952e994c4c2d1 /fs/xfs
parent762d7ba657ed4a0934b4da7dcef058012f252e0f (diff)
xfs: introduce XFS_SB_LOG_RES() for transactions that modify sb on disk
Introduce a new transaction space reservation XFS_SB_LOG_RES() for those transactions that need to modify the superblock on disk. Signed-off-by: Jie Liu <jeff.liu@oracle.com> CC: Dave Chinner <david@fromorbit.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_mount.h1
-rw-r--r--fs/xfs/xfs_trans.c12
-rw-r--r--fs/xfs/xfs_trans.h1
3 files changed, 14 insertions, 0 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index b46009dc7b13..2e30a9a84f9f 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -45,6 +45,7 @@ typedef struct xfs_trans_reservations {
45 uint tr_qm_dqalloc; /* allocate quota on disk */ 45 uint tr_qm_dqalloc; /* allocate quota on disk */
46 uint tr_qm_quotaoff; /* turn quota off */ 46 uint tr_qm_quotaoff; /* turn quota off */
47 uint tr_qm_equotaoff;/* end of turn quota off */ 47 uint tr_qm_equotaoff;/* end of turn quota off */
48 uint tr_sb; /* modify superblock */
48} xfs_trans_reservations_t; 49} xfs_trans_reservations_t;
49 50
50#ifndef __KERNEL__ 51#ifndef __KERNEL__
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 84643fa5e465..72da2aa08421 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -606,6 +606,17 @@ xfs_calc_qm_quotaoff_end_reservation(
606} 606}
607 607
608/* 608/*
609 * Syncing the incore super block changes to disk.
610 * the super block to reflect the changes: sector size
611 */
612STATIC uint
613xfs_calc_sb_reservation(
614 struct xfs_mount *mp)
615{
616 return xfs_calc_buf_res(1, mp->m_sb.sb_sectsize);
617}
618
619/*
609 * Initialize the precomputed transaction reservation values 620 * Initialize the precomputed transaction reservation values
610 * in the mount structure. 621 * in the mount structure.
611 */ 622 */
@@ -641,6 +652,7 @@ xfs_trans_init(
641 resp->tr_qm_dqalloc = xfs_calc_qm_dqalloc_reservation(mp); 652 resp->tr_qm_dqalloc = xfs_calc_qm_dqalloc_reservation(mp);
642 resp->tr_qm_quotaoff = xfs_calc_qm_quotaoff_reservation(mp); 653 resp->tr_qm_quotaoff = xfs_calc_qm_quotaoff_reservation(mp);
643 resp->tr_qm_equotaoff = xfs_calc_qm_quotaoff_end_reservation(mp); 654 resp->tr_qm_equotaoff = xfs_calc_qm_quotaoff_end_reservation(mp);
655 resp->tr_sb = xfs_calc_sb_reservation(mp);
644} 656}
645 657
646/* 658/*
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h
index 57339e404cf6..d06919e28904 100644
--- a/fs/xfs/xfs_trans.h
+++ b/fs/xfs/xfs_trans.h
@@ -267,6 +267,7 @@ struct xfs_log_item_desc {
267#define XFS_QM_DQALLOC_LOG_RES(mp) ((mp)->m_reservations.tr_qm_dqalloc) 267#define XFS_QM_DQALLOC_LOG_RES(mp) ((mp)->m_reservations.tr_qm_dqalloc)
268#define XFS_QM_QUOTAOFF_LOG_RES(mp) ((mp)->m_reservations.tr_qm_quotaoff) 268#define XFS_QM_QUOTAOFF_LOG_RES(mp) ((mp)->m_reservations.tr_qm_quotaoff)
269#define XFS_QM_QUOTAOFF_END_LOG_RES(mp) ((mp)->m_reservations.tr_qm_equotaoff) 269#define XFS_QM_QUOTAOFF_END_LOG_RES(mp) ((mp)->m_reservations.tr_qm_equotaoff)
270#define XFS_SB_LOG_RES(mp) ((mp)->m_reservations.tr_sb)
270 271
271/* 272/*
272 * Various log count values. 273 * Various log count values.