aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pagemap.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pagemap.h')
-rw-r--r--include/linux/pagemap.h13
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,
299extern void __lock_page(struct page *page); 299extern void __lock_page(struct page *page);
300extern int __lock_page_killable(struct page *page); 300extern int __lock_page_killable(struct page *page);
301extern void __lock_page_nosync(struct page *page); 301extern void __lock_page_nosync(struct page *page);
302extern int __lock_page_or_retry(struct page *page, struct mm_struct *mm,
303 unsigned int flags);
302extern void unlock_page(struct page *page); 304extern void unlock_page(struct page *page);
303 305
304static inline void __set_page_locked(struct page *page) 306static 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 */
359static 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 */