clean up kernel_{read,write} & friends v5

From: Christoph Hellwig
Date: Wed Jun 24 2020 - 12:14:05 EST


Hi Al,

this series fixes a few issues and cleans up the helpers that read from
or write to kernel space buffers, and ensures that we don't change the
address limit if we are using the ->read_iter and ->write_iter methods
that don't need the changed address limit.

I did not add your suggested comments on the instances using
uaccess_kernel as all of them already have comments. If you have
anything better in mind feel free to throw in additional comments.


Changes since v4:
- warn on calling __kernel_write on files not open for write
- add a FMODE_READ check and warning in __kernel_read
- add a new patch to remove kernel_readv
- stop preferring the iter variants if normal read/write is
present

Changes since v3:
- keep call_read_iter/call_write_iter for now
- don't modify an existing long line
- update a change log

Changes since v2:
- picked up a few ACKs

Changes since v1:
- __kernel_write must not take sb_writers
- unexport __kernel_write

Diffstat:
fs/autofs/waitq.c | 2
fs/cachefiles/rdwr.c | 2
fs/read_write.c | 171 ++++++++++++++++++++++++++-----------------
fs/splice.c | 53 +++----------
include/linux/fs.h | 4 -
net/bpfilter/bpfilter_kern.c | 2
security/integrity/iint.c | 14 ---
7 files changed, 125 insertions(+), 123 deletions(-)