swapfile.c (be45a4902c7caa717fee6b2f671e59b396ed395c) swapfile.c (5154e607967d3f587fda84a40abbf900275016c9)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/mm/swapfile.c
4 *
5 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
6 * Swap reorganised 29.12.95, Stephen Tweedie
7 */
8

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

59 * memory pressure (via the shrinker). Before doing so, they may wish to
60 * check to see if any swap space is available.
61 */
62EXPORT_SYMBOL_GPL(nr_swap_pages);
63/* protected with swap_lock. reading in vm_swap_full() doesn't need lock */
64long total_swap_pages;
65static int least_priority = -1;
66unsigned long swapfile_maximum_size;
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/mm/swapfile.c
4 *
5 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
6 * Swap reorganised 29.12.95, Stephen Tweedie
7 */
8

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

59 * memory pressure (via the shrinker). Before doing so, they may wish to
60 * check to see if any swap space is available.
61 */
62EXPORT_SYMBOL_GPL(nr_swap_pages);
63/* protected with swap_lock. reading in vm_swap_full() doesn't need lock */
64long total_swap_pages;
65static int least_priority = -1;
66unsigned long swapfile_maximum_size;
67#ifdef CONFIG_MIGRATION
68bool swap_migration_ad_supported;
69#endif /* CONFIG_MIGRATION */
67
68static const char Bad_file[] = "Bad swap file entry ";
69static const char Unused_file[] = "Unused swap file entry ";
70static const char Bad_offset[] = "Bad swap offset entry ";
71static const char Unused_offset[] = "Unused swap offset entry ";
72
73/*
74 * all active swap_info_structs

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

3675 return -ENOMEM;
3676 }
3677
3678 for_each_node(nid)
3679 plist_head_init(&swap_avail_heads[nid]);
3680
3681 swapfile_maximum_size = arch_max_swapfile_size();
3682
70
71static const char Bad_file[] = "Bad swap file entry ";
72static const char Unused_file[] = "Unused swap file entry ";
73static const char Bad_offset[] = "Bad swap offset entry ";
74static const char Unused_offset[] = "Unused swap offset entry ";
75
76/*
77 * all active swap_info_structs

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

3678 return -ENOMEM;
3679 }
3680
3681 for_each_node(nid)
3682 plist_head_init(&swap_avail_heads[nid]);
3683
3684 swapfile_maximum_size = arch_max_swapfile_size();
3685
3686#ifdef CONFIG_MIGRATION
3687 if (swapfile_maximum_size >= (1UL << SWP_MIG_TOTAL_BITS))
3688 swap_migration_ad_supported = true;
3689#endif /* CONFIG_MIGRATION */
3690
3683 return 0;
3684}
3685subsys_initcall(swapfile_init);
3691 return 0;
3692}
3693subsys_initcall(swapfile_init);