* [PATCH 4/4] Make disk quota related transactions aware of this change
@ 2012-12-07 12:13 Jeff Liu
0 siblings, 0 replies; only message in thread
From: Jeff Liu @ 2012-12-07 12:13 UTC (permalink / raw)
To: xfs
Make disk quota related transaction reservation works with this new wrapper.
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Cc: Dave Chinner <dchinner@redhat.com>
---
fs/xfs/xfs_dquot.c | 6 ++++--
fs/xfs/xfs_qm.c | 6 +++---
fs/xfs/xfs_qm_syscalls.c | 20 +++++++++++---------
3 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index bf27fcc..ba08a1b 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -527,9 +527,11 @@ xfs_qm_dqread(
XFS_WRITE_LOG_RES(mp) +
/*
* Round the chunklen up to the next multiple
- * of 128 (buf log item chunk size)).
+ * of xfs_buf_log_overhead(), that is buf log
+ * item chunk size.
*/
- BBTOB(mp->m_quotainfo->qi_dqchunklen) - 1 + 128,
+ BBTOB(mp->m_quotainfo->qi_dqchunklen) - 1 +
+ xfs_buf_log_overhead(),
0,
XFS_TRANS_PERM_LOG_RES,
XFS_WRITE_LOG_COUNT);
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index 2e86fa0..59492c1 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -1583,9 +1583,9 @@ xfs_qm_write_sb_changes(
tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SBCHANGE);
if ((error = xfs_trans_reserve(tp, 0,
- mp->m_sb.sb_sectsize + 128, 0,
- 0,
- XFS_DEFAULT_LOG_COUNT))) {
+ mp->m_sb.sb_sectsize +
+ xfs_buf_log_overhead(), 0, 0,
+ XFS_DEFAULT_LOG_COUNT))) {
xfs_trans_cancel(tp, 0);
return error;
}
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index 858a3b1..16351c1 100644
--- a/fs/xfs/xfs_qm_syscalls.c
+++ b/fs/xfs/xfs_qm_syscalls.c
@@ -489,8 +489,11 @@ xfs_qm_scall_setqlim(
return 0;
tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SETQLIM);
- if ((error = xfs_trans_reserve(tp, 0, sizeof(xfs_disk_dquot_t) + 128,
- 0, 0, XFS_DEFAULT_LOG_COUNT))) {
+ error = xfs_trans_reserve(tp, 0,
+ sizeof(xfs_disk_dquot_t) +
+ xfs_buf_log_overhead(), 0, 0,
+ XFS_DEFAULT_LOG_COUNT);
+ if (error) {
xfs_trans_cancel(tp, 0);
return (error);
}
@@ -670,14 +673,13 @@ xfs_qm_log_quotaoff(
uint oldsbqflag=0;
tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QUOTAOFF);
- if ((error = xfs_trans_reserve(tp, 0,
- sizeof(xfs_qoff_logitem_t) * 2 +
- mp->m_sb.sb_sectsize + 128,
- 0,
- 0,
- XFS_DEFAULT_LOG_COUNT))) {
+ error = xfs_trans_reserve(tp, 0,
+ sizeof(xfs_qoff_logitem_t) * 2 +
+ mp->m_sb.sb_sectsize +
+ xfs_buf_log_overhead(), 0, 0,
+ XFS_DEFAULT_LOG_COUNT);
+ if (error)
goto error0;
- }
qoffi = xfs_trans_get_qoff_item(tp, NULL, flags & XFS_ALL_QUOTA_ACCT);
xfs_trans_log_quotaoff_item(tp, qoffi);
--
1.7.9.5
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-12-07 12:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-07 12:13 [PATCH 4/4] Make disk quota related transactions aware of this change Jeff Liu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.