aboutsummaryrefslogtreecommitdiffstats
path: root/mm/filemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index dafb06f70a09..65d44fd88c78 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -241,18 +241,6 @@ void delete_from_page_cache(struct page *page)
241} 241}
242EXPORT_SYMBOL(delete_from_page_cache); 242EXPORT_SYMBOL(delete_from_page_cache);
243 243
244static int sleep_on_page(void *word)
245{
246 io_schedule();
247 return 0;
248}
249
250static int sleep_on_page_killable(void *word)
251{
252 sleep_on_page(word);
253 return fatal_signal_pending(current) ? -EINTR : 0;
254}
255
256static int filemap_check_errors(struct address_space *mapping) 244static int filemap_check_errors(struct address_space *mapping)
257{ 245{
258 int ret = 0; 246 int ret = 0;
@@ -692,7 +680,7 @@ void wait_on_page_bit(struct page *page, int bit_nr)
692 DEFINE_WAIT_BIT(wait, &page->flags, bit_nr); 680 DEFINE_WAIT_BIT(wait, &page->flags, bit_nr);
693 681
694 if (test_bit(bit_nr, &page->flags)) 682 if (test_bit(bit_nr, &page->flags))
695 __wait_on_bit(page_waitqueue(page), &wait, sleep_on_page, 683 __wait_on_bit(page_waitqueue(page), &wait, bit_wait_io,
696 TASK_UNINTERRUPTIBLE); 684 TASK_UNINTERRUPTIBLE);
697} 685}
698EXPORT_SYMBOL(wait_on_page_bit); 686EXPORT_SYMBOL(wait_on_page_bit);
@@ -705,7 +693,7 @@ int wait_on_page_bit_killable(struct page *page, int bit_nr)
705 return 0; 693 return 0;
706 694
707 return __wait_on_bit(page_waitqueue(page), &wait, 695 return __wait_on_bit(page_waitqueue(page), &wait,
708 sleep_on_page_killable, TASK_KILLABLE); 696 bit_wait_io, TASK_KILLABLE);
709} 697}
710 698
711/** 699/**
@@ -806,7 +794,7 @@ void __lock_page(struct page *page)
806{ 794{
807 DEFINE_WAIT_BIT(wait, &page->flags, PG_locked); 795 DEFINE_WAIT_BIT(wait, &page->flags, PG_locked);
808 796
809 __wait_on_bit_lock(page_waitqueue(page), &wait, sleep_on_page, 797 __wait_on_bit_lock(page_waitqueue(page), &wait, bit_wait_io,
810 TASK_UNINTERRUPTIBLE); 798 TASK_UNINTERRUPTIBLE);
811} 799}
812EXPORT_SYMBOL(__lock_page); 800EXPORT_SYMBOL(__lock_page);
@@ -816,7 +804,7 @@ int __lock_page_killable(struct page *page)
816 DEFINE_WAIT_BIT(wait, &page->flags, PG_locked); 804 DEFINE_WAIT_BIT(wait, &page->flags, PG_locked);
817 805
818 return __wait_on_bit_lock(page_waitqueue(page), &wait, 806 return __wait_on_bit_lock(page_waitqueue(page), &wait,
819 sleep_on_page_killable, TASK_KILLABLE); 807 bit_wait_io, TASK_KILLABLE);
820} 808}
821EXPORT_SYMBOL_GPL(__lock_page_killable); 809EXPORT_SYMBOL_GPL(__lock_page_killable);
822 810
@@ -1031,18 +1019,21 @@ EXPORT_SYMBOL(find_lock_entry);
1031 * @mapping: the address_space to search 1019 * @mapping: the address_space to search
1032 * @offset: the page index 1020 * @offset: the page index
1033 * @fgp_flags: PCG flags 1021 * @fgp_flags: PCG flags
1034 * @gfp_mask: gfp mask to use if a page is to be allocated 1022 * @cache_gfp_mask: gfp mask to use for the page cache data page allocation
1023 * @radix_gfp_mask: gfp mask to use for radix tree node allocation
1035 * 1024 *
1036 * Looks up the page cache slot at @mapping & @offset. 1025 * Looks up the page cache slot at @mapping & @offset.
1037 * 1026 *
1038 * PCG flags modify how the page is returned 1027 * PCG flags modify how the page is returned.
1039 * 1028 *
1040 * FGP_ACCESSED: the page will be marked accessed 1029 * FGP_ACCESSED: the page will be marked accessed
1041 * FGP_LOCK: Page is return locked 1030 * FGP_LOCK: Page is return locked
1042 * FGP_CREAT: If page is not present then a new page is allocated using 1031 * FGP_CREAT: If page is not present then a new page is allocated using
1043 * @gfp_mask and added to the page cache and the VM's LRU 1032 * @cache_gfp_mask and added to the page cache and the VM's LRU
1044 * list. The page is returned locked and with an increased 1033 * list. If radix tree nodes are allocated during page cache
1045 * refcount. Otherwise, %NULL is returned. 1034 * insertion then @radix_gfp_mask is used. The page is returned
1035 * locked and with an increased refcount. Otherwise, %NULL is
1036 * returned.
1046 * 1037 *
1047 * If FGP_LOCK or FGP_CREAT are specified then the function may sleep even 1038 * If FGP_LOCK or FGP_CREAT are specified then the function may sleep even
1048 * if the GFP flags specified for FGP_CREAT are atomic. 1039 * if the GFP flags specified for FGP_CREAT are atomic.