From: Alejandro Colomar <alx@kernel.org>
To: Jan Kara <jack@suse.cz>
Cc: linux-man@vger.kernel.org, Petr Gajdos <pgajdos@suse.cz>
Subject: Re: [PATCH v1] man/man2/quotactl.2: tfix
Date: Mon, 18 May 2026 17:12:27 +0200 [thread overview]
Message-ID: <agsrnqainyp3vZbX@devuan> (raw)
In-Reply-To: <b2kszapero3mb6q3763rrgjjfltkvt7aapm6s7oakpbpepfypk@mwybch7ayyqd>
[-- Attachment #1: Type: text/plain, Size: 1658 bytes --]
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>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2026-05-18 15:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-16 17:12 [PATCH v1] man/man2/quotactl.2: tfix Alejandro Colomar
2026-05-18 10:20 ` Jan Kara
2026-05-18 10:27 ` Alejandro Colomar
2026-05-18 12:51 ` Alejandro Colomar
2026-05-18 15:05 ` Jan Kara
2026-05-18 15:12 ` Alejandro Colomar [this message]
2026-05-18 15:17 ` Why is caddr_t used in quotactl(2)? Alejandro Colomar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=agsrnqainyp3vZbX@devuan \
--to=alx@kernel.org \
--cc=jack@suse.cz \
--cc=linux-man@vger.kernel.org \
--cc=pgajdos@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.