Commit Graph

46 Commits

Author SHA1 Message Date
dholland
01e782f371 Revert the following changes:
src/sys/sys/quotactl.h 1.37
   src/sys/compat/netbsd32/netbsd32.h 1.101
   src/sys/compat/netbsd32/netbsd32_netbsd.c 1.188, 1.189
   src/sys/kern/vfs_quotactl.c 1.39
   src/sys/kern/vfs_syscalls.c 1.483
   src/sys/ufs/lfs/ulfs_quota.c 1.11
   src/sys/ufs/ufs/ufs_quota.c 1.116
   src/lib/libquota/quota_kernel.c 1.5

and do them correctly.

If you're going to change the name of something, you need to change
the name of *all* the things with the same name, not just a handful,
and you should change it to something similar so it still matches the
rest of the system rather than just picking an arbitrarily different
name.

Hi, Joerg.

To wit, rename the quotactl "delete" operation to "del", because
"delete" is a reserved word in C++ and for some reason Joerg wants to
run internal interfaces used only by C code through his C++ compiler.
Do not rename it to "remove" instead, because this doesn't match
libquota or the rest of the usage throughout the system; and rename
all the related identifiers, not just the ones that blew the mind of
Joerg's C++ compiler.

Because this is not a user-facing API (the only userland consumer
sys/quotactl.h is libquota) it is sort of ok to make arbitrary
source-incompatible changes; however, by the same token it's completely
unnecessary. If it *were* a user-facing API that someone might have a
semi-rational reason to want to run a C++ compiler on, it would be
incorrect to change it at this point.
2014-06-28 22:27:50 +00:00
joerg
ef53e37514 Don't t use a C++ keyword as field name. 2014-06-12 21:39:45 +00:00
martin
eb04decfe5 Some more errno remapping: if the NFS server is unreachable because we have
no route to it, assume there are no quotas. While this might sound like
an impossible scenario, it actually happens inside rump tests when we have
a virtual shmif network but are querying quotas for / which happens to
be on NFS (but of course outside of the shmif setup).
This fixes tests/fs/nfs/t_rquotad on diskless clients.
2014-06-11 08:43:01 +00:00
martin
5eb4e81776 If a rpc for quota values fails with ENOTCONN translate this to ENOENT - we
certainly don't have any quotas if they are disabled on the file server.
This silences warnings from things like "quota -u -v" when NFS mounts
are present and no quotas are in use on the file server.
2014-06-05 13:14:23 +00:00
matt
fa835e8c8b These directories default to WARNS?=5 2012-03-21 05:37:42 +00:00
njoly
addd71bd1d Check if fstab file exists before trying to parse it, to avoid
warnings from {get,set}fsent() functions if missing.

dholland ok.
2012-02-24 18:00:09 +00:00
wiz
7f2677a5a5 Bump date for previous. 2012-02-13 13:23:29 +00:00
dholland
62cfdf3316 Quota-related docs fixes:
- Remove old quotactl(2); replace with new __quotactl(2).
- Document quota_getrestrictions(3), the semantic restriction codes,
  and quota_quotaon/off(3).
- Update VFS_QUOTACTL(9), which was still describing the pre-proplib API.

Approved by releng for the freeze.
2012-02-13 01:24:00 +00:00
dholland
53787c1f86 Bump libquota.so major version (to 1) 2012-02-01 17:53:23 +00:00
dholland
4146833dd8 Remove old (5.99.48 - 5.99.62) libquota interface. 2012-02-01 17:52:07 +00:00
dholland
31f4a06fb0 Fix stupid bug in cursor_getn - it's supposed to return the number of
values retrieved, but it was returning 0 on success. Fortunately nothing
was using it yet.
2012-02-01 06:19:05 +00:00
dholland
1ce78a5fbd Add missing RCSID(). 2012-02-01 06:12:37 +00:00
dholland
832d4ca72b Be consistent about whether idtype and objtype codes are signed or
unsigned. They are signed. (While unsigned might have been a better
choice, it doesn't really matter and the majority of preexisting uses
were signed. And consistency is good.)
2012-02-01 05:46:45 +00:00
dholland
d2d6fa0ae1 Improve the names of some members of struct quotactl_args. These are
effectively function parameter names, but since they need to be
described with the same names in the man page the choices do matter.
Some.
2012-02-01 05:43:53 +00:00
dholland
59b296daa7 Change the syscall API for quotas over to the new non-proplib one.
- struct vfs_quotactl_args -> struct quotactl_args
   - add sys/stdint.h to sys/quotactl.h for clean userland build
   - install sys/quotactl.h in /usr/include
   - update set lists for same
   - add new marshalling code in libquota
   - add new unmarshalling code in vfs_syscalls.c
   - discard proplib interpreter code in vfs_quotactl.c
   - add dispatching code for the 14 quotactl ops in vfs_quotactl.c
   - mark the proplib quotactl syscall obsolete
   - add a new syscall number for the new quotactl syscall
   - change the name of the syscall to __quotactl()
   - remove the decl of the old quotactl from quota/quotaprop.h
   - add a decl of the new quotactl to sys/quotactl.h
   - update the libc build
   - update ktruss
   - remove proplib marshalling code from libquota
   - update copy of syscall table in gdb ppc sources
   - hack rumphijack to accomodate new quotactl name (as I recall,
     pooka wanted such a name change to simplify something, but I
     don't really see what/how)

This change appears to require a kernel version bump for rumpish
reasons.
2012-02-01 05:34:38 +00:00
dholland
36e1f47401 This will need its own compat copy of some of the strings from
quotaprop.h even after the latter goes away.
2012-01-30 19:19:55 +00:00
dholland
e8133e8154 Bump libquota minor version (version is now 0.2) because I added some stuff. 2012-01-30 16:52:15 +00:00
dholland
5f0d2c5f55 Add quota_quotaon() and quota_quotaoff(). Use them in quotaon(8). 2012-01-30 16:45:13 +00:00
dholland
129b8a27f6 Add quota_getrestrictions() to report the semantic restrictions
associated with a particular quotahandle.
2012-01-30 16:44:09 +00:00
dholland
f6b247aa3b Add quota_getrestrictions() to report the semantic restrictions
associated with a particular quotahandle.
2012-01-30 16:44:08 +00:00
dholland
da6872566a Remove redundant break statement. 2012-01-30 06:39:26 +00:00
dholland
dfbeb14079 Fix silly bug reading fstab. 2012-01-30 06:15:22 +00:00
dholland
e5e6acbd31 Remove an old, no longer necessary hack from libquota and handle the
relevant case properly in usr.bin/quota.
2012-01-30 06:00:49 +00:00
wiz
807d8e00fe Use more markup. Fix xrefs. Sort ERRORS. Fix typos. Remove trailing
whitespace. Fix minus symbol ("\-", not "-").
2012-01-25 21:58:43 +00:00
dholland
63ecc36207 duh, forgot to cvs add 2012-01-25 21:11:45 +00:00
dholland
a9927e3f0e Add a preliminary man page for libquota. 2012-01-25 17:45:13 +00:00
dholland
fa577c93e1 Improve how quota_open() works and generally improve function
dispatching. Allow access to the quota files via the oldfiles code if
quotaon hasn't run yet. Change the latter so it calls getfsent() up
front (and only once) to make it easier to avoid whacking caller
state.
2012-01-25 17:43:37 +00:00
dholland
92d1ae00da Move some more stuff technically specific to the proplib kernel
interface into the source file for using the proplib kernel interface.
2012-01-25 01:22:56 +00:00
dholland
84ed28bf40 Implement quota_put and quota_delete for the fallback direct file
access backend.
2012-01-09 15:45:19 +00:00
dholland
583f7defcf Implement quota_put() and quota_delete() using code from edquota(8). 2012-01-09 15:43:19 +00:00
dholland
8d70e807c3 Implement fallback direct access to quota1-type quota files.
Uses (mostly) code from repquota. Add some missing pieces that
weren't in repquota.

Use the direct file access code for cursors if proplib reports the
quota version is 1.
2012-01-09 15:41:58 +00:00
dholland
857bee05cd Implement the libquota cursor interface, using proplib code from repquota. 2012-01-09 15:40:10 +00:00
dholland
22363307c5 Implement the schema-related functions, using proplib code from
/usr/bin/quota.
2012-01-09 15:34:34 +00:00
dholland
fa6b6291ec Handle default ID case in quota_get(), based on logic found in
/usr/bin/quota.
2012-01-09 15:32:38 +00:00
dholland
9f8b8c04bd Redo getfsquota() and getnfsquota() using the new API.
Change the previous getufsquota() to __quota_getquota() and call it
from all three functions: getfsquota(), getufsquota(), and getnfsquota().
2012-01-09 15:31:11 +00:00
dholland
2957f1ccb8 Add quota_nfs.c and implement quota_get() for nfs, using
code from getnfsquota().

Also implement quota_getmountdevice().
2012-01-09 15:29:55 +00:00
dholland
2ff48b73e6 Rework getufsquota() in terms of the new quota API. 2012-01-09 15:28:31 +00:00
dholland
8d8965ace0 Add initial versions of quota_open(), quota_close(), quota_get(),
calling proplib code mostly taken from getufsquota().

Correct the proplib refcount handling in the code from getufsquota(),
where it was (as far as I can tell) wrong.

Avoid doing illegal and unsafe casts from (struct quotaval *)
to (uint64_t *).
2012-01-09 15:27:04 +00:00
dholland
e15d192c7f Bump minor version of libquota.so. 2012-01-09 15:24:37 +00:00
dholland
bb96a16625 Add stub entry points of the entire new quota interface. These fail or
do nothing for the time being; however, putting them all in up front
avoids the need to do multiple bumps of the libquota.so version.
2012-01-09 15:22:38 +00:00
dholland
51d1d7e7c4 Rename struct ufs_quota_entry -> struct quotaval. 2011-11-25 16:55:05 +00:00
dholland
c60360c18d Reshuffle decls among the quota headers so everything is in the place
it should be:
   - stuff for the proplib interface goes in <quota/quotaprop.h>
   - stuff for userlevel only goes in <quota/quota.h>
   - stuff shared between user and kernel goes in <sys/quota.h>

Note that <quota/quota.h> and <quota/quotaprop.h> are expected to be
moved or removed later on... one thing at a time.

Update include directives in other files as needed.
2011-11-20 21:43:34 +00:00
jym
afca4e3b49 Fix an implementation inconsistency with the prop_*_send_syscall() and
prop_*_recv_syscall() functions from proplib(3). They now share the
same logic as the one from prop_*_send_ioctl() functions:
- returns an int
- 0 indicates "no error", otherwise returns the error number (and
set errno)

Many consumers of the prop_*_{ioctl, syscall} expect errno to be set
on error and use err() to display the error message. As such, ensures that
errno gets set before returning from these functions.

prop_*_send_syscall() functions returned a boolean, and now return an int.
Fix all call sites to use the new paradigm (only quota2 is affected in src).

As the prop_*_{send,recv}_syscall() API appeared in -current and is only
used by the recent quota2 code, I am not bumping the lib. The API change
only affects the prop_*_send_syscall() function (recv_syscall()s were
already used correctly), so ensure you are not mixing "old" -current
quota binaries with a new proplib(3) (or the other way around). This
change will be announced via a HEADS-UP and UPDATING.

Does not affect the kernel part of proplib.

Document the correct API in prop_array(3) and prop_dictionary(3).

Thanks to Francois Tigeot for noticing the API inconsistency and
reporting it on tech-kern@.

ok bouyer@.
2011-09-30 22:08:18 +00:00
plunky
87d4f6076b Apply casts to cases where xdrproc_t is expected but is not
strictly passed, for example because the second argument is
a different kind of pointer.
2011-08-30 17:06:20 +00:00
bouyer
a3a7248ce7 Fix bad cut'n'paste in copyright. Pointed out by dyoung@ 2011-06-07 14:56:12 +00:00
bouyer
d9210c2405 Add a new libquota library, which contains some blocks to build and/or
parse quota plists; as well as a getfsquota() function to retrieve quotas
for a single id from a single filesystem (whatever filesystem this is:
a local quota-enabled fs or NFS). This is build on functions getufsquota()
(for local filesystems with UFS-like quotas) and getnfsquota();
which are also available to userland programs.
move functions from quota2_subr.c to libquota or libprop as appropriate,
and ajust in-tree quota tools.
move some declarations from kernel headers to either sys/quota.h or
quota/quota.h as appropriate. ufs/ufs/quota.h still installed because
it's needed by other installed ufs headers.
ufs/ufs/quota1.h still installed as a quick&dirty way to get a code
using the old quotactl() to compile (just include ufs/ufs/quota1.h instead of
ufs/ufs/quota.h - old code won't compile without this change and this is
on purpose).
Discussed on tech-kern@ and tech-net@ (long thread, but not much about
libquota itself ...)
2011-03-24 17:05:39 +00:00