aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2016-10-03 12:11:47 -0400
committerDarrick J. Wong <darrick.wong@oracle.com>2016-10-05 19:26:29 -0400
commit80de462e090c2c346ca6ec6344b326e81e8cef84 (patch)
tree35ab52a6f94aef5d037e1b5b226dfd65607bcfdf
parent83104d449e8c44e4870a795132437257cdf80006 (diff)
xfs: increase log reservations for reflink
Increase the log reservations to handle the increased rolling that happens at the end of copy-on-write operations. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--fs/xfs/libxfs/xfs_trans_resv.c16
-rw-r--r--fs/xfs/libxfs/xfs_trans_resv.h2
2 files changed, 15 insertions, 3 deletions
diff --git a/fs/xfs/libxfs/xfs_trans_resv.c b/fs/xfs/libxfs/xfs_trans_resv.c
index a59838f1627b..b456cca1bfb2 100644
--- a/fs/xfs/libxfs/xfs_trans_resv.c
+++ b/fs/xfs/libxfs/xfs_trans_resv.c
@@ -812,11 +812,18 @@ xfs_trans_resv_calc(
812 * require a permanent reservation on space. 812 * require a permanent reservation on space.
813 */ 813 */
814 resp->tr_write.tr_logres = xfs_calc_write_reservation(mp); 814 resp->tr_write.tr_logres = xfs_calc_write_reservation(mp);
815 resp->tr_write.tr_logcount = XFS_WRITE_LOG_COUNT; 815 if (xfs_sb_version_hasreflink(&mp->m_sb))
816 resp->tr_write.tr_logcount = XFS_WRITE_LOG_COUNT_REFLINK;
817 else
818 resp->tr_write.tr_logcount = XFS_WRITE_LOG_COUNT;
816 resp->tr_write.tr_logflags |= XFS_TRANS_PERM_LOG_RES; 819 resp->tr_write.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
817 820
818 resp->tr_itruncate.tr_logres = xfs_calc_itruncate_reservation(mp); 821 resp->tr_itruncate.tr_logres = xfs_calc_itruncate_reservation(mp);
819 resp->tr_itruncate.tr_logcount = XFS_ITRUNCATE_LOG_COUNT; 822 if (xfs_sb_version_hasreflink(&mp->m_sb))
823 resp->tr_itruncate.tr_logcount =
824 XFS_ITRUNCATE_LOG_COUNT_REFLINK;
825 else
826 resp->tr_itruncate.tr_logcount = XFS_ITRUNCATE_LOG_COUNT;
820 resp->tr_itruncate.tr_logflags |= XFS_TRANS_PERM_LOG_RES; 827 resp->tr_itruncate.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
821 828
822 resp->tr_rename.tr_logres = xfs_calc_rename_reservation(mp); 829 resp->tr_rename.tr_logres = xfs_calc_rename_reservation(mp);
@@ -873,7 +880,10 @@ xfs_trans_resv_calc(
873 resp->tr_growrtalloc.tr_logflags |= XFS_TRANS_PERM_LOG_RES; 880 resp->tr_growrtalloc.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
874 881
875 resp->tr_qm_dqalloc.tr_logres = xfs_calc_qm_dqalloc_reservation(mp); 882 resp->tr_qm_dqalloc.tr_logres = xfs_calc_qm_dqalloc_reservation(mp);
876 resp->tr_qm_dqalloc.tr_logcount = XFS_WRITE_LOG_COUNT; 883 if (xfs_sb_version_hasreflink(&mp->m_sb))
884 resp->tr_qm_dqalloc.tr_logcount = XFS_WRITE_LOG_COUNT_REFLINK;
885 else
886 resp->tr_qm_dqalloc.tr_logcount = XFS_WRITE_LOG_COUNT;
877 resp->tr_qm_dqalloc.tr_logflags |= XFS_TRANS_PERM_LOG_RES; 887 resp->tr_qm_dqalloc.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
878 888
879 /* 889 /*
diff --git a/fs/xfs/libxfs/xfs_trans_resv.h b/fs/xfs/libxfs/xfs_trans_resv.h
index 36a15110c1fe..b7e5357d060a 100644
--- a/fs/xfs/libxfs/xfs_trans_resv.h
+++ b/fs/xfs/libxfs/xfs_trans_resv.h
@@ -87,6 +87,7 @@ struct xfs_trans_resv {
87#define XFS_DEFAULT_LOG_COUNT 1 87#define XFS_DEFAULT_LOG_COUNT 1
88#define XFS_DEFAULT_PERM_LOG_COUNT 2 88#define XFS_DEFAULT_PERM_LOG_COUNT 2
89#define XFS_ITRUNCATE_LOG_COUNT 2 89#define XFS_ITRUNCATE_LOG_COUNT 2
90#define XFS_ITRUNCATE_LOG_COUNT_REFLINK 8
90#define XFS_INACTIVE_LOG_COUNT 2 91#define XFS_INACTIVE_LOG_COUNT 2
91#define XFS_CREATE_LOG_COUNT 2 92#define XFS_CREATE_LOG_COUNT 2
92#define XFS_CREATE_TMPFILE_LOG_COUNT 2 93#define XFS_CREATE_TMPFILE_LOG_COUNT 2
@@ -96,6 +97,7 @@ struct xfs_trans_resv {
96#define XFS_LINK_LOG_COUNT 2 97#define XFS_LINK_LOG_COUNT 2
97#define XFS_RENAME_LOG_COUNT 2 98#define XFS_RENAME_LOG_COUNT 2
98#define XFS_WRITE_LOG_COUNT 2 99#define XFS_WRITE_LOG_COUNT 2
100#define XFS_WRITE_LOG_COUNT_REFLINK 8
99#define XFS_ADDAFORK_LOG_COUNT 2 101#define XFS_ADDAFORK_LOG_COUNT 2
100#define XFS_ATTRINVAL_LOG_COUNT 1 102#define XFS_ATTRINVAL_LOG_COUNT 1
101#define XFS_ATTRSET_LOG_COUNT 3 103#define XFS_ATTRSET_LOG_COUNT 3