Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1426603
| From | Christian Borntraeger <borntraeger@de.ibm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/1] mm/page_ref: introduce page_ref_inc_return |
| Date | 2016-06-20 15:30 +0200 |
| Message-ID | <rM7r4-jP-33@gated-at.bofh.it> (permalink) |
| References | <rM7r4-jP-35@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: David Hildenbrand <dahi@linux.vnet.ibm.com>
Let's introduce that helper.
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
include/linux/page_ref.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/linux/page_ref.h b/include/linux/page_ref.h
index 8b5e0a9..610e132 100644
--- a/include/linux/page_ref.h
+++ b/include/linux/page_ref.h
@@ -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);
--
2.5.5
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH 1/1] mm/page_ref: introduce page_ref_inc_return Christian Borntraeger <borntraeger@de.ibm.com> - 2016-06-20 15:30 +0200 Re: [PATCH 1/1] mm/page_ref: introduce page_ref_inc_return Andrew Morton <akpm@linux-foundation.org> - 2016-06-21 01:20 +0200
csiph-web