Linux Kernel
3.7.1
|
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/vfs.h>
#include <linux/mount.h>
#include <linux/pagemap.h>
#include <linux/file.h>
#include <linux/mm.h>
#include <linux/export.h>
#include <linux/swap.h>
#include <linux/ramfs.h>
Go to the source code of this file.
Macros | |
#define | shmem_vm_ops generic_file_vm_ops |
#define | shmem_file_operations ramfs_file_operations |
#define | shmem_get_inode(sb, dir, mode, dev, flags) ramfs_get_inode(sb, dir, mode, dev) |
#define | shmem_acct_size(flags, size) 0 |
#define | shmem_unacct_size(flags, size) do {} while (0) |
Functions | |
int __init | shmem_init (void) |
int | shmem_unuse (swp_entry_t swap, struct page *page) |
int | shmem_lock (struct file *file, int lock, struct user_struct *user) |
void | shmem_unlock_mapping (struct address_space *mapping) |
void | shmem_truncate_range (struct inode *inode, loff_t lstart, loff_t lend) |
EXPORT_SYMBOL_GPL (shmem_truncate_range) | |
: name for dentry (to be seen in /proc/<pid>/maps | |
struct file * | shmem_file_setup (const char *name, loff_t size, unsigned long flags) |
EXPORT_SYMBOL_GPL (shmem_file_setup) | |
int | shmem_zero_setup (struct vm_area_struct *vma) |
struct page * | shmem_read_mapping_page_gfp (struct address_space *mapping, pgoff_t index, gfp_t gfp) |
EXPORT_SYMBOL_GPL (shmem_read_mapping_page_gfp) | |
#define shmem_file_operations ramfs_file_operations |
#define shmem_vm_ops generic_file_vm_ops |
EXPORT_SYMBOL_GPL | ( | shmem_truncate_range | ) |
EXPORT_SYMBOL_GPL | ( | shmem_file_setup | ) |
EXPORT_SYMBOL_GPL | ( | shmem_read_mapping_page_gfp | ) |
|
read |
shmem_read_mapping_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 behaves as a tmpfs "read_cache_page_gfp(mapping, index, gfp)", with any new page allocations done using the specified allocation flags. But read_cache_page_gfp() uses the ->readpage() method: which does not suit tmpfs, since it may have pages in swapcache, and needs to find those for itself; although drivers/gpu/drm i915 and ttm rely upon this support.
i915_gem_object_get_pages_gtt() mixes __GFP_NORETRY | __GFP_NOWARN in with the mapping_gfp_mask(), to avoid OOMing the machine unnecessarily.
void shmem_unlock_mapping | ( | struct address_space * | mapping | ) |