xfs
[Top] [All Lists]

Re: [PATCH v8 3/5] xfs: Start using pquotaino from the superblock

To: Chandra Seetharaman <sekharan@xxxxxxxxxx>
Subject: Re: [PATCH v8 3/5] xfs: Start using pquotaino from the superblock
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 11 Jun 2013 09:20:45 +1000
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1369433343.9551.958.camel@xxxxxxxxxxxxxxxxxx>
References: <1368220889-25188-1-git-send-email-sekharan@xxxxxxxxxx> <1368220889-25188-4-git-send-email-sekharan@xxxxxxxxxx> <20130517044604.GO24635@dastard> <1369433343.9551.958.camel@xxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Fri, May 24, 2013 at 05:09:03PM -0500, Chandra Seetharaman wrote:
> On Fri, 2013-05-17 at 14:46 +1000, Dave Chinner wrote:
> > On Fri, May 10, 2013 at 04:21:27PM -0500, Chandra Seetharaman wrote:
> > > Define a macro to check if the superblock has pquotino.
> > > 
> > > Keep backward compatibilty by alowing mount of older superblock
> > > with no separate pquota inode.
> > ....
> > 
> > > @@ -657,27 +680,51 @@ xfs_sb_to_disk(
> > >   int             first;
> > >   int             size;
> > >   __uint16_t      qflags = from->sb_qflags;
> > > + xfs_ino_t       gquotino = from->sb_gquotino;
> > >  
> > >   ASSERT(fields);
> > >   if (!fields)
> > >           return;
> > >  
> > > - if (fields & XFS_SB_QFLAGS) {
> > > + if (!xfs_sb_version_has_pquota(from)) {
> > 
> > This should be moved to a separate function, I think.
> > 
> > > +         if (fields & XFS_SB_QFLAGS) {
> > > +                 /*
> > > +                  * The in-core version of sb_qflags do not have
> > > +                  * XFS_OQUOTA_* flags, whereas the on-disk version
> > > +                  * does.  So, convert incore XFS_{PG}QUOTA_* flags
> > > +                  * to on-disk XFS_OQUOTA_* flags.
> > > +                  */
> > > +                 qflags &= ~(XFS_PQUOTA_ENFD | XFS_PQUOTA_CHKD |
> > > +                                 XFS_GQUOTA_ENFD | XFS_GQUOTA_CHKD);
> > > +
> > > +                 if (from->sb_qflags &
> > > +                                 (XFS_PQUOTA_ENFD | XFS_GQUOTA_ENFD))
> > > +                         qflags |= XFS_OQUOTA_ENFD;
> > > +                 if (from->sb_qflags &
> > > +                                 (XFS_PQUOTA_CHKD | XFS_GQUOTA_CHKD))
> > > +                         qflags |= XFS_OQUOTA_CHKD;
> > 
> > Now that we have the new flags set correct, write it directly to
> > to->sb_qflags and clear XFS_SB_QFLAGS from the fields varaible.
> 
> So, you are suggesting to move this block of functionality to a new
> function, and set the fields in the "to" data structure in that function
> and clear the appropriate bits in the same function ?

Yes.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [PATCH v8 3/5] xfs: Start using pquotaino from the superblock, Dave Chinner <=