kernel: Cleanup <sys/uio.h> issues.
authorzrj <rimvydas.jasinskas@gmail.com>
Fri, 18 Oct 2019 08:46:47 +0000 (11:46 +0300)
committerzrj <rimvydas.jasinskas@gmail.com>
Thu, 24 Oct 2019 12:20:26 +0000 (15:20 +0300)
commit13dd34d80aa1e622804053e295c7590882a7df3e
tree05428bd4c405ac0c155ab0864e64c68f69ea57d4
parent46ff5cf9bb0d221a6a8b9b1d727ba555e4322238
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.
55 files changed:
sys/bus/cam/scsi/scsi_target.c
sys/dev/disk/vn/vn.c
sys/dev/drm/drm_fops.c
sys/dev/misc/nmdm/nmdm.c
sys/dev/misc/snp/snp.c
sys/dev/video/bktr/bktr_core.c
sys/gnu/vfs/ext2fs/ext2_lookup.c
sys/gnu/vfs/ext2fs/ext2_quota.c
sys/gnu/vfs/ext2fs/ext2_vnops.c
sys/kern/kern_fp.c
sys/kern/kern_ktrace.c
sys/kern/kern_udev.c
sys/kern/kern_xio.c
sys/kern/subr_log.c
sys/kern/sys_process.c
sys/kern/tty.c
sys/kern/tty_pty.c
sys/kern/vfs_cache.c
sys/kern/vfs_helper.c
sys/kern/vfs_nlookup.c
sys/kern/vfs_subr.c
sys/kern/vfs_vnops.c
sys/net/bpf.c
sys/sys/file.h
sys/sys/kern_syscall.h
sys/sys/namei.h
sys/sys/nlookup.h
sys/sys/user.h
sys/sys/vnode.h
sys/sys/xio.h
sys/vfs/hammer/hammer.h
sys/vfs/hpfs/hpfs_vnops.c
sys/vfs/isofs/cd9660/cd9660_vnops.c
sys/vfs/msdosfs/msdosfs_vnops.c
sys/vfs/nfs/nfs_bio.c
sys/vfs/nfs/nfs_vnops.c
sys/vfs/ntfs/ntfs_subr.c
sys/vfs/ntfs/ntfs_vnops.c
sys/vfs/procfs/procfs_dbregs.c
sys/vfs/procfs/procfs_fpregs.c
sys/vfs/procfs/procfs_map.c
sys/vfs/procfs/procfs_mem.c
sys/vfs/procfs/procfs_regs.c
sys/vfs/procfs/procfs_rlimit.c
sys/vfs/procfs/procfs_status.c
sys/vfs/procfs/procfs_subr.c
sys/vfs/procfs/procfs_type.c
sys/vfs/smbfs/smbfs_io.c
sys/vfs/smbfs/smbfs_vnops.c
sys/vfs/tmpfs/tmpfs_vnops.c
sys/vfs/udf/udf_vnops.c
sys/vfs/ufs/ffs_vnops.c
sys/vfs/ufs/ufs_quota.c
sys/vfs/ufs/ufs_vnops.c
sys/vm/vnode_pager.c