shmem.c (823c9faefc5534273aceaca12d845dbc11782a6d) shmem.c (18a2f371f5edf41810f6469cb9be39931ef9deb9)
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.

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

905 }
906 return mpol;
907}
908#endif /* CONFIG_TMPFS */
909
910static struct page *shmem_swapin(swp_entry_t swap, gfp_t gfp,
911 struct shmem_inode_info *info, pgoff_t index)
912{
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.

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

905 }
906 return mpol;
907}
908#endif /* CONFIG_TMPFS */
909
910static struct page *shmem_swapin(swp_entry_t swap, gfp_t gfp,
911 struct shmem_inode_info *info, pgoff_t index)
912{
913 struct mempolicy mpol, *spol;
914 struct vm_area_struct pvma;
913 struct vm_area_struct pvma;
914 struct page *page;
915
915
916 spol = mpol_cond_copy(&mpol,
917 mpol_shared_policy_lookup(&info->policy, index));
918
919 /* Create a pseudo vma that just contains the policy */
920 pvma.vm_start = 0;
921 /* Bias interleave by inode number to distribute better across nodes */
922 pvma.vm_pgoff = index + info->vfs_inode.i_ino;
923 pvma.vm_ops = NULL;
916 /* Create a pseudo vma that just contains the policy */
917 pvma.vm_start = 0;
918 /* Bias interleave by inode number to distribute better across nodes */
919 pvma.vm_pgoff = index + info->vfs_inode.i_ino;
920 pvma.vm_ops = NULL;
924 pvma.vm_policy = spol;
925 return swapin_readahead(swap, gfp, &pvma, 0);
921 pvma.vm_policy = mpol_shared_policy_lookup(&info->policy, index);
922
923 page = swapin_readahead(swap, gfp, &pvma, 0);
924
925 /* Drop reference taken by mpol_shared_policy_lookup() */
926 mpol_cond_put(pvma.vm_policy);
927
928 return page;
926}
927
928static struct page *shmem_alloc_page(gfp_t gfp,
929 struct shmem_inode_info *info, pgoff_t index)
930{
931 struct vm_area_struct pvma;
929}
930
931static struct page *shmem_alloc_page(gfp_t gfp,
932 struct shmem_inode_info *info, pgoff_t index)
933{
934 struct vm_area_struct pvma;
935 struct page *page;
932
933 /* Create a pseudo vma that just contains the policy */
934 pvma.vm_start = 0;
935 /* Bias interleave by inode number to distribute better across nodes */
936 pvma.vm_pgoff = index + info->vfs_inode.i_ino;
937 pvma.vm_ops = NULL;
938 pvma.vm_policy = mpol_shared_policy_lookup(&info->policy, index);
939
936
937 /* Create a pseudo vma that just contains the policy */
938 pvma.vm_start = 0;
939 /* Bias interleave by inode number to distribute better across nodes */
940 pvma.vm_pgoff = index + info->vfs_inode.i_ino;
941 pvma.vm_ops = NULL;
942 pvma.vm_policy = mpol_shared_policy_lookup(&info->policy, index);
943
940 /*
941 * alloc_page_vma() will drop the shared policy reference
942 */
943 return alloc_page_vma(gfp, &pvma, 0);
944 page = alloc_page_vma(gfp, &pvma, 0);
945
946 /* Drop reference taken by mpol_shared_policy_lookup() */
947 mpol_cond_put(pvma.vm_policy);
948
949 return page;
944}
945#else /* !CONFIG_NUMA */
946#ifdef CONFIG_TMPFS
947static inline void shmem_show_mpol(struct seq_file *seq, struct mempolicy *mpol)
948{
949}
950#endif /* CONFIG_TMPFS */
951

--- 1942 unchanged lines hidden ---
950}
951#else /* !CONFIG_NUMA */
952#ifdef CONFIG_TMPFS
953static inline void shmem_show_mpol(struct seq_file *seq, struct mempolicy *mpol)
954{
955}
956#endif /* CONFIG_TMPFS */
957

--- 1942 unchanged lines hidden ---