From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F8FBC4363A for ; Mon, 26 Oct 2020 22:51:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 35EEE207C3 for ; Mon, 26 Oct 2020 22:51:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="fIHTE/0H" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394823AbgJZWv4 (ORCPT ); Mon, 26 Oct 2020 18:51:56 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:40168 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394822AbgJZWv4 (ORCPT ); Mon, 26 Oct 2020 18:51:56 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09QMjIYb116616; Mon, 26 Oct 2020 22:51:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=wtQhmpetlNcyZ5ObEFkupx+mQkUeU9pYFBjbnwcNTGA=; b=fIHTE/0HVa8Czl79m6cPy6GDRVpYFzDH5P8h4xqEDxqwMIIfQXsJaIzGj3YeCGiAYtQd lwca0R0s9FpTWwTVqA6kteV4TzOoAeXt88rvBAcwNNsS/gWgd+j/quRK+unNAf10ouya sIbXYGlXKWx3RbUP5w0uxT9LrBui9sUDf4SUTmiS0GwWGHZ+dD19tst1UXwFDUdJTzXu UbAioDF2brBa4JpyAb10ACwfA+UVBFaTiXYGYMXEa6+2iybXGtydducxud0nSAAW3UCu qdEQtdK5GosFDbRjh7ShHV68XnDiX9c2HbwNC3p3xOvJZaDqDb/93i8iCJkT4KdCmVoY LA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2130.oracle.com with ESMTP id 34c9saq9hq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 26 Oct 2020 22:51:07 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09QMkEsF132099; Mon, 26 Oct 2020 22:51:06 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 34cx1q1ebk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Oct 2020 22:51:06 +0000 Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 09QMp458011214; Mon, 26 Oct 2020 22:51:04 GMT Received: from localhost (/10.159.145.170) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 26 Oct 2020 15:51:04 -0700 Date: Mon, 26 Oct 2020 15:51:03 -0700 From: "Darrick J. Wong" To: xiakaixu1987@gmail.com Cc: linux-xfs@vger.kernel.org, Kaixu Xia Subject: Re: [PATCH v4 1/3] xfs: delete duplicated tp->t_dqinfo null check and allocation Message-ID: <20201026225103.GD347246@magnolia> References: <1602130749-23093-1-git-send-email-kaixuxia@tencent.com> <1602130749-23093-2-git-send-email-kaixuxia@tencent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1602130749-23093-2-git-send-email-kaixuxia@tencent.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9786 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=3 malwarescore=0 mlxlogscore=999 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010260148 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9786 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 spamscore=0 phishscore=0 clxscore=1015 suspectscore=3 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010260148 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org On Thu, Oct 08, 2020 at 12:19:07PM +0800, xiakaixu1987@gmail.com wrote: > From: Kaixu Xia > > The function xfs_trans_mod_dquot_byino() wrap around xfs_trans_mod_dquot() > to account for quotas, and also there is the function call chain > xfs_trans_reserve_quota_bydquots -> xfs_trans_dqresv -> xfs_trans_mod_dquot, > both of them do the duplicated null check and allocation. Thus > we can delete the duplicated operation from them. > > Signed-off-by: Kaixu Xia Looks good to me, Reviewed-by: Darrick J. Wong --D > --- > fs/xfs/xfs_trans_dquot.c | 7 ------- > 1 file changed, 7 deletions(-) > > diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c > index fe45b0c3970c..67f1e275b34d 100644 > --- a/fs/xfs/xfs_trans_dquot.c > +++ b/fs/xfs/xfs_trans_dquot.c > @@ -143,9 +143,6 @@ xfs_trans_mod_dquot_byino( > xfs_is_quota_inode(&mp->m_sb, ip->i_ino)) > return; > > - if (tp->t_dqinfo == NULL) > - xfs_trans_alloc_dqinfo(tp); > - > if (XFS_IS_UQUOTA_ON(mp) && ip->i_udquot) > (void) xfs_trans_mod_dquot(tp, ip->i_udquot, field, delta); > if (XFS_IS_GQUOTA_ON(mp) && ip->i_gdquot) > @@ -698,7 +695,6 @@ xfs_trans_dqresv( > * because we don't have the luxury of a transaction envelope then. > */ > if (tp) { > - ASSERT(tp->t_dqinfo); > ASSERT(flags & XFS_QMOPT_RESBLK_MASK); > if (nblks != 0) > xfs_trans_mod_dquot(tp, dqp, > @@ -752,9 +748,6 @@ xfs_trans_reserve_quota_bydquots( > if (!XFS_IS_QUOTA_RUNNING(mp) || !XFS_IS_QUOTA_ON(mp)) > return 0; > > - if (tp && tp->t_dqinfo == NULL) > - xfs_trans_alloc_dqinfo(tp); > - > ASSERT(flags & XFS_QMOPT_RESBLK_MASK); > > if (udqp) { > -- > 2.20.0 >