xfs
[Top] [All Lists]

Re: [PATCH v9 2/6] xfs: Remove incore use of XFS_OQUOTA_ENFD and XFS_OQU

To: Chandra Seetharaman <sekharan@xxxxxxxxxx>
Subject: Re: [PATCH v9 2/6] xfs: Remove incore use of XFS_OQUOTA_ENFD and XFS_OQUOTA_CHKD
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 25 Jun 2013 15:32:27 +1000
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1372112724.22504.77.camel@xxxxxxxxxxxxxxxxxx>
References: <1372042107-27332-1-git-send-email-sekharan@xxxxxxxxxx> <1372042107-27332-3-git-send-email-sekharan@xxxxxxxxxx> <20130624055921.GM29376@dastard> <1372112724.22504.77.camel@xxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Jun 24, 2013 at 05:25:24PM -0500, Chandra Seetharaman wrote:
> On Mon, 2013-06-24 at 15:59 +1000, Dave Chinner wrote:
> > On Sun, Jun 23, 2013 at 09:48:23PM -0500, Chandra Seetharaman wrote:
> > > Remove all incore use of XFS_OQUOTA_ENFD and XFS_OQUOTA_CHKD. Instead,
> > > start using XFS_GQUOTA_.* XFS_PQUOTA_.* counterparts for GQUOTA and
> > > PQUOTA respectively.
> > > 
> > > On-disk copy still uses XFS_OQUOTA_ENFD and XFS_OQUOTA_CHKD.
> > > 
> > > Read and write of the superblock does the conversion from *OQUOTA*
> > > to *[PG]QUOTA*.
> > > 
> > > Signed-off-by: Chandra Seetharaman <sekharan@xxxxxxxxxx>
> > > ---
> > >  fs/xfs/xfs_mount.c       |   46 
> > > ++++++++++++++++++++++++++++++++++++++++++++++
> > >  fs/xfs/xfs_qm.c          |    9 ++++++---
> > >  fs/xfs/xfs_qm_syscalls.c |   39 +++++++++++++++++++++------------------
> > >  fs/xfs/xfs_quota.h       |   42 
> > > ++++++++++++++++++++++++++++--------------
> > >  fs/xfs/xfs_quotaops.c    |    6 ++++--
> > >  fs/xfs/xfs_super.c       |   16 ++++++++--------
> > >  fs/xfs/xfs_trans_dquot.c |    4 ++--
> > >  7 files changed, 115 insertions(+), 47 deletions(-)
> > > 
> > > diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
> > > index 6a19434..e2e14cb 100644
> > > --- a/fs/xfs/xfs_mount.c
> > > +++ b/fs/xfs/xfs_mount.c
> > > @@ -336,6 +336,14 @@ xfs_mount_validate_sb(
> > >           return XFS_ERROR(EWRONGFS);
> > >   }
> > >  
> > > + if ((sbp->sb_qflags & (XFS_OQUOTA_ENFD | XFS_OQUOTA_CHKD)) &&
> > > +                 (sbp->sb_qflags & (XFS_PQUOTA_ENFD | XFS_GQUOTA_ENFD |
> > > +                         XFS_PQUOTA_CHKD | XFS_GQUOTA_CHKD))) {
> > > +         xfs_notice(mp,
> > > +"Super block has XFS_OQUOTA bits along with XFS_PQUOTA and/or XFS_GQUOTA 
> > > bits.\n");
> > > +         return XFS_ERROR(EFSCORRUPTED);
> > > + }
> > > +
> > >   /*
> > >    * Version 5 superblock feature mask validation. Reject combinations the
> > >    * kernel cannot support up front before checking anything else. For
> > > @@ -622,6 +630,35 @@ xfs_sb_from_disk(
> > >   to->sb_lsn = be64_to_cpu(from->sb_lsn);
> > >  }
> > >  
> > > +static inline void
> > > +xfs_handle_quota_to_disk(
> > > + xfs_dsb_t       *to,
> > > + xfs_sb_t        *from,
> > > + __int64_t       *fields)
> > 
> > An "XFS handle" has meaning in the namespace (i.e. an XFS filehandle
> > as used in xfs_ioctl.c and defined in xfs_fs.h, so this is not a
> > good name.
> > 
> > Realistically, xfs_sb_qflags_to_disk() is more appropriate for it's
> > function....
> 
> I agree with your "handle" comment.
> 
> As you can see in patch 4/6, PQUOTINO logic is also added to this
> function. Can you suggest a name inclusive of that ?

xfs_sb_quota_to/from_disk()?

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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