From patchwork Thu Dec 18 15:37:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 5514581 Return-Path: X-Original-To: patchwork-ocfs2-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 542A79F326 for ; Thu, 18 Dec 2014 15:39:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 18C4F209AB for ; Thu, 18 Dec 2014 15:39:36 +0000 (UTC) Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 020AA209A9 for ; Thu, 18 Dec 2014 15:39:34 +0000 (UTC) Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id sBIFcvHS028711 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 18 Dec 2014 15:38:58 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sBIFcuLh021409 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Dec 2014 15:38:56 GMT Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1Y1dAG-0007vE-8I; Thu, 18 Dec 2014 07:38:56 -0800 Received: from acsinet22.oracle.com ([141.146.126.238]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1Y1d9K-0007rP-CB for ocfs2-devel@oss.oracle.com; Thu, 18 Dec 2014 07:37:58 -0800 Received: from userp1030.oracle.com (userp1030.oracle.com [156.151.31.80]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sBIFbvax003068 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 18 Dec 2014 15:37:58 GMT Received: from userp2030.oracle.com (userp2030.oracle.com [156.151.31.89]) by userp1030.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id sBIFbufa004292 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 18 Dec 2014 15:37:57 GMT Received: from pps.filterd (userp2030.oracle.com [127.0.0.1]) by userp2030.oracle.com (8.14.7/8.14.7) with SMTP id sBIFb68H032152 for ; Thu, 18 Dec 2014 15:37:56 GMT Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by userp2030.oracle.com with ESMTP id 1rbxkem9ef-1 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NOT) for ; Thu, 18 Dec 2014 15:37:56 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E42C4ADA8; Thu, 18 Dec 2014 15:37:54 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 6859982467; Thu, 18 Dec 2014 16:37:51 +0100 (CET) From: Jan Kara To: linux-fsdevel@vger.kernel.org Date: Thu, 18 Dec 2014 16:37:17 +0100 Message-Id: <1418917059-23870-4-git-send-email-jack@suse.cz> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1418917059-23870-1-git-send-email-jack@suse.cz> References: <1418917059-23870-1-git-send-email-jack@suse.cz> X-ServerName: cantor2.suse.de X-Proofpoint-Virus-Version: vendor=nai engine=5600 definitions=7655 signatures=670597 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=1 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1412180150 Cc: cluster-devel@redhat.com, Jan Kara , ocfs2-devel@oss.oracle.com, xfs@oss.sgi.com Subject: [Ocfs2-devel] [PATCH 03/25] xfs: Remove some useless flags tests X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP '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 --- 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 28f55fa13831..528c1cee430f 100644 --- a/fs/xfs/xfs_qm_syscalls.c +++ b/fs/xfs/xfs_qm_syscalls.c @@ -327,22 +327,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))