git: kernel: Cleanup <sys/uio.h> issues.
Rimvydas Jasinskas
zrj at crater.dragonflybsd.org
Thu Oct 24 04:59:32 PDT 2019
commit 13dd34d80aa1e622804053e295c7590882a7df3e
Author: zrj <rimvydas.jasinskas at gmail.com>
Date: Fri Oct 18 11:46:47 2019 +0300
kernel: Cleanup <sys/uio.h> issues.
The iovec_free() inline very complicates this header inclusion. The
NULL check is not always seen from <sys/_null.h>. Luckily only three
kernel sources needs it: kern_subr.c, sys_generic.c and uipc_syscalls.c.
Also just a single dev/drm source makes use of 'struct uio'.
* Include <sys/uio.h> explicitly first in drm_fops.c to avoid kfree()
macro override in drm compat layer.
* Use <sys/_uio.h> where only enums and struct uio is needed, but ensure
that userland will not include it for possible later <sys/user.h> use.
* Stop using <sys/vnode.h> as shortcut for uiomove*() prototypes. The
uiomove*() family functions possibly transfer data across kernel/user
space boundary. This header presence explicitly mark sources as such.
* Prefer to add <sys/uio.h> after <sys/systm.h>, but before <sys/proc.h>
and definitely before <sys/malloc.h> (except for 3 mentioned sources).
This will allow to remove <sys/malloc.h> from <sys/uio.h> later on.
* Adjust <sys/user.h> to use component headers instead of <sys/uio.h>.
While there, use opportunity for a minimal whitespace cleanup.
No functional differences observed in compiler intermediates.
Summary of changes:
sys/bus/cam/scsi/scsi_target.c | 1 +
sys/dev/disk/vn/vn.c | 1 +
sys/dev/drm/drm_fops.c | 2 ++
sys/dev/misc/nmdm/nmdm.c | 1 +
sys/dev/misc/snp/snp.c | 3 ++-
sys/dev/video/bktr/bktr_core.c | 1 +
sys/gnu/vfs/ext2fs/ext2_lookup.c | 1 +
sys/gnu/vfs/ext2fs/ext2_quota.c | 1 +
sys/gnu/vfs/ext2fs/ext2_vnops.c | 1 +
sys/kern/kern_fp.c | 1 +
sys/kern/kern_ktrace.c | 1 +
sys/kern/kern_udev.c | 1 +
sys/kern/kern_xio.c | 3 +--
sys/kern/subr_log.c | 1 +
sys/kern/sys_process.c | 1 +
sys/kern/tty.c | 1 +
sys/kern/tty_pty.c | 1 +
sys/kern/vfs_cache.c | 1 +
sys/kern/vfs_helper.c | 2 +-
sys/kern/vfs_nlookup.c | 1 +
sys/kern/vfs_subr.c | 1 +
sys/kern/vfs_vnops.c | 1 +
sys/net/bpf.c | 5 +++--
sys/sys/file.h | 4 ++--
sys/sys/kern_syscall.h | 2 +-
sys/sys/namei.h | 2 --
sys/sys/nlookup.h | 4 +---
sys/sys/user.h | 7 +++++--
sys/sys/vnode.h | 4 ++--
sys/sys/xio.h | 6 ++----
sys/vfs/hammer/hammer.h | 1 +
sys/vfs/hpfs/hpfs_vnops.c | 1 +
sys/vfs/isofs/cd9660/cd9660_vnops.c | 1 +
sys/vfs/msdosfs/msdosfs_vnops.c | 1 +
sys/vfs/nfs/nfs_bio.c | 1 +
sys/vfs/nfs/nfs_vnops.c | 1 +
sys/vfs/ntfs/ntfs_subr.c | 1 +
sys/vfs/ntfs/ntfs_vnops.c | 1 +
sys/vfs/procfs/procfs_dbregs.c | 4 ++--
sys/vfs/procfs/procfs_fpregs.c | 4 ++--
sys/vfs/procfs/procfs_map.c | 2 +-
sys/vfs/procfs/procfs_mem.c | 1 +
sys/vfs/procfs/procfs_regs.c | 4 ++--
sys/vfs/procfs/procfs_rlimit.c | 4 ++--
sys/vfs/procfs/procfs_status.c | 9 +++++----
sys/vfs/procfs/procfs_subr.c | 3 ++-
sys/vfs/procfs/procfs_type.c | 2 +-
sys/vfs/smbfs/smbfs_io.c | 1 +
sys/vfs/smbfs/smbfs_vnops.c | 1 +
sys/vfs/tmpfs/tmpfs_vnops.c | 3 ++-
sys/vfs/udf/udf_vnops.c | 5 +++--
sys/vfs/ufs/ffs_vnops.c | 1 +
sys/vfs/ufs/ufs_quota.c | 3 ++-
sys/vfs/ufs/ufs_vnops.c | 1 +
sys/vm/vnode_pager.c | 5 +++--
55 files changed, 80 insertions(+), 43 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/13dd34d80aa1e622804053e295c7590882a7df3e
--
DragonFly BSD source repository
More information about the Commits
mailing list