shmem.c (e12ba74d8ff3e2f73a583500d7095e406df4d093) shmem.c (d8dc74f212c38407fc9f4367181f8f969b719485)
1/*
2 * Resizable virtual memory filesystem for Linux.
3 *
4 * Copyright (C) 2000 Linus Torvalds.
5 * 2000 Transmeta Corp.
6 * 2000-2001 Christoph Rohland
7 * 2000-2001 SAP AG
8 * 2002 Red Hat Inc.

--- 1012 unchanged lines hidden (view full) ---

1021 pvma.vm_end = PAGE_SIZE;
1022 pvma.vm_pgoff = idx;
1023 pvma.vm_policy = mpol_shared_policy_lookup(p, idx);
1024 page = read_swap_cache_async(entry, &pvma, 0);
1025 mpol_free(pvma.vm_policy);
1026 return page;
1027}
1028
1/*
2 * Resizable virtual memory filesystem for Linux.
3 *
4 * Copyright (C) 2000 Linus Torvalds.
5 * 2000 Transmeta Corp.
6 * 2000-2001 Christoph Rohland
7 * 2000-2001 SAP AG
8 * 2002 Red Hat Inc.

--- 1012 unchanged lines hidden (view full) ---

1021 pvma.vm_end = PAGE_SIZE;
1022 pvma.vm_pgoff = idx;
1023 pvma.vm_policy = mpol_shared_policy_lookup(p, idx);
1024 page = read_swap_cache_async(entry, &pvma, 0);
1025 mpol_free(pvma.vm_policy);
1026 return page;
1027}
1028
1029struct page *shmem_swapin(struct shmem_inode_info *info, swp_entry_t entry,
1030 unsigned long idx)
1029static struct page *shmem_swapin(struct shmem_inode_info *info,
1030 swp_entry_t entry, unsigned long idx)
1031{
1032 struct shared_policy *p = &info->policy;
1033 int i, num;
1034 struct page *page;
1035 unsigned long offset;
1036
1037 num = valid_swaphandles(entry, &offset);
1038 for (i = 0; i < num; offset++, i++) {

--- 285 unchanged lines hidden (view full) ---

1324 if (error)
1325 return ((error == -ENOMEM) ? VM_FAULT_OOM : VM_FAULT_SIGBUS);
1326
1327 mark_page_accessed(vmf->page);
1328 return ret | VM_FAULT_LOCKED;
1329}
1330
1331#ifdef CONFIG_NUMA
1031{
1032 struct shared_policy *p = &info->policy;
1033 int i, num;
1034 struct page *page;
1035 unsigned long offset;
1036
1037 num = valid_swaphandles(entry, &offset);
1038 for (i = 0; i < num; offset++, i++) {

--- 285 unchanged lines hidden (view full) ---

1324 if (error)
1325 return ((error == -ENOMEM) ? VM_FAULT_OOM : VM_FAULT_SIGBUS);
1326
1327 mark_page_accessed(vmf->page);
1328 return ret | VM_FAULT_LOCKED;
1329}
1330
1331#ifdef CONFIG_NUMA
1332int shmem_set_policy(struct vm_area_struct *vma, struct mempolicy *new)
1332static int shmem_set_policy(struct vm_area_struct *vma, struct mempolicy *new)
1333{
1334 struct inode *i = vma->vm_file->f_path.dentry->d_inode;
1335 return mpol_set_shared_policy(&SHMEM_I(i)->policy, vma, new);
1336}
1337
1333{
1334 struct inode *i = vma->vm_file->f_path.dentry->d_inode;
1335 return mpol_set_shared_policy(&SHMEM_I(i)->policy, vma, new);
1336}
1337
1338struct mempolicy *
1339shmem_get_policy(struct vm_area_struct *vma, unsigned long addr)
1338static struct mempolicy *shmem_get_policy(struct vm_area_struct *vma,
1339 unsigned long addr)
1340{
1341 struct inode *i = vma->vm_file->f_path.dentry->d_inode;
1342 unsigned long idx;
1343
1344 idx = ((addr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
1345 return mpol_shared_policy_lookup(&SHMEM_I(i)->policy, idx);
1346}
1347#endif

--- 1231 unchanged lines hidden ---
1340{
1341 struct inode *i = vma->vm_file->f_path.dentry->d_inode;
1342 unsigned long idx;
1343
1344 idx = ((addr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
1345 return mpol_shared_policy_lookup(&SHMEM_I(i)->policy, idx);
1346}
1347#endif

--- 1231 unchanged lines hidden ---