xfs
[Top] [All Lists]

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

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH v9 3/6] xfs: Add pquota fields where gquota is used.
From: Chandra Seetharaman <sekharan@xxxxxxxxxx>
Date: Mon, 24 Jun 2013 18:25:04 -0500
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20130624080000.GN29376@dastard>
Organization: IBM
References: <1372042107-27332-1-git-send-email-sekharan@xxxxxxxxxx> <1372042107-27332-4-git-send-email-sekharan@xxxxxxxxxx> <20130624080000.GN29376@dastard>
Reply-to: sekharan@xxxxxxxxxx
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.


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