Commit 097137c5 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] swapoff accounting cleanup

From Hugh.  Remove some strangeness in the swapoff path.

"it dates from the days when that block set *swap_map to 0, but in
 2.4.13 I changed it to set *swap_map to 1 and delete_from_swap_cache
 afterwards: it's been wrong ever since, hasn't it?  swap_list_locking
 can go, it was there to guard nr_swap_pages for si_swapinfo; the
 swap_device_locking has to stay because swap_map is an array of
 unsigned _shorts_."
parent fbe7559b
......@@ -670,12 +670,9 @@ static int try_to_unuse(unsigned int type)
* report them; but do report if we reset SWAP_MAP_MAX.
*/
if (*swap_map == SWAP_MAP_MAX) {
swap_list_lock();
swap_device_lock(si);
nr_swap_pages++;
*swap_map = 1;
swap_device_unlock(si);
swap_list_unlock();
reset_overflow = 1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment