Reorder checks in the read/write(2) family of syscalls to prepare making
authormpi <mpi@openbsd.org>
Mon, 20 Aug 2018 16:00:22 +0000 (16:00 +0000)
committermpi <mpi@openbsd.org>
Mon, 20 Aug 2018 16:00:22 +0000 (16:00 +0000)
commit2bd648c0c791046970147cb6db731832ad511740
tree9513fd3a61c273d992777348c936600acb660044
parent864f2f83ec4c08eb41848f403ee4e5dadd8f3951
Reorder checks in the read/write(2) family of syscalls to prepare making
file operations mp-safe.

This change makes it clear that `f_offset' is only accessed in vn_read()
and vn_write(), which will help taking it out of the KERNEL_LOCK().

This refactoring uncovered a race in vn_read() which is now documented
and will be addressed in a later diff.

ok visa@
sys/dev/pci/drm/drm_linux.c
sys/kern/kern_event.c
sys/kern/sys_generic.c
sys/kern/sys_pipe.c
sys/kern/sys_socket.c
sys/kern/vfs_syscalls.c
sys/kern/vfs_vnops.c
sys/sys/file.h
sys/sys/socketvar.h
sys/sys/uio.h