diff options
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r-- | include/linux/mm.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 81443d557a2e..8aa4006b9636 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -297,12 +297,26 @@ static inline int put_page_testzero(struct page *page) | |||
297 | /* | 297 | /* |
298 | * Try to grab a ref unless the page has a refcount of zero, return false if | 298 | * Try to grab a ref unless the page has a refcount of zero, return false if |
299 | * that is the case. | 299 | * that is the case. |
300 | * This can be called when MMU is off so it must not access | ||
301 | * any of the virtual mappings. | ||
300 | */ | 302 | */ |
301 | static inline int get_page_unless_zero(struct page *page) | 303 | static inline int get_page_unless_zero(struct page *page) |
302 | { | 304 | { |
303 | return atomic_inc_not_zero(&page->_count); | 305 | return atomic_inc_not_zero(&page->_count); |
304 | } | 306 | } |
305 | 307 | ||
308 | /* | ||
309 | * Try to drop a ref unless the page has a refcount of one, return false if | ||
310 | * that is the case. | ||
311 | * This is to make sure that the refcount won't become zero after this drop. | ||
312 | * This can be called when MMU is off so it must not access | ||
313 | * any of the virtual mappings. | ||
314 | */ | ||
315 | static inline int put_page_unless_one(struct page *page) | ||
316 | { | ||
317 | return atomic_add_unless(&page->_count, -1, 1); | ||
318 | } | ||
319 | |||
306 | extern int page_is_ram(unsigned long pfn); | 320 | extern int page_is_ram(unsigned long pfn); |
307 | 321 | ||
308 | /* Support for virtually mapped pages */ | 322 | /* Support for virtually mapped pages */ |