gup: Turn fault_in_pages_{readable,writeable} into fault_in_{readable,writeable}
authorAndreas Gruenbacher <agruenba@redhat.com>
Thu, 14 Apr 2022 22:28:39 +0000 (06:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 May 2022 15:22:28 +0000 (17:22 +0200)
commit923f05a660e60ef22952e09acdd6e37e17ddf084
tree67077858191bf79c664e000e3f9b93d0830e8839
parent19cbd78fb26a2622714183d400b9af2659fa5221
gup: Turn fault_in_pages_{readable,writeable} into fault_in_{readable,writeable}

commit bb523b406c849eef8f265a07cd7f320f1f177743 upstream

Turn fault_in_pages_{readable,writeable} into versions that return the
number of bytes not faulted in, similar to copy_to_user, instead of
returning a non-zero value when any of the requested pages couldn't be
faulted in.  This supports the existing users that require all pages to
be faulted in as well as new users that are happy if any pages can be
faulted in.

Rename the functions to fault_in_{readable,writeable} to make sure
this change doesn't silently break things.

Neither of these functions is entirely trivial and it doesn't seem
useful to inline them, so move them to mm/gup.c.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/kernel/kvm.c
arch/powerpc/kernel/signal_32.c
arch/powerpc/kernel/signal_64.c
arch/x86/kernel/fpu/signal.c
drivers/gpu/drm/armada/armada_gem.c
fs/btrfs/ioctl.c
include/linux/pagemap.h
lib/iov_iter.c
mm/filemap.c
mm/gup.c