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

Dave Chinner
2013-06-10T23:20:52Z

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@fromorbit.com