Linux Kernel
3.7.1
|
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/list.h>
#include <linux/highmem.h>
#include <linux/compiler.h>
#include <asm/uaccess.h>
#include <linux/gfp.h>
#include <linux/bitops.h>
#include <linux/hardirq.h>
#include <linux/hugetlb_inline.h>
Go to the source code of this file.
Macros | |
#define | PAGE_CACHE_SHIFT PAGE_SHIFT |
#define | PAGE_CACHE_SIZE PAGE_SIZE |
#define | PAGE_CACHE_MASK PAGE_MASK |
#define | PAGE_CACHE_ALIGN(addr) (((addr)+PAGE_CACHE_SIZE-1)&PAGE_CACHE_MASK) |
#define | page_cache_get(page) get_page(page) |
#define | page_cache_release(page) put_page(page) |
Typedefs | |
typedef int | filler_t (void *, struct page *) |
Enumerations | |
enum | mapping_flags { AS_EIO = __GFP_BITS_SHIFT + 0, AS_ENOSPC = __GFP_BITS_SHIFT + 1, AS_MM_ALL_LOCKS = __GFP_BITS_SHIFT + 2, AS_UNEVICTABLE = __GFP_BITS_SHIFT + 3 } |
#define PAGE_CACHE_ALIGN | ( | addr | ) | (((addr)+PAGE_CACHE_SIZE-1)&PAGE_CACHE_MASK) |
#define PAGE_CACHE_SHIFT PAGE_SHIFT |
enum mapping_flags |
void add_page_wait_queue | ( | struct page * | page, |
wait_queue_t * | waiter | ||
) |
|
read |
unsigned find_get_pages | ( | struct address_space * | mapping, |
pgoff_t | start, | ||
unsigned int | nr_pages, | ||
struct page ** | pages | ||
) |
find_get_pages - gang pagecache lookup : The address_space to search : The starting page index : The maximum number of pages : Where the resulting pages are placed
find_get_pages() will search for and return a group of up to pages in the mapping. The pages are placed at . find_get_pages() takes a reference against the returned pages.
The search returns a group of mapping-contiguous pages with ascending indexes. There may be holes in the indices due to not-present pages.
find_get_pages() returns the number of pages which were found.
unsigned find_get_pages_contig | ( | struct address_space * | mapping, |
pgoff_t | index, | ||
unsigned int | nr_pages, | ||
struct page ** | pages | ||
) |
find_get_pages_contig - gang contiguous pagecache lookup : The address_space to search : The starting page index : The maximum number of pages : Where the resulting pages are placed
find_get_pages_contig() works exactly like find_get_pages(), except that the returned number of pages are guaranteed to be contiguous.
find_get_pages_contig() returns the number of pages which were found.
unsigned find_get_pages_tag | ( | struct address_space * | mapping, |
pgoff_t * | index, | ||
int | tag, | ||
unsigned int | nr_pages, | ||
struct page ** | pages | ||
) |
find_get_pages_tag - find and return pages that match : the address_space to search : the starting page index : the tag index : the maximum number of pages : where the resulting pages are placed
Like find_get_pages, except we only return pages which are tagged with . We update to index the next page for the traversal.
|
read |
find_lock_page - locate, pin and lock a pagecache page : the address_space to search : the page index
Locates the desired pagecache page, locks it, increments its reference count and returns its address.
Returns zero if the page was not present. find_lock_page() may sleep.
|
read |
find_or_create_page - locate or add a pagecache page : the page's address_space : the page's index into the mapping : page allocation mode
Locates a page in the pagecache. If the page is not present, a new page is allocated using and is added to the pagecache and to the VM's LRU list. The returned page is locked and has its reference count incremented.
find_or_create_page() may sleep, even if specifies an atomic allocation!
find_or_create_page() returns the desired page's address, or zero on memory exhaustion.
|
read |
grab_cache_page_nowait - returns locked page at given index in given cache : target address_space : the page index
Same as grab_cache_page(), but do not wait if the page is unavailable. This is intended for speculative data generators, where the data can be regenerated if the page couldn't be grabbed. This routine should be safe to call while holding the lock for another page.
Clear __GFP_FS when allocating the page to avoid recursion into the fs and deadlock against the caller's locked page.
|
read |
pgoff_t linear_hugepage_index | ( | struct vm_area_struct * | vma, |
unsigned long | address | ||
) |
|
read |
|
read |
read_cache_page_gfp - read into page cache, using specified page allocation flags. : the page's address_space : the page index : the page allocator flags to use if allocating
This is the same as "read_mapping_page(mapping, index, NULL)", but with any new page allocations done using the specified allocation flags.
If the page does not get brought uptodate, return -EIO.
int read_cache_pages | ( | struct address_space * | mapping, |
struct list_head * | pages, | ||
filler_t * | filler, | ||
void * | data | ||
) |
replace_page_cache_page - replace a pagecache page with a new one : page to be replaced : page to replace with : allocation mode
This function replaces a page in the pagecache with a new one. On success it acquires the pagecache reference for the new page and drops it for the old page. Both the old and new pages must be locked. This function does not add the new page to the LRU, the caller must do that.
The remove + add is atomic. The only way this function can fail is memory allocation failure.