diff options
Diffstat (limited to 'include/linux/swap.h')
-rw-r--r-- | include/linux/swap.h | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h index bfe3e763ccf2..3c9ff0048153 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -107,6 +107,8 @@ enum { | |||
107 | SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ | 107 | SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ |
108 | SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ | 108 | SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ |
109 | SWP_ACTIVE = (SWP_USED | SWP_WRITEOK), | 109 | SWP_ACTIVE = (SWP_USED | SWP_WRITEOK), |
110 | /* add others here before... */ | ||
111 | SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ | ||
110 | }; | 112 | }; |
111 | 113 | ||
112 | #define SWAP_CLUSTER_MAX 32 | 114 | #define SWAP_CLUSTER_MAX 32 |
@@ -116,16 +118,13 @@ enum { | |||
116 | 118 | ||
117 | /* | 119 | /* |
118 | * The in-memory structure used to track swap areas. | 120 | * The in-memory structure used to track swap areas. |
119 | * extent_list.prev points at the lowest-index extent. That list is | ||
120 | * sorted. | ||
121 | */ | 121 | */ |
122 | struct swap_info_struct { | 122 | struct swap_info_struct { |
123 | unsigned int flags; | 123 | unsigned int flags; |
124 | spinlock_t sdev_lock; | 124 | int prio; /* swap priority */ |
125 | struct file *swap_file; | 125 | struct file *swap_file; |
126 | struct block_device *bdev; | 126 | struct block_device *bdev; |
127 | struct list_head extent_list; | 127 | struct list_head extent_list; |
128 | int nr_extents; | ||
129 | struct swap_extent *curr_swap_extent; | 128 | struct swap_extent *curr_swap_extent; |
130 | unsigned old_block_size; | 129 | unsigned old_block_size; |
131 | unsigned short * swap_map; | 130 | unsigned short * swap_map; |
@@ -133,10 +132,9 @@ struct swap_info_struct { | |||
133 | unsigned int highest_bit; | 132 | unsigned int highest_bit; |
134 | unsigned int cluster_next; | 133 | unsigned int cluster_next; |
135 | unsigned int cluster_nr; | 134 | unsigned int cluster_nr; |
136 | int prio; /* swap priority */ | 135 | unsigned int pages; |
137 | int pages; | 136 | unsigned int max; |
138 | unsigned long max; | 137 | unsigned int inuse_pages; |
139 | unsigned long inuse_pages; | ||
140 | int next; /* next entry on swap list */ | 138 | int next; /* next entry on swap list */ |
141 | }; | 139 | }; |
142 | 140 | ||
@@ -222,13 +220,7 @@ extern int can_share_swap_page(struct page *); | |||
222 | extern int remove_exclusive_swap_page(struct page *); | 220 | extern int remove_exclusive_swap_page(struct page *); |
223 | struct backing_dev_info; | 221 | struct backing_dev_info; |
224 | 222 | ||
225 | extern struct swap_list_t swap_list; | 223 | extern spinlock_t swap_lock; |
226 | extern spinlock_t swaplock; | ||
227 | |||
228 | #define swap_list_lock() spin_lock(&swaplock) | ||
229 | #define swap_list_unlock() spin_unlock(&swaplock) | ||
230 | #define swap_device_lock(p) spin_lock(&p->sdev_lock) | ||
231 | #define swap_device_unlock(p) spin_unlock(&p->sdev_lock) | ||
232 | 224 | ||
233 | /* linux/mm/thrash.c */ | 225 | /* linux/mm/thrash.c */ |
234 | extern struct mm_struct * swap_token_mm; | 226 | extern struct mm_struct * swap_token_mm; |