All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 20/22] xfs: assume the default quota limits are always set in xfs_qm_adjust_dqlimits
Date: Sun, 05 Jul 2020 15:14:43 -0700	[thread overview]
Message-ID: <159398728304.425236.3397718848155708532.stgit@magnolia> (raw)
In-Reply-To: <159398715269.425236.15910213189856396341.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

We always initialize the default quota limits to something nowadays, so
we don't need to check that the defaults are set to something before
using them.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_dquot.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)


diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index 44734584f8fb..710119538a6a 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -77,21 +77,21 @@ xfs_qm_adjust_dqlimits(
 	ASSERT(dq->q_id);
 	defq = xfs_get_defquota(q, xfs_dquot_type(dq));
 
-	if (defq->blk.soft && !dq->q_blk.softlimit) {
+	if (!dq->q_blk.softlimit) {
 		dq->q_blk.softlimit = defq->blk.soft;
 		prealloc = 1;
 	}
-	if (defq->blk.hard && !dq->q_blk.hardlimit) {
+	if (!dq->q_blk.hardlimit) {
 		dq->q_blk.hardlimit = defq->blk.hard;
 		prealloc = 1;
 	}
-	if (defq->ino.soft && !dq->q_ino.softlimit)
+	if (!dq->q_ino.softlimit)
 		dq->q_ino.softlimit = defq->ino.soft;
-	if (defq->ino.hard && !dq->q_ino.hardlimit)
+	if (!dq->q_ino.hardlimit)
 		dq->q_ino.hardlimit = defq->ino.hard;
-	if (defq->rtb.soft && !dq->q_rtb.softlimit)
+	if (!dq->q_rtb.softlimit)
 		dq->q_rtb.softlimit = defq->rtb.soft;
-	if (defq->rtb.hard && !dq->q_rtb.hardlimit)
+	if (!dq->q_rtb.hardlimit)
 		dq->q_rtb.hardlimit = defq->rtb.hard;
 
 	if (prealloc)


  parent reply	other threads:[~2020-07-05 22:14 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-05 22:12 [PATCH v2 00/22] xfs: remove xfs_disk_quot from incore dquot Darrick J. Wong
2020-07-05 22:12 ` [PATCH 01/22] xfs: clear XFS_DQ_FREEING if we can't lock the dquot buffer to flush Darrick J. Wong
2020-07-05 22:12 ` [PATCH 02/22] xfs: fix inode quota reservation checks Darrick J. Wong
2020-07-05 22:12 ` [PATCH 03/22] xfs: validate ondisk/incore dquot flags Darrick J. Wong
2020-07-09 13:40   ` Christoph Hellwig
2020-07-05 22:13 ` [PATCH 04/22] xfs: split " Darrick J. Wong
2020-07-09 13:46   ` Christoph Hellwig
2020-07-09 23:37     ` Darrick J. Wong
2020-07-05 22:13 ` [PATCH 05/22] xfs: make XFS_DQUOT_CLUSTER_SIZE_FSB part of the ondisk format Darrick J. Wong
2020-07-09 13:47   ` Christoph Hellwig
2020-07-05 22:13 ` [PATCH 06/22] xfs: stop using q_core.d_flags in the quota code Darrick J. Wong
2020-07-05 22:13 ` [PATCH 07/22] xfs: stop using q_core.d_id " Darrick J. Wong
2020-07-05 22:13 ` [PATCH 08/22] xfs: use a per-resource struct for incore dquot data Darrick J. Wong
2020-07-05 22:13 ` [PATCH 09/22] xfs: stop using q_core limits in the quota code Darrick J. Wong
2020-07-05 22:13 ` [PATCH 10/22] xfs: stop using q_core counters " Darrick J. Wong
2020-07-05 22:13 ` [PATCH 11/22] xfs: stop using q_core warning " Darrick J. Wong
2020-07-05 22:13 ` [PATCH 12/22] xfs: stop using q_core timers " Darrick J. Wong
2020-07-05 22:13 ` [PATCH 13/22] xfs: remove qcore from incore dquots Darrick J. Wong
2020-07-05 22:14 ` [PATCH 14/22] xfs: refactor default quota limits by resource Darrick J. Wong
2020-07-05 22:14 ` [PATCH 15/22] xfs: remove unnecessary arguments from quota adjust functions Darrick J. Wong
2020-07-05 22:14 ` [PATCH 16/22] xfs: refactor quota exceeded test Darrick J. Wong
2020-07-05 22:14 ` [PATCH 17/22] xfs: refactor xfs_qm_scall_setqlim Darrick J. Wong
2020-07-05 22:14 ` [PATCH 18/22] xfs: refactor xfs_trans_dqresv Darrick J. Wong
2020-07-05 22:14 ` [PATCH 19/22] xfs: refactor xfs_trans_apply_dquot_deltas Darrick J. Wong
2020-07-05 22:14 ` Darrick J. Wong [this message]
2020-07-05 22:14 ` [PATCH 21/22] xfs: actually bump warning counts when we send warnings Darrick J. Wong
2020-07-05 22:14 ` [PATCH 22/22] xfs: add more dquot tracepoints Darrick J. Wong

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=159398728304.425236.3397718848155708532.stgit@magnolia \
    --to=darrick.wong@oracle.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.