]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mm: allow multiple error returns in try_grab_page()
authorLogan Gunthorpe <logang@deltatee.com>
Fri, 21 Oct 2022 17:41:08 +0000 (11:41 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 9 Nov 2022 18:29:20 +0000 (11:29 -0700)
commit0f0892356fa174bdd8bd655c820ee3658c4c9f01
tree905f8673a7c67c1947fd197fba64e935cbec53b4
parent5b2560c4c20e6d6933625b4b56f6843d6c7faf0f
mm: allow multiple error returns in try_grab_page()

In order to add checks for P2PDMA memory into try_grab_page(), expand
the error return from a bool to an int/error code. Update all the
callsites handle change in usage.

Also remove the WARN_ON_ONCE() call at the callsites seeing there
already is a WARN_ON_ONCE() inside the function if it fails.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20221021174116.7200-2-logang@deltatee.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/mm.h
mm/gup.c
mm/huge_memory.c
mm/hugetlb.c