Re: [PATCH v1] man/man2/quotactl.2: tfix
Alejandro Colomar <[email protected]>
| Newsgroups | org.kernel.vger.linux-man |
|---|---|
| Message-ID | <agsrnqainyp3vZbX@devuan> |
Hi Jan! On 2026-05-18T17:05:59+0200, Jan Kara wrote: > > I have more questions about quotactl(2). In the operations that ignore > > the 'id' argument, am I right to assume that QCMD() is unnecessary? My > > assumption is because if there's no user or group ID to be used, it also > > doesn't make sense to specify whether we want to affect a user or a > > group. > > > > So, for example, Q_QUOTAOFF would have the following synopsis: > > > > int quotactl(Q_QUOTAOFF, const char *_Nullable special, 0, NULL); > > > > While Q_QUOTAON would have the following one: > > > > int quotactl(QCMD(Q_QUOTAON, type), const char *_Nullable special, > > int fmt, caddr_t quota_path); > > > > Is that correct? > > No, QCMD() is always required. For example for Q_QUOTAOFF you still need to > tell whether you want to disable user or group quotas. And even if the type > would not matter for some quotactl, QCMD still does a mangling to the > passed arguments that is expected by the kernel (QCMD is ((cmd) << > SUBCMDSHIFT) | ((type) & SUBCMDMASK)). Ahh, thanks! Makes sense. > > Also, I wonder why caddr_t was used at all, instead of void*. It seems > > to unnecessarily require a cast, which could have been avoided with > > void*. In quotactl_fd(), since we need to use syscall(2), which is > > variadic, I'll document the correct pointer types, instead of caddr_t*. > > For this I don't have a good answer. It was like that for ages... I guess > you can ask glibc guys - the kernel uses void * but glibc uses caddr_t. Hmmmm. I'll ask; thanks! Cheers, Alex -- <https://www.alejandro-colomar.es>
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmoLLFQACgkQ64mZXMKQ wqnkKw/8CVWIk6pRazr/mG9XELsqrZQB036N0SH1RGvVCA5dtp7/GUL8Kp0G0rMN JnBwnTFfOnClkoDEG/1eiR/f8FqTI/VQkSwVOEdSfHcwMuBifGV1FGc5JTGwoFM8 uOhETTRULKNfxCgR3JS4W3aM+0jzwb6PK6556WoRc7XnWjMxuwtSrqJGJ0o7uYXz ct7m/eG/xNkiIB4H4baFbrLGj8gxeavhOH2NHzNQQb47i45I9ROiefdQXun9qi6I JPS+JyxNCNbpsgGBKMpVxNDuETv48Zmu36tEB+u/MCn34P9vVH6Gue/GKIUm0Lh7 1suZhUWjCd8zovabMbhpVpdZEBjfAJCYPiACWRLTO0WXfTiXCDZa8GKic54AaZ2k A66IMwMUMX/W2ZiJvcXSscdd1FNaSSdrB9AwURmMNM9iozFAon2sXg/qwsNJ6X8L J8MeTQiU2qtZIGQ/zSpfO/9VdqkvkmZRr8yR/JTxN5ieYHSWtdUhsg1MfdTuEoeH HyVKFK57Bl5a+Fjk5yrsoa+8dsPWO2nXle0ql/52xT3RUcswZbGRZqzU1NKNR2Ik zG+Pe7wfcWeHbYaTdqbjRZZfWhWbQA/YAefJTKOWfNjb0n9FJ/Fn0Op2WLOXFoL9 pMS8vdEdh4cLAhdz+UWjSUtJIhF+WZ+BVRUDcccT7sfCNwm+xtY= =cf3x -----END PGP SIGNATURE-----