All of lore.kernel.org
 help / color / mirror / Atom feed
From: xiakaixu1987@gmail.com
To: linux-xfs@vger.kernel.org
Cc: darrick.wong@oracle.com, Kaixu Xia <kaixuxia@tencent.com>
Subject: [PATCH] xfs: check if reserved free disk blocks is needed
Date: Sun,  5 Apr 2020 17:17:19 +0800	[thread overview]
Message-ID: <1586078239-14289-1-git-send-email-kaixuxia@tencent.com> (raw)

From: Kaixu Xia <kaixuxia@tencent.com>

We don't need to create the new quota inodes from disk when
they exist already, so add check if reserved free disk blocks
is needed in xfs_trans_alloc().

Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
 fs/xfs/xfs_qm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index 6678baa..b684b04 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -780,7 +780,8 @@ struct xfs_qm_isolate {
 	}
 
 	error = xfs_trans_alloc(mp, &M_RES(mp)->tr_create,
-			XFS_QM_QINOCREATE_SPACE_RES(mp), 0, 0, &tp);
+			need_alloc ? XFS_QM_QINOCREATE_SPACE_RES(mp) : 0,
+			0, 0, &tp);
 	if (error)
 		return error;
 
-- 
1.8.3.1


             reply	other threads:[~2020-04-05  9:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-05  9:17 xiakaixu1987 [this message]
2020-04-06 13:38 ` [PATCH] xfs: check if reserved free disk blocks is needed Brian Foster
2020-04-07  1:30   ` kaixuxia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1586078239-14289-1-git-send-email-kaixuxia@tencent.com \
    --to=xiakaixu1987@gmail.com \
    --cc=darrick.wong@oracle.com \
    --cc=kaixuxia@tencent.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.