aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGravatar Logan Gunthorpe <logang@deltatee.com> 2022-10-21 11:41:08 -0600
committerGravatar Jens Axboe <axboe@kernel.dk> 2022-11-09 11:29:20 -0700
commit0f0892356fa174bdd8bd655c820ee3658c4c9f01 (patch)
tree905f8673a7c67c1947fd197fba64e935cbec53b4 /include
parentblock: Fix some kernel-doc comments (diff)
downloadlinux-0f0892356fa174bdd8bd655c820ee3658c4c9f01.tar.gz
linux-0f0892356fa174bdd8bd655c820ee3658c4c9f01.tar.bz2
linux-0f0892356fa174bdd8bd655c820ee3658c4c9f01.zip
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mm.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 8bbcccbc5565..62a91dc1272b 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1129,7 +1129,7 @@ static inline void get_page(struct page *page)
folio_get(page_folio(page));
}
-bool __must_check try_grab_page(struct page *page, unsigned int flags);
+int __must_check try_grab_page(struct page *page, unsigned int flags);
static inline __must_check bool try_get_page(struct page *page)
{