diff options
-rw-r--r-- | kernel/power/swsusp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index f2bc71b9fe8b..975b1648a806 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c | |||
@@ -179,9 +179,9 @@ static int swsusp_swap_check(void) /* This is called before saving image */ | |||
179 | len=strlen(resume_file); | 179 | len=strlen(resume_file); |
180 | root_swap = 0xFFFF; | 180 | root_swap = 0xFFFF; |
181 | 181 | ||
182 | swap_list_lock(); | 182 | spin_lock(&swap_lock); |
183 | for (i=0; i<MAX_SWAPFILES; i++) { | 183 | for (i=0; i<MAX_SWAPFILES; i++) { |
184 | if (swap_info[i].flags == 0) { | 184 | if (!(swap_info[i].flags & SWP_WRITEOK)) { |
185 | swapfile_used[i]=SWAPFILE_UNUSED; | 185 | swapfile_used[i]=SWAPFILE_UNUSED; |
186 | } else { | 186 | } else { |
187 | if (!len) { | 187 | if (!len) { |
@@ -202,7 +202,7 @@ static int swsusp_swap_check(void) /* This is called before saving image */ | |||
202 | } | 202 | } |
203 | } | 203 | } |
204 | } | 204 | } |
205 | swap_list_unlock(); | 205 | spin_unlock(&swap_lock); |
206 | return (root_swap != 0xffff) ? 0 : -ENODEV; | 206 | return (root_swap != 0xffff) ? 0 : -ENODEV; |
207 | } | 207 | } |
208 | 208 | ||
@@ -216,12 +216,12 @@ static void lock_swapdevices(void) | |||
216 | { | 216 | { |
217 | int i; | 217 | int i; |
218 | 218 | ||
219 | swap_list_lock(); | 219 | spin_lock(&swap_lock); |
220 | for (i = 0; i< MAX_SWAPFILES; i++) | 220 | for (i = 0; i< MAX_SWAPFILES; i++) |
221 | if (swapfile_used[i] == SWAPFILE_IGNORED) { | 221 | if (swapfile_used[i] == SWAPFILE_IGNORED) { |
222 | swap_info[i].flags ^= 0xFF; | 222 | swap_info[i].flags ^= SWP_WRITEOK; |
223 | } | 223 | } |
224 | swap_list_unlock(); | 224 | spin_unlock(&swap_lock); |
225 | } | 225 | } |
226 | 226 | ||
227 | /** | 227 | /** |