xfs
[Top] [All Lists]

[PATCH 4/4] Make disk quota related transactions aware of this change

To: xfs@xxxxxxxxxxx
Subject: [PATCH 4/4] Make disk quota related transactions aware of this change
From: Jeff Liu <jeff.liu@xxxxxxxxxx>
Date: Fri, 07 Dec 2012 20:13:22 +0800
Cc: Dave Chinner <david@xxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2
Make disk quota related transaction reservation works with this new wrapper.

Signed-off-by: Jie Liu <jeff.liu@xxxxxxxxxx>
Cc: Dave Chinner <dchinner@xxxxxxxxxx>
---
 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

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH 4/4] Make disk quota related transactions aware of this change, Jeff Liu <=