xfs
[Top] [All Lists]

Re: [PATCH v9 3/6] xfs: Add pquota fields where gquota is used.

To: Chandra Seetharaman <sekharan@xxxxxxxxxx>
Subject: Re: [PATCH v9 3/6] xfs: Add pquota fields where gquota is used.
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 25 Jun 2013 15:33:56 +1000
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1372116304.22504.92.camel@xxxxxxxxxxxxxxxxxx>
References: <1372042107-27332-1-git-send-email-sekharan@xxxxxxxxxx> <1372042107-27332-4-git-send-email-sekharan@xxxxxxxxxx> <20130624080000.GN29376@dastard> <1372116304.22504.92.camel@xxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Jun 24, 2013 at 06:25:04PM -0500, Chandra Seetharaman wrote:
> On Mon, 2013-06-24 at 18:00 +1000, Dave Chinner wrote:
> 
> <snip>
> > > @@ -559,8 +596,13 @@ xfs_qm_dqattach_locked(
> > >            * 100% all the time. It is just a hint, and this will
> > >            * succeed in general.
> > >            */
> > > -         if (ip->i_udquot->q_gdquot != ip->i_gdquot)
> > > -                 xfs_qm_dqattach_grouphint(ip->i_udquot, ip->i_gdquot);
> > > +         if (XFS_IS_GQUOTA_ON(mp) &&
> > > +                         ip->i_udquot->q_gdquot != ip->i_gdquot)
> > > +                 xfs_qm_dqattach_hint(ip, XFS_DQ_GROUP);
> > > +
> > > +         if (XFS_IS_PQUOTA_ON(mp) &&
> > > +                         ip->i_udquot->q_pdquot != ip->i_pdquot)
> > > +                 xfs_qm_dqattach_hint(ip, XFS_DQ_PROJ);
> > 
> > Why do we need the XFS_IS_GQUOTA_ON/XFS_IS_PQUOTA_ON checks there?
> > If group quotas are not on, then both the hint and in the
> > inode pointers to the group dquot will be NULL, and therefore equal?
> > i.e. we don't need to even check if quotas are enabled here...
> > 
> > Indeed, why pass (ip, quota type) to xfs_qm_dqattach_hint()? why not
> > just pass the locations directly like:
> > 
> >                     xfs_qm_dqattach_hint(&ip->i_udquot->q_pdquot,
> >                                          ip->i_pdquot):
> > 
> 
> Just looked at xfs_qm_dqattach_hint(), it grabs the dqlock of
> ip->i_udquot, which means I have to have i_udquot also as another
> parameter.

Ah, it does too. Never mind, leave it as it is then. :)

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>