linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: linux-fsdevel@vger.kernel.org
Cc: linux-ext4@vger.kernel.org, Jan Kara <jack@suse.cz>, xfs@oss.sgi.com
Subject: [PATCH 03/11] xfs: Remove some useless flags tests
Date: Tue, 11 Nov 2014 22:04:17 +0100	[thread overview]
Message-ID: <1415739865-2438-4-git-send-email-jack@suse.cz> (raw)
In-Reply-To: <1415739865-2438-1-git-send-email-jack@suse.cz>

'flags' have XFS_ALL_QUOTA_ACCT cleared immediately on function entry.
There's no point in checking these bits later in the function. Also
because we check something is going to change, we know some enforcement
bits are being added and thus there's no point in testing that later.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/xfs/xfs_qm_syscalls.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index 5e4944973587..60bca27d3d04 100644
--- a/fs/xfs/xfs_qm_syscalls.c
+++ b/fs/xfs/xfs_qm_syscalls.c
@@ -328,22 +328,16 @@ xfs_qm_scall_quotaon(
 		return -EINVAL;
 	}
 
-	/* No fs can turn on quotas with a delayed effect */
-	ASSERT((flags & XFS_ALL_QUOTA_ACCT) == 0);
-
 	/*
 	 * Can't enforce without accounting. We check the superblock
 	 * qflags here instead of m_qflags because rootfs can have
 	 * quota acct on ondisk without m_qflags' knowing.
 	 */
-	if (((flags & XFS_UQUOTA_ACCT) == 0 &&
-	     (mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) == 0 &&
+	if (((mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) == 0 &&
 	     (flags & XFS_UQUOTA_ENFD)) ||
-	    ((flags & XFS_GQUOTA_ACCT) == 0 &&
-	     (mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) == 0 &&
+	    ((mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) == 0 &&
 	     (flags & XFS_GQUOTA_ENFD)) ||
-	    ((flags & XFS_PQUOTA_ACCT) == 0 &&
-	     (mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT) == 0 &&
+	    ((mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT) == 0 &&
 	     (flags & XFS_PQUOTA_ENFD))) {
 		xfs_debug(mp,
 			"%s: Can't enforce without acct, flags=%x sbflags=%x",
@@ -381,8 +375,7 @@ xfs_qm_scall_quotaon(
 	     ((mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT) !=
 	     (mp->m_qflags & XFS_PQUOTA_ACCT)) ||
 	     ((mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) !=
-	     (mp->m_qflags & XFS_GQUOTA_ACCT)) ||
-	    (flags & XFS_ALL_QUOTA_ENFD) == 0)
+	     (mp->m_qflags & XFS_GQUOTA_ACCT)))
 		return 0;
 
 	if (! XFS_IS_QUOTA_RUNNING(mp))
-- 
1.8.1.4

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2014-11-11 21:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-11 21:04 [PATCH 0/11 RFC] quota: Unify VFS and XFS quota interfaces Jan Kara
2014-11-11 21:04 ` [PATCH 01/11] xfs: Remove useless test Jan Kara
2014-11-11 23:27   ` Dave Chinner
2014-11-11 21:04 ` [PATCH 02/11] xfs: Remove unused variable in xfs_qm_scall_quotaon() Jan Kara
2014-11-11 23:23   ` Dave Chinner
2014-11-11 21:04 ` Jan Kara [this message]
2014-11-11 23:26   ` [PATCH 03/11] xfs: Remove some useless flags tests Dave Chinner
2014-11-11 21:04 ` [PATCH 04/11] quota: Split ->set_xstate callback into two Jan Kara
2014-11-13 17:34   ` Christoph Hellwig
2014-11-18 16:05     ` Jan Kara
2014-11-11 21:04 ` [PATCH 05/11] quota: Wire up ->sysquota_{on,off} callbacks into Q_QUOTA{ON,OFF} Jan Kara
2014-11-11 21:04 ` [PATCH 06/11] quota: Add ->sysquota_{on,off} callbacks for VFS quotas Jan Kara
2014-11-11 21:04 ` [PATCH 07/11] ext4: Use generic helpers for quotaon and quotaoff Jan Kara
2014-11-13 17:36   ` Christoph Hellwig
2014-11-18 16:07     ` Jan Kara
2014-11-11 21:04 ` [PATCH 08/11] ocfs2: " Jan Kara
2014-11-11 21:04 ` [PATCH 09/11] quota: Remove quota_on_meta callback Jan Kara
2014-11-11 21:04 ` [PATCH 10/11] quota: Switch ->get_dqblk() and ->set_dqblk() to use bytes as space units Jan Kara
2014-11-18 22:29   ` Dave Chinner
2014-12-12  9:52     ` Jan Kara
2014-12-12 22:51       ` Jan Kara
2014-11-11 21:04 ` [PATCH 11/11] quota: Store maximum space limit in bytes Jan Kara

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=1415739865-2438-4-git-send-email-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=xfs@oss.sgi.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).