275 int count = p->swap_map[offset];
276
277 if (count < SWAP_MAP_MAX) {
278 count--;
279 p->swap_map[offset] = count;
280 if (!count) {
281 if (offset < p->lowest_bit)
282 p->lowest_bit = offset;
283 if (offset > p->highest_bit)
284 p->highest_bit = offset;
285 if (p->prio > swap_info[swap_list.next].prio)
286 swap_list.next = p - swap_info;
287 nr_swap_pages++;
288 p->inuse_pages--;
289 }
290 }
291 return count;
292}
293
294
295
296
297
298void swap_free(swp_entry_t entry)
299{
300 struct swap_info_struct * p;
301
302 p = swap_info_get(entry);
303 if (p) {
304 swap_entry_free(p, swp_offset(entry));
305 spin_unlock(&swap_lock);
306 }
307}
308
309
310
311
312static inline int page_swapcount(struct page *page)
313{
314 int count = 0;
315 struct swap_info_struct *p;