diff options
| author | Joel Granados <joel.granados@kernel.org> | 2025-10-03 14:07:18 +0200 |
|---|---|---|
| committer | Joel Granados <joel.granados@kernel.org> | 2025-11-27 15:43:20 +0100 |
| commit | 5412f5b13d290d22cf910a0e8227737aaa2cc44e (patch) | |
| tree | 35ba42d14e21883be1e33ad47086e510f1e8a3c1 /tools/docs/parse-headers.py | |
| parent | 610c9b6efb701e559f5b5d449e69e76e91ea4401 (diff) | |
sysctl: Indicate the direction of operation with macro names
Replace the "write" integer parameter with SYSCTL_USER_TO_KERN() and
SYSCTL_KERN_TO_USER() that clearly indicate data flow direction in
sysctl operations.
"write" originates in proc_sysctl.c (proc_sys_{read,write}) and can take
one of two values: "0" or "1" when called from proc_sys_read and
proc_sys_write respectively. When write has a value of zero, data is
"written" to a user space buffer from a kernel variable (usually
ctl_table->data). Whereas when write has a value greater than zero, data
is "written" to an internal kernel variable from a user space buffer.
Remove this ambiguity by introducing macros that clearly indicate the
direction of the "write".
The write mode names in sysctl_writes_mode are left unchanged as these
directly relate to the sysctl_write_strict file in /proc/sys where the
word "write" unambiguously refers to writing to a file.
Signed-off-by: Joel Granados <joel.granados@kernel.org>
Diffstat (limited to 'tools/docs/parse-headers.py')
0 files changed, 0 insertions, 0 deletions
