mm: Use static initialisers for immutable fields of 'struct vm_fault'
In preparation for const-ifying the anonymous struct field of 'struct vm_fault', ensure that it is initialised using designated initialisers. Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
parent
2b635dd372
commit
8c63ca5bc3
@ -1520,11 +1520,11 @@ static struct page *shmem_swapin(swp_entry_t swap, gfp_t gfp,
|
|||||||
{
|
{
|
||||||
struct vm_area_struct pvma;
|
struct vm_area_struct pvma;
|
||||||
struct page *page;
|
struct page *page;
|
||||||
struct vm_fault vmf;
|
struct vm_fault vmf = {
|
||||||
|
.vma = &pvma,
|
||||||
|
};
|
||||||
|
|
||||||
shmem_pseudo_vma_init(&pvma, info, index);
|
shmem_pseudo_vma_init(&pvma, info, index);
|
||||||
vmf.vma = &pvma;
|
|
||||||
vmf.address = 0;
|
|
||||||
page = swap_cluster_readahead(swap, gfp, &vmf);
|
page = swap_cluster_readahead(swap, gfp, &vmf);
|
||||||
shmem_pseudo_vma_destroy(&pvma);
|
shmem_pseudo_vma_destroy(&pvma);
|
||||||
|
|
||||||
|
@ -1951,8 +1951,6 @@ static int unuse_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
|
|||||||
si = swap_info[type];
|
si = swap_info[type];
|
||||||
pte = pte_offset_map(pmd, addr);
|
pte = pte_offset_map(pmd, addr);
|
||||||
do {
|
do {
|
||||||
struct vm_fault vmf;
|
|
||||||
|
|
||||||
if (!is_swap_pte(*pte))
|
if (!is_swap_pte(*pte))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -1968,9 +1966,12 @@ static int unuse_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
|
|||||||
swap_map = &si->swap_map[offset];
|
swap_map = &si->swap_map[offset];
|
||||||
page = lookup_swap_cache(entry, vma, addr);
|
page = lookup_swap_cache(entry, vma, addr);
|
||||||
if (!page) {
|
if (!page) {
|
||||||
vmf.vma = vma;
|
struct vm_fault vmf = {
|
||||||
vmf.address = addr;
|
.vma = vma,
|
||||||
vmf.pmd = pmd;
|
.address = addr,
|
||||||
|
.pmd = pmd,
|
||||||
|
};
|
||||||
|
|
||||||
page = swapin_readahead(entry, GFP_HIGHUSER_MOVABLE,
|
page = swapin_readahead(entry, GFP_HIGHUSER_MOVABLE,
|
||||||
&vmf);
|
&vmf);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user