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.h32
1 files changed, 12 insertions, 20 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 3df8c7db7a4e..7ea069cd3257 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -24,8 +24,7 @@ enum mapping_flags {
24 AS_ENOSPC = __GFP_BITS_SHIFT + 1, /* ENOSPC on async write */ 24 AS_ENOSPC = __GFP_BITS_SHIFT + 1, /* ENOSPC on async write */
25 AS_MM_ALL_LOCKS = __GFP_BITS_SHIFT + 2, /* under mm_take_all_locks() */ 25 AS_MM_ALL_LOCKS = __GFP_BITS_SHIFT + 2, /* under mm_take_all_locks() */
26 AS_UNEVICTABLE = __GFP_BITS_SHIFT + 3, /* e.g., ramdisk, SHM_LOCK */ 26 AS_UNEVICTABLE = __GFP_BITS_SHIFT + 3, /* e.g., ramdisk, SHM_LOCK */
27 AS_BALLOON_MAP = __GFP_BITS_SHIFT + 4, /* balloon page special map */ 27 AS_EXITING = __GFP_BITS_SHIFT + 4, /* final truncate in progress */
28 AS_EXITING = __GFP_BITS_SHIFT + 5, /* final truncate in progress */
29}; 28};
30 29
31static inline void mapping_set_error(struct address_space *mapping, int error) 30static inline void mapping_set_error(struct address_space *mapping, int error)
@@ -55,21 +54,6 @@ static inline int mapping_unevictable(struct address_space *mapping)
55 return !!mapping; 54 return !!mapping;
56} 55}
57 56
58static inline void mapping_set_balloon(struct address_space *mapping)
59{
60 set_bit(AS_BALLOON_MAP, &mapping->flags);
61}
62
63static inline void mapping_clear_balloon(struct address_space *mapping)
64{
65 clear_bit(AS_BALLOON_MAP, &mapping->flags);
66}
67
68static inline int mapping_balloon(struct address_space *mapping)
69{
70 return mapping && test_bit(AS_BALLOON_MAP, &mapping->flags);
71}
72
73static inline void mapping_set_exiting(struct address_space *mapping) 57static inline void mapping_set_exiting(struct address_space *mapping)
74{ 58{
75 set_bit(AS_EXITING, &mapping->flags); 59 set_bit(AS_EXITING, &mapping->flags);
@@ -96,7 +80,7 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask)
96} 80}
97 81
98/* 82/*
99 * The page cache can done in larger chunks than 83 * The page cache can be done in larger chunks than
100 * one page, because it allows for more efficient 84 * one page, because it allows for more efficient
101 * throughput (it can then be mapped into user 85 * throughput (it can then be mapped into user
102 * space in smaller chunks for same flexibility). 86 * space in smaller chunks for same flexibility).
@@ -496,12 +480,14 @@ static inline int lock_page_or_retry(struct page *page, struct mm_struct *mm,
496} 480}
497 481
498/* 482/*
499 * This is exported only for wait_on_page_locked/wait_on_page_writeback. 483 * This is exported only for wait_on_page_locked/wait_on_page_writeback,
500 * Never use this directly! 484 * and for filesystems which need to wait on PG_private.
501 */ 485 */
502extern void wait_on_page_bit(struct page *page, int bit_nr); 486extern void wait_on_page_bit(struct page *page, int bit_nr);
503 487
504extern int wait_on_page_bit_killable(struct page *page, int bit_nr); 488extern int wait_on_page_bit_killable(struct page *page, int bit_nr);
489extern int wait_on_page_bit_killable_timeout(struct page *page,
490 int bit_nr, unsigned long timeout);
505 491
506static inline int wait_on_page_locked_killable(struct page *page) 492static inline int wait_on_page_locked_killable(struct page *page)
507{ 493{
@@ -510,6 +496,12 @@ static inline int wait_on_page_locked_killable(struct page *page)
510 return 0; 496 return 0;
511} 497}
512 498
499extern wait_queue_head_t *page_waitqueue(struct page *page);
500static inline void wake_up_page(struct page *page, int bit)
501{
502 __wake_up_bit(page_waitqueue(page), &page->flags, bit);
503}
504
513/* 505/*
514 * Wait for a page to be unlocked. 506 * Wait for a page to be unlocked.
515 * 507 *