Lines Matching +full:not +full:- +full:swapped
1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 1994-2006 Linus Torvalds
30 unsigned char *vec = walk->private; in mincore_hugetlb()
34 * swapped out, but theoretically it needs to be checked. in mincore_hugetlb()
36 present = pte && !huge_pte_none_mostly(huge_ptep_get(walk->mm, addr, pte)); in mincore_hugetlb()
39 walk->private = vec; in mincore_hugetlb()
49 * and is up to date; i.e. that no page-in operation would be required
59 * file will not get a swp_entry_t in its pte, but rather it is like in mincore_page()
61 * tmpfs's .fault). So swapped out tmpfs mappings are tested here. in mincore_page()
75 unsigned long nr = (end - addr) >> PAGE_SHIFT; in __mincore_unmapped_range()
78 if (vma->vm_file) { in __mincore_unmapped_range()
83 vec[i] = mincore_page(vma->vm_file->f_mapping, pgoff); in __mincore_unmapped_range()
95 walk->private += __mincore_unmapped_range(addr, end, in mincore_unmapped_range()
96 walk->vma, walk->private); in mincore_unmapped_range()
104 struct vm_area_struct *vma = walk->vma; in mincore_pte_range()
106 unsigned char *vec = walk->private; in mincore_pte_range()
107 int nr = (end - addr) >> PAGE_SHIFT; in mincore_pte_range()
116 ptep = pte_offset_map_lock(walk->mm, pmd, addr, &ptl); in mincore_pte_range()
118 walk->action = ACTION_AGAIN; in mincore_pte_range()
151 pte_unmap_unlock(ptep - 1, ptl); in mincore_pte_range()
153 walk->private += nr; in mincore_pte_range()
162 if (!vma->vm_file) in can_do_mincore()
165 * Reveal pagecache information only for non-anonymous mappings that in can_do_mincore()
167 * for writing; otherwise we'd be including shared non-exclusive in can_do_mincore()
171 file_inode(vma->vm_file)) || in can_do_mincore()
172 file_permission(vma->vm_file, MAY_WRITE) == 0; in can_do_mincore()
193 vma = vma_lookup(current->mm, addr); in do_mincore()
195 return -ENOMEM; in do_mincore()
196 end = min(vma->vm_end, addr + (pages << PAGE_SHIFT)); in do_mincore()
198 unsigned long pages = DIV_ROUND_UP(end - addr, PAGE_SIZE); in do_mincore()
202 err = walk_page_range(vma->vm_mm, addr, end, &mincore_walk_ops, vec); in do_mincore()
205 return (end - addr) >> PAGE_SHIFT; in do_mincore()
223 * zero - success
224 * -EFAULT - vec points to an illegal address
225 * -EINVAL - addr is not a multiple of PAGE_SIZE
226 * -ENOMEM - Addresses in the range [addr, addr + len] are
228 * specify one or more pages which are not currently
230 * -EAGAIN - A kernel resource was temporarily unavailable.
241 /* Check the start address: needs to be page-aligned.. */ in SYSCALL_DEFINE3()
243 return -EINVAL; in SYSCALL_DEFINE3()
245 /* ..and we need to be passed a valid user-space range */ in SYSCALL_DEFINE3()
247 return -ENOMEM; in SYSCALL_DEFINE3()
254 return -EFAULT; in SYSCALL_DEFINE3()
258 return -EAGAIN; in SYSCALL_DEFINE3()
266 mmap_read_lock(current->mm); in SYSCALL_DEFINE3()
268 mmap_read_unlock(current->mm); in SYSCALL_DEFINE3()
273 retval = -EFAULT; in SYSCALL_DEFINE3()
276 pages -= retval; in SYSCALL_DEFINE3()