]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/gup: small refactoring: simplify try_grab_page()
authorJohn Hubbard <jhubbard@nvidia.com>
Mon, 23 Aug 2021 23:59:10 +0000 (09:59 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Aug 2021 23:33:43 +0000 (09:33 +1000)
commit5da0b9c43c4e8f53e6e281a313ade16dffeec6b4
tree8787113639126240af105d988fbd03a9a85f5189
parent4898d4388f16bfba42f2c07eebcb04a777c10da5
mm/gup: small refactoring: simplify try_grab_page()

try_grab_page() does the same thing as try_grab_compound_head(..., refs=1,
...), just with a different API.  So there is a lot of code duplication
there.

Change try_grab_page() to call try_grab_compound_head(), while keeping the
API contract identical for callers.

Also, now that try_grab_compound_head() always has a caller, remove the
__maybe_unused annotation.

Link: https://lkml.kernel.org/r/20210813044133.1536842-3-jhubbard@nvidia.com
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
include/linux/mm.h
mm/gup.c