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

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
...@@ -124,6 +124,15 @@ static inline int page_ref_sub_and_test(struct page *page, int nr) ...@@ -124,6 +124,15 @@ static inline int page_ref_sub_and_test(struct page *page, int nr)
return ret; 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) static inline int page_ref_dec_and_test(struct page *page)
{ {
int ret = atomic_dec_and_test(&page->_refcount); int ret = atomic_dec_and_test(&page->_refcount);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment