tech-userlevel archive

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

Re: fs-independent quotas

On Wed, Oct 19, 2011 at 06:09:27PM +0000, David Holland wrote:
 > So, a few months back we got a new improved quota format for FFS.
 > [...]

All right, I give up. Apparently the commandment Thou Shalt Not
Question the use of the Holy Proplib is more important to the
community than sanity, cleanliness, or long-term compatibility.
I am not interested in pursuing this if all I'm going to get is
complaints that I'm going on some kind of anti-proplib jihad.

The following tidbits may be of use to the person who ends up having
to clean this up in the future:

 - the type "struct ufs_quota_entry" is apparently, despite its name
and (parts of) its usage pattern, meant to be fs-independent.

 - the recommended method for adding quotas to a new file system type
(with its own physical quota representation) appears to be to first
convert to struct ufs_quota_entry in the kernel, then call the
quotaprop code to convert to a proplist for transport, which will then
be converted back to struct ufs_quota_entry in userland.

 - while some of the common userlevel quota code is in libquota, a lot
of it is placed in various quota utilities' source directories and
.PATH'd in from elsewhere. Some of the source files involved are not
used by the utility they're apparently part of, so don't remove
"unused" code without doing a full build. Some of this code is also
cut and pasted.

 - some but not all of the libquota code is shared with the kernel and
lives in src/common. So do some header files, even though by standard
procedures the shared header files should live in src/sys/sys.
However, other shared quota code is .PATH'd in from the kernel.

 - the way the current quotactl(8) works, which is not all that clear
from the documentation, is that you cons up an XML proplist blob
containing XML-encoded function calls as described (sketchily) in
quotactl(2) and feed this to quotactl(8) either as a file or on
stdin. This allows issuing an arbitrary number of arbitrary quota
operations in a single big packet, as interpreted and executed by the
proplist code in the kernel. This is now the recommended/endorsed way
to do quota operations from scripts.


David A. Holland

Home | Main Index | Thread Index | Old Index