aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/swap.h1
-rw-r--r--mm/swapfile.c4
2 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 3a31cc25bd2c..410c8e473727 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -120,7 +120,6 @@ struct swap_extent {
120enum { 120enum {
121 SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ 121 SWP_USED = (1 << 0), /* is slot in swap_info[] used? */
122 SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ 122 SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */
123 SWP_ACTIVE = (SWP_USED | SWP_WRITEOK),
124 /* add others here before... */ 123 /* add others here before... */
125 SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ 124 SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */
126}; 125};
diff --git a/mm/swapfile.c b/mm/swapfile.c
index e2adc8eb9317..915cb3fc43d7 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1222,7 +1222,7 @@ asmlinkage long sys_swapoff(const char __user * specialfile)
1222 spin_lock(&swap_lock); 1222 spin_lock(&swap_lock);
1223 for (type = swap_list.head; type >= 0; type = swap_info[type].next) { 1223 for (type = swap_list.head; type >= 0; type = swap_info[type].next) {
1224 p = swap_info + type; 1224 p = swap_info + type;
1225 if ((p->flags & SWP_ACTIVE) == SWP_ACTIVE) { 1225 if (p->flags & SWP_WRITEOK) {
1226 if (p->swap_file->f_mapping == mapping) 1226 if (p->swap_file->f_mapping == mapping)
1227 break; 1227 break;
1228 } 1228 }
@@ -1674,7 +1674,7 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
1674 else 1674 else
1675 p->prio = --least_priority; 1675 p->prio = --least_priority;
1676 p->swap_map = swap_map; 1676 p->swap_map = swap_map;
1677 p->flags = SWP_ACTIVE; 1677 p->flags |= SWP_WRITEOK;
1678 nr_swap_pages += nr_good_pages; 1678 nr_swap_pages += nr_good_pages;
1679 total_swap_pages += nr_good_pages; 1679 total_swap_pages += nr_good_pages;
1680 1680