diff options
Diffstat (limited to 'include/linux/pagemap.h')
-rw-r--r-- | include/linux/pagemap.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index e12cdc6d79ee..2d1ffe3cf1ee 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -299,6 +299,8 @@ static inline pgoff_t linear_page_index(struct vm_area_struct *vma, | |||
299 | extern void __lock_page(struct page *page); | 299 | extern void __lock_page(struct page *page); |
300 | extern int __lock_page_killable(struct page *page); | 300 | extern int __lock_page_killable(struct page *page); |
301 | extern void __lock_page_nosync(struct page *page); | 301 | extern void __lock_page_nosync(struct page *page); |
302 | extern int __lock_page_or_retry(struct page *page, struct mm_struct *mm, | ||
303 | unsigned int flags); | ||
302 | extern void unlock_page(struct page *page); | 304 | extern void unlock_page(struct page *page); |
303 | 305 | ||
304 | static inline void __set_page_locked(struct page *page) | 306 | static inline void __set_page_locked(struct page *page) |
@@ -351,6 +353,17 @@ static inline void lock_page_nosync(struct page *page) | |||
351 | } | 353 | } |
352 | 354 | ||
353 | /* | 355 | /* |
356 | * lock_page_or_retry - Lock the page, unless this would block and the | ||
357 | * caller indicated that it can handle a retry. | ||
358 | */ | ||
359 | static inline int lock_page_or_retry(struct page *page, struct mm_struct *mm, | ||
360 | unsigned int flags) | ||
361 | { | ||
362 | might_sleep(); | ||
363 | return trylock_page(page) || __lock_page_or_retry(page, mm, flags); | ||
364 | } | ||
365 | |||
366 | /* | ||
354 | * This is exported only for wait_on_page_locked/wait_on_page_writeback. | 367 | * This is exported only for wait_on_page_locked/wait_on_page_writeback. |
355 | * Never use this directly! | 368 | * Never use this directly! |
356 | */ | 369 | */ |