tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: prop_*_internalize and copyin/out for syscall ?

On Tue, Jan 18, 2011 at 08:42:36AM +0000, David Holland wrote:
> On Mon, Jan 17, 2011 at 04:33:25PM +0100, Manuel Bouyer wrote:
>  > so I'm evaluating how to use proplib for the new quotactl(2) I'm working 
> on.
> er, why? When I was looking at quota stuff in the context of lfs and
> other fs types, the existing quotactl interface seemed fine -- it just
> needs to have a clear separation between the syscall-level structures
> and the ffs-specific ones.
> At worst one might want to split struct dqblk in half, so the block
> and inode limits are addressed separately, something like this:
>    struct quotaentry {
>       uint64_t qe_hardlimit;
>       uint64_t qe_softlimit;
>       uint64_t qe_current;
>       int32_t qe_time;
>       int32_t __qe_spare;
>    };
> with additional suitable constants for addressing block vs. inode
> limits.
> I really don't see where proplib figures into this.

The current interface has 32bit integers for all sizes. For modern storage
size we need it to be 64bits.
My new system also adds more features:
- a default quota entry, used for [ug]id which don't have a quota entry yet.
  This allows to have a global limit for all users, without setting up
  quotas for all possible id in the system.
  Using a magic id number for the default entry doesn't work unless we go
  to 64bits for ids too.
- a per-id grace time so that different users can have different grace
- a way to delete a quota entry for a id (e.g. for deleted users)
  this is a new command.

A major deficiency of the actual interface is that it doesn't allows to
pass a list of quota entries. I need this for repquota, as there's no
user-accessible quota file any more.
Also, I need to pass a whole quota setup as a configuration file
for e.g. newfs (and mount_mfs, it's the same code). For this, a proplist
looks appropriate, and I can't see any reason to not use the same
format for the kernel/userland interface.

Also, if another filesystem needs a different quota interface in the future,
we just need a different proplist format, no need for a new sysctl.

Manuel Bouyer <>
     NetBSD: 26 ans d'experience feront toujours la difference

Home | Main Index | Thread Index | Old Index