shmem.c (62f945b6a7b8cda6d1f35941eb374276f7b8749a) shmem.c (a12831bf4293d38518e41b80dd897af0122bb268)
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.

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

344 * that an entry was not already brought back from swap by a racing thread.
345 *
346 * Checking page is not enough: by the time a SwapCache page is locked, it
347 * might be reused, and again be SwapCache, using the same swap as before.
348 */
349static bool shmem_confirm_swap(struct address_space *mapping,
350 pgoff_t index, swp_entry_t swap)
351{
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.

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

344 * that an entry was not already brought back from swap by a racing thread.
345 *
346 * Checking page is not enough: by the time a SwapCache page is locked, it
347 * might be reused, and again be SwapCache, using the same swap as before.
348 */
349static bool shmem_confirm_swap(struct address_space *mapping,
350 pgoff_t index, swp_entry_t swap)
351{
352 void *item;
353
354 rcu_read_lock();
355 item = radix_tree_lookup(&mapping->i_pages, index);
356 rcu_read_unlock();
357 return item == swp_to_radix_entry(swap);
352 return xa_load(&mapping->i_pages, index) == swp_to_radix_entry(swap);
358}
359
360/*
361 * Definitions for "huge tmpfs": tmpfs mounted with the huge= option
362 *
363 * SHMEM_HUGE_NEVER:
364 * disables huge pages for the mount;
365 * SHMEM_HUGE_ALWAYS:

--- 3677 unchanged lines hidden ---
353}
354
355/*
356 * Definitions for "huge tmpfs": tmpfs mounted with the huge= option
357 *
358 * SHMEM_HUGE_NEVER:
359 * disables huge pages for the mount;
360 * SHMEM_HUGE_ALWAYS:

--- 3677 unchanged lines hidden ---