aboutsummaryrefslogtreecommitdiffstats
path: root/mm/filemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 23acefe51808..2e2d38ebda4b 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -513,6 +513,7 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
513 } 513 }
514 return ret; 514 return ret;
515} 515}
516EXPORT_SYMBOL_GPL(add_to_page_cache_lru);
516 517
517#ifdef CONFIG_NUMA 518#ifdef CONFIG_NUMA
518struct page *__page_cache_alloc(gfp_t gfp) 519struct page *__page_cache_alloc(gfp_t gfp)
@@ -565,6 +566,24 @@ void wait_on_page_bit(struct page *page, int bit_nr)
565EXPORT_SYMBOL(wait_on_page_bit); 566EXPORT_SYMBOL(wait_on_page_bit);
566 567
567/** 568/**
569 * add_page_wait_queue - Add an arbitrary waiter to a page's wait queue
570 * @page - Page defining the wait queue of interest
571 * @waiter - Waiter to add to the queue
572 *
573 * Add an arbitrary @waiter to the wait queue for the nominated @page.
574 */
575void add_page_wait_queue(struct page *page, wait_queue_t *waiter)
576{
577 wait_queue_head_t *q = page_waitqueue(page);
578 unsigned long flags;
579
580 spin_lock_irqsave(&q->lock, flags);
581 __add_wait_queue(q, waiter);
582 spin_unlock_irqrestore(&q->lock, flags);
583}
584EXPORT_SYMBOL_GPL(add_page_wait_queue);
585
586/**
568 * unlock_page - unlock a locked page 587 * unlock_page - unlock a locked page
569 * @page: the page 588 * @page: the page
570 * 589 *
@@ -627,6 +646,7 @@ int __lock_page_killable(struct page *page)
627 return __wait_on_bit_lock(page_waitqueue(page), &wait, 646 return __wait_on_bit_lock(page_waitqueue(page), &wait,
628 sync_page_killable, TASK_KILLABLE); 647 sync_page_killable, TASK_KILLABLE);
629} 648}
649EXPORT_SYMBOL_GPL(__lock_page_killable);
630 650
631/** 651/**
632 * __lock_page_nosync - get a lock on the page, without calling sync_page() 652 * __lock_page_nosync - get a lock on the page, without calling sync_page()
@@ -1823,7 +1843,7 @@ static size_t __iovec_copy_from_user_inatomic(char *vaddr,
1823 int copy = min(bytes, iov->iov_len - base); 1843 int copy = min(bytes, iov->iov_len - base);
1824 1844
1825 base = 0; 1845 base = 0;
1826 left = __copy_from_user_inatomic_nocache(vaddr, buf, copy); 1846 left = __copy_from_user_inatomic(vaddr, buf, copy);
1827 copied += copy; 1847 copied += copy;
1828 bytes -= copy; 1848 bytes -= copy;
1829 vaddr += copy; 1849 vaddr += copy;
@@ -1851,8 +1871,7 @@ size_t iov_iter_copy_from_user_atomic(struct page *page,
1851 if (likely(i->nr_segs == 1)) { 1871 if (likely(i->nr_segs == 1)) {
1852 int left; 1872 int left;
1853 char __user *buf = i->iov->iov_base + i->iov_offset; 1873 char __user *buf = i->iov->iov_base + i->iov_offset;
1854 left = __copy_from_user_inatomic_nocache(kaddr + offset, 1874 left = __copy_from_user_inatomic(kaddr + offset, buf, bytes);
1855 buf, bytes);
1856 copied = bytes - left; 1875 copied = bytes - left;
1857 } else { 1876 } else {
1858 copied = __iovec_copy_from_user_inatomic(kaddr + offset, 1877 copied = __iovec_copy_from_user_inatomic(kaddr + offset,
@@ -1880,7 +1899,7 @@ size_t iov_iter_copy_from_user(struct page *page,
1880 if (likely(i->nr_segs == 1)) { 1899 if (likely(i->nr_segs == 1)) {
1881 int left; 1900 int left;
1882 char __user *buf = i->iov->iov_base + i->iov_offset; 1901 char __user *buf = i->iov->iov_base + i->iov_offset;
1883 left = __copy_from_user_nocache(kaddr + offset, buf, bytes); 1902 left = __copy_from_user(kaddr + offset, buf, bytes);
1884 copied = bytes - left; 1903 copied = bytes - left;
1885 } else { 1904 } else {
1886 copied = __iovec_copy_from_user_inatomic(kaddr + offset, 1905 copied = __iovec_copy_from_user_inatomic(kaddr + offset,
@@ -2464,6 +2483,9 @@ EXPORT_SYMBOL(generic_file_aio_write);
2464 * (presumably at page->private). If the release was successful, return `1'. 2483 * (presumably at page->private). If the release was successful, return `1'.
2465 * Otherwise return zero. 2484 * Otherwise return zero.
2466 * 2485 *
2486 * This may also be called if PG_fscache is set on a page, indicating that the
2487 * page is known to the local caching routines.
2488 *
2467 * The @gfp_mask argument specifies whether I/O may be performed to release 2489 * The @gfp_mask argument specifies whether I/O may be performed to release
2468 * this page (__GFP_IO), and whether the call may block (__GFP_WAIT & __GFP_FS). 2490 * this page (__GFP_IO), and whether the call may block (__GFP_WAIT & __GFP_FS).
2469 * 2491 *