Skip to content

Commit a4796e3

Browse files
neilbrowntrondmypd
authored andcommitted
MM: export page_wakeup functions
This will allow NFS to wait for PG_private to be cleared and, particularly, to send a wake-up when it is. Signed-off-by: NeilBrown <[email protected]> Acked-by: Andrew Morton <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent cbbce82 commit a4796e3

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

include/linux/pagemap.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,8 @@ static inline int lock_page_or_retry(struct page *page, struct mm_struct *mm,
496496
}
497497

498498
/*
499-
* This is exported only for wait_on_page_locked/wait_on_page_writeback.
500-
* Never use this directly!
499+
* This is exported only for wait_on_page_locked/wait_on_page_writeback,
500+
* and for filesystems which need to wait on PG_private.
501501
*/
502502
extern void wait_on_page_bit(struct page *page, int bit_nr);
503503

@@ -512,6 +512,12 @@ static inline int wait_on_page_locked_killable(struct page *page)
512512
return 0;
513513
}
514514

515+
extern wait_queue_head_t *page_waitqueue(struct page *page);
516+
static inline void wake_up_page(struct page *page, int bit)
517+
{
518+
__wake_up_bit(page_waitqueue(page), &page->flags, bit);
519+
}
520+
515521
/*
516522
* Wait for a page to be unlocked.
517523
*

mm/filemap.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -670,17 +670,13 @@ EXPORT_SYMBOL(__page_cache_alloc);
670670
* at a cost of "thundering herd" phenomena during rare hash
671671
* collisions.
672672
*/
673-
static wait_queue_head_t *page_waitqueue(struct page *page)
673+
wait_queue_head_t *page_waitqueue(struct page *page)
674674
{
675675
const struct zone *zone = page_zone(page);
676676

677677
return &zone->wait_table[hash_ptr(page, zone->wait_table_bits)];
678678
}
679-
680-
static inline void wake_up_page(struct page *page, int bit)
681-
{
682-
__wake_up_bit(page_waitqueue(page), &page->flags, bit);
683-
}
679+
EXPORT_SYMBOL(page_waitqueue);
684680

685681
void wait_on_page_bit(struct page *page, int bit_nr)
686682
{

0 commit comments

Comments
 (0)