v1
2026-11-03
procfs移除用户态读写接口 · v1
移除 procfs 可删除项的 write/ioctl 回调,仅保留永久项 read,并将 _buf 方法重命名为 proc_write/read/ioctl。
原始补丁链接
子 Patch(5)
1/5
proc: drop ->proc_write()
[proc: drop ->proc_write()] [patchwork series v1] submitter=Christian Brauner patches (5): [RFC,1/5] proc: drop ->proc_write() [RFC,2/5] proc: drop ->proc_ioctl() and ->proc_compat_ioctl() [RFC,
2/5
proc: drop ->proc_ioctl() and ->proc_compat_ioctl()
Every entry with ioctls implements ->proc_ioctl_buf() now and procfs copies the arguments in and out around pinning the entry, for 32-bit tasks too. Remove ->proc_ioctl() and ->proc_compat_ioctl(). S
3/5
proc: only let permanent entries read straight into userspace
Every entry that can be removed implements ->proc_read_buf() now and procfs copies what is read to userspace after unpinning the entry. ->proc_read() and ->proc_read_iter() are left for the entries th
4/5
proc: rename ->proc_read() and ->proc_read_iter()
[proc: rename ->proc_read() and ->proc_read_iter()] Only entries that are never removed may implement ->proc_read() or ->proc_read_iter() now, and PROC_ENTRY_PERMANENT is 0 in modules. But a module th
5/5
proc: drop the _buf suffix from the new methods
[proc: drop the _buf suffix from the new methods] The _buf suffix told them apart from ->proc_write(), ->proc_read() and ->proc_ioctl(), which copied to and from userspace themselves. Those are gone n