Suspend 2 merge: 29/51: Clear swapfile bdev in swapoff.

Nigel Cunningham
2004-11-24T15:29:56Z

Suspend uses the bdev field as its means of telling which swap devices
are in use. (This info needs to be used at resume time without actually
doing the swapon[s] again). In order to avoid an oops in the suspend
code if the user turns off a swap device, this small addition is
necessary. (If you want the long explanation, feel free to ask!)

diff -ruN 816-clear-swapfile-bdev-in-swapoff-old/mm/swapfile.c 816-clear-swapfile-bdev-in-swapoff-new/mm/swapfile.c
--- 816-clear-swapfile-bdev-in-swapoff-old/mm/swapfile.c 2004-11-06 09:26:59.372699648 +1100
+++ 816-clear-swapfile-bdev-in-swapoff-new/mm/swapfile.c 2004-11-04 16:27:41.000000000 +1100
@@ -1179,6 +1179,7 @@
swap_file = p->swap_file;
p->swap_file = NULL;
p->max = 0;
+ p->bdev = NULL;
swap_map = p->swap_map;
p->swap_map = NULL;
p->flags = 0;