Lines Matching defs:type

130 static struct swap_info_struct *swap_type_to_swap_info(int type)
132 if (type >= MAX_SWAPFILES)
135 return READ_ONCE(swap_info[type]); /* rcu_dereference() */
215 swp_entry_t entry = swp_entry(si->type, offset);
1134 zswap_invalidate(swp_entry(si->type, offset + i));
1143 arch_swap_invalidate_page(si->type, offset);
1148 clear_shadow_from_swap_cache(si->type, begin, end);
1201 *entry = swp_entry(si->type, found);
1229 *entry = swp_entry(si->type, offset);
1604 swap_entries_put_map(sis, swp_entry(sis->type, offset), nr);
1856 swp_entry_t get_swap_page_of_type(int type)
1858 struct swap_info_struct *si = swap_type_to_swap_info(type);
1870 entry = swp_entry(si->type, offset);
1881 * Find the swap type that corresponds to given device (if any).
1890 int type;
1896 for (type = 0; type < nr_swapfiles; type++) {
1897 struct swap_info_struct *sis = swap_info[type];
1907 return type;
1917 int type;
1920 for (type = 0; type < nr_swapfiles; type++) {
1921 struct swap_info_struct *sis = swap_info[type];
1927 return type;
1935 * corresponding to given index in swap_info (swap type).
1937 sector_t swapdev_block(int type, pgoff_t offset)
1939 struct swap_info_struct *si = swap_type_to_swap_info(type);
1949 * Return either the total number of swap pages of given type, or the number
1950 * of free pages of that type (depending on @free)
1954 unsigned int count_swap_pages(int type, int free)
1959 if ((unsigned int)type < nr_swapfiles) {
1960 struct swap_info_struct *sis = swap_info[type];
2088 unsigned int type)
2093 si = swap_info[type];
2114 if (swp_type(entry) != type)
2161 unsigned int type)
2171 ret = unuse_pte_range(vma, pmd, addr, next, type);
2180 unsigned int type)
2191 ret = unuse_pmd_range(vma, pud, addr, next, type);
2200 unsigned int type)
2211 ret = unuse_pud_range(vma, p4d, addr, next, type);
2218 static int unuse_vma(struct vm_area_struct *vma, unsigned int type)
2232 ret = unuse_p4d_range(vma, pgd, addr, next, type);
2239 static int unuse_mm(struct mm_struct *mm, unsigned int type)
2248 ret = unuse_vma(vma, type);
2290 static int try_to_unuse(unsigned int type)
2296 struct swap_info_struct *si = swap_info[type];
2305 retval = shmem_unuse(type);
2324 retval = unuse_mm(mm, type);
2346 entry = swp_entry(type, i);
2401 unsigned int type;
2403 for (type = 0; type < nr_swapfiles; type++)
2404 if (swap_usage_in_pages(swap_info[type]))
2747 err = try_to_unuse(p->type);
2795 arch_swap_invalidate_area(p->type);
2796 zswap_swapoff(p->type);
2804 swap_cgroup_swapoff(p->type);
2805 exit_swap_address_space(p->type);
2853 int type;
2861 for (type = 0; (si = swap_type_to_swap_info(type)); type++) {
2874 int type;
2877 type = 0;
2879 type = si->type + 1;
2882 for (; (si = swap_type_to_swap_info(type)); type++) {
2974 unsigned int type;
2988 for (type = 0; type < nr_swapfiles; type++) {
2989 if (!(swap_info[type]->flags & SWP_USED))
2992 if (type >= MAX_SWAPFILES) {
2998 if (type >= nr_swapfiles) {
2999 p->type = type;
3004 smp_store_release(&swap_info[type], p); /* rcu_assign_pointer() */
3008 p = swap_info[type];
3011 * would be relying on p->type to remain valid.
3055 * 1) the number of bits for the swap offset in the swp_entry_t type, and
3060 * swap type 0 and swap offset ~0UL is created, encoded to a swap pte,
3378 error = swap_cgroup_swapon(si->type, maxpages);
3448 error = init_swap_address_space(si->type, maxpages);
3452 error = zswap_swapon(si->type, maxpages);
3488 zswap_swapoff(si->type);
3490 exit_swap_address_space(si->type);
3498 swap_cgroup_swapoff(si->type);
3522 unsigned int type;
3526 for (type = 0; type < nr_swapfiles; type++) {
3527 struct swap_info_struct *si = swap_info[type];