Subject: Re: Ufs quota update
To: Bill Stouder-Studenmund <wrstuden@netbsd.org>
From: Juergen Hannken-Illjes <hannken@eis.cs.tu-bs.de>
List: tech-kern
Date: 07/06/2007 11:21:54
On Thu, Jul 05, 2007 at 10:53:00AM -0700, Bill Stouder-Studenmund wrote:
> On Thu, Jul 05, 2007 at 12:37:18PM +0200, Juergen Hannken-Illjes wrote:
> > The attached diff is my first shot on migrating `struct dquot' and its
> > supporting functions from `sys/ufs/ufs/quota.h' to `sys/ufs/ufs/ufs_quota.c'.
> > 
> > 1) Move `struct dquot' with supporting defines.
> > 
> > 2) Make all internal functions `static'.
> > 
> > 3) Clean up declarations in `quota.h' and `ufs_extern.h'.  `quota.h' now
> >    has the description of quota criterions, on-disk structure, user-kernel
> >    interface and declaration of init/done functions.
> >    All ufs quota related function prototypes go to ``ufs_extern.h'.
> > 
> > 4) Init/done of the quota fields of `struct inode' go to two new functions
> >    ufsquota_init() and ufsquota_free().
> > 
> > There is no functional change from 1) - 4).
> > 
> > 5) Function ufs_chown() was manipulating the quota fields of `struct inode'
> >    in a strange way.  I changed it to work more like Solaris does by
> >    trying to change the uid/gid and restore quota on error.  Instead
> >    of explicitly releasing quota fields for changed ids I changed
> >    chkdq() and chkiq() to reload the quota fields for changed ids.  While
> >    there I removed the explicit getinoquota() and made it implicit to
> >    chkdq() and chkiq().
> > 
> > Comments?
> 
> In general, great!
> 
> My one concern is that you seem to have removed quota handling from 
> ufs_access. I'm not fully sure what it was doing, and thus I'm not fully 
> sure if it's safe to remove.

I removed all explicit calls to getinoquota().  These calls don't check any
quota, they just make the quota fields of an inode valid.

Instead I changed the functions checking/changing quotas (chkdq() and chkiq())
to validate the inode's quota fields.

-- 
Juergen Hannken-Illjes - hannken@eis.cs.tu-bs.de - TU Braunschweig (Germany)