swapfile.c (915bae9ebe41e52d71ad8b06d50e4ab26189f964) | swapfile.c (3aef83e0ef1ffb8ea3bea97be46821a45c952173) |
---|---|
1/* 2 * linux/mm/swapfile.c 3 * 4 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds 5 * Swap reorganised 29.12.95, Stephen Tweedie 6 */ 7 8#include <linux/mm.h> --- 931 unchanged lines hidden (view full) --- 940 if (lh == &sis->extent_list) 941 lh = lh->next; 942 se = list_entry(lh, struct swap_extent, list); 943 sis->curr_swap_extent = se; 944 BUG_ON(se == start_se); /* It *must* be present */ 945 } 946} 947 | 1/* 2 * linux/mm/swapfile.c 3 * 4 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds 5 * Swap reorganised 29.12.95, Stephen Tweedie 6 */ 7 8#include <linux/mm.h> --- 931 unchanged lines hidden (view full) --- 940 if (lh == &sis->extent_list) 941 lh = lh->next; 942 se = list_entry(lh, struct swap_extent, list); 943 sis->curr_swap_extent = se; 944 BUG_ON(se == start_se); /* It *must* be present */ 945 } 946} 947 |
948#ifdef CONFIG_SOFTWARE_SUSPEND |
|
948/* | 949/* |
950 * Get the (PAGE_SIZE) block corresponding to given offset on the swapdev 951 * corresponding to given index in swap_info (swap type). 952 */ 953sector_t swapdev_block(int swap_type, pgoff_t offset) 954{ 955 struct swap_info_struct *sis; 956 957 if (swap_type >= nr_swapfiles) 958 return 0; 959 960 sis = swap_info + swap_type; 961 return (sis->flags & SWP_WRITEOK) ? map_swap_page(sis, offset) : 0; 962} 963#endif /* CONFIG_SOFTWARE_SUSPEND */ 964 965/* |
|
949 * Free all of a swapdev's extent information 950 */ 951static void destroy_swap_extents(struct swap_info_struct *sis) 952{ 953 while (!list_empty(&sis->extent_list)) { 954 struct swap_extent *se; 955 956 se = list_entry(sis->extent_list.next, --- 822 unchanged lines hidden --- | 966 * Free all of a swapdev's extent information 967 */ 968static void destroy_swap_extents(struct swap_info_struct *sis) 969{ 970 while (!list_empty(&sis->extent_list)) { 971 struct swap_extent *se; 972 973 se = list_entry(sis->extent_list.next, --- 822 unchanged lines hidden --- |