Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df9b2b4a authored by David Hildenbrand's avatar David Hildenbrand Committed by Christian Borntraeger
Browse files

mm/page_ref: introduce page_ref_inc_return



Let's introduce that helper.

Signed-off-by: default avatarDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Acked-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
parent 3d84683b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -124,6 +124,15 @@ static inline int page_ref_sub_and_test(struct page *page, int nr)
	return ret;
}

static inline int page_ref_inc_return(struct page *page)
{
	int ret = atomic_inc_return(&page->_refcount);

	if (page_ref_tracepoint_active(__tracepoint_page_ref_mod_and_return))
		__page_ref_mod_and_return(page, 1, ret);
	return ret;
}

static inline int page_ref_dec_and_test(struct page *page)
{
	int ret = atomic_dec_and_test(&page->_refcount);