mm/page_ref: introduce page_ref_inc_return
Let's introduce that helper. Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Acked-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
This commit is contained in:
committed by
Christian Borntraeger
parent
3d84683bd7
commit
df9b2b4a4a
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user