From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id q2QMDcRY102837 for ; Mon, 26 Mar 2012 17:13:38 -0500 Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by cuda.sgi.com with ESMTP id 7G8ZvcBG3EFtg1VH for ; Mon, 26 Mar 2012 15:13:37 -0700 (PDT) Date: Tue, 27 Mar 2012 09:13:30 +1100 From: Dave Chinner Subject: Re: [PATCH 1/5] xfs: avoid taking the ilock unnessecarily in xfs_qm_dqattach Message-ID: <20120326221330.GP5091@dastard> References: <20120326211421.518374058@bombadil.infradead.org> <20120326211603.074328642@bombadil.infradead.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120326211603.074328642@bombadil.infradead.org> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: xfs-bounces@oss.sgi.com Errors-To: xfs-bounces@oss.sgi.com To: Christoph Hellwig Cc: xfs@oss.sgi.com On Mon, Mar 26, 2012 at 05:14:22PM -0400, Christoph Hellwig wrote: > Check if we actually need to attach a dquot before taking the ilock in > xfs_qm_dqattach. This avoid superflous lock roundtrips for the common cases > of quota support compiled in but not activated on a filesystem and an > inode that already has the dquots attached. > > Signed-off-by: Christoph Hellwig Looks good. One minor thing: > +static inline bool > +xfs_qm_need_dqattach( > + struct xfs_inode *ip) > +{ > + struct xfs_mount *mp = ip->i_mount; > + > + if (!XFS_IS_QUOTA_RUNNING(mp)) > + return false; > + if (!XFS_IS_QUOTA_ON(mp)) > + return false; > + if (!XFS_NOT_DQATTACHED(mp, ip)) > + return false; > + if (ip->i_ino == mp->m_sb.sb_uquotino || > + ip->i_ino == mp->m_sb.sb_gquotino) > + return false; > + return true; > +} That's probably a little large for an inline function. Let the compiler decide whether to inline it or not. In most cases, it will inline it because it is a static function.... Otherwise, Reviewed-by: Dave Chinner -- Dave Chinner david@fromorbit.com _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs