swap_state.c (46a774d3eae523fd9a1907ba90e9a116cd1c5ddc) swap_state.c (3ecdeb0f876e91c4a7129ba2ba5baa530aa6c4f9)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/mm/swap_state.c
4 *
5 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
6 * Swap reorganised 29.12.95, Stephen Tweedie
7 *
8 * Rewritten to use page cache, (C) 1998 Stephen Tweedie

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

442 /*
443 * Just skip read ahead for unused swap slot.
444 * During swap_off when swap_slot_cache is disabled,
445 * we have to handle the race between putting
446 * swap entry in swap cache and marking swap slot
447 * as SWAP_HAS_CACHE. That's done in later part of code or
448 * else swap_off will be aborted if we return NULL.
449 */
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/mm/swap_state.c
4 *
5 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
6 * Swap reorganised 29.12.95, Stephen Tweedie
7 *
8 * Rewritten to use page cache, (C) 1998 Stephen Tweedie

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

442 /*
443 * Just skip read ahead for unused swap slot.
444 * During swap_off when swap_slot_cache is disabled,
445 * we have to handle the race between putting
446 * swap entry in swap cache and marking swap slot
447 * as SWAP_HAS_CACHE. That's done in later part of code or
448 * else swap_off will be aborted if we return NULL.
449 */
450 if (!__swp_swapcount(entry) && swap_slot_cache_enabled)
450 if (!swap_swapcount(si, entry) && swap_slot_cache_enabled)
451 goto fail_put_swap;
452
453 /*
454 * Get a new page to read into from swap. Allocate it now,
455 * before marking swap_map SWAP_HAS_CACHE, when -EEXIST will
456 * cause any racers to loop around until we add it to cache.
457 */
458 folio = vma_alloc_folio(gfp_mask, 0, vma, addr, false);

--- 456 unchanged lines hidden ---
451 goto fail_put_swap;
452
453 /*
454 * Get a new page to read into from swap. Allocate it now,
455 * before marking swap_map SWAP_HAS_CACHE, when -EEXIST will
456 * cause any racers to loop around until we add it to cache.
457 */
458 folio = vma_alloc_folio(gfp_mask, 0, vma, addr, false);

--- 456 unchanged lines hidden ---