public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Jan Kara <jack@suse.cz>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 2/3] xfs: Remove some useless flags tests
Date: Thu, 15 Jan 2015 08:28:01 -0500	[thread overview]
Message-ID: <20150115132800.GB23696@bfoster.bfoster> (raw)
In-Reply-To: <1421317085-14350-3-git-send-email-jack@suse.cz>

On Thu, Jan 15, 2015 at 11:18:04AM +0100, Jan Kara wrote:
> '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>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  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 b8a565edb4ae..a8c673dbff32 100644
> --- a/fs/xfs/xfs_qm_syscalls.c
> +++ b/fs/xfs/xfs_qm_syscalls.c
> @@ -326,22 +326,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",
> @@ -380,8 +374,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))
> -- 
> 2.1.2
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

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

  reply	other threads:[~2015-01-15 13:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-15 10:18 [PATCH 0/3] xfs: Quota related cleanups Jan Kara
2015-01-15 10:18 ` [PATCH 1/3] xfs: Remove useless test Jan Kara
2015-01-15 13:27   ` Brian Foster
2015-01-20 16:44     ` Jan Kara
2015-01-20 22:14       ` Dave Chinner
2015-01-20 22:35         ` Jan Kara
2015-01-20 23:14           ` Dave Chinner
2015-01-15 10:18 ` [PATCH 2/3] xfs: Remove some useless flags tests Jan Kara
2015-01-15 13:28   ` Brian Foster [this message]
2015-01-15 10:18 ` [PATCH 3/3] xfs: Remove some pointless quota checks Jan Kara
2015-01-15 13:28   ` Brian Foster

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=20150115132800.GB23696@bfoster.bfoster \
    --to=bfoster@redhat.com \
    --cc=jack@suse.cz \
    --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