Commit 22c6f8fd authored by Hugh Dickins's avatar Hugh Dickins Committed by Linus Torvalds

swapfile: remove SWP_ACTIVE mask

Remove the SWP_ACTIVE mask: it just obscures the SWP_WRITEOK flag.
Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 73fd8748
...@@ -120,7 +120,6 @@ struct swap_extent { ...@@ -120,7 +120,6 @@ struct swap_extent {
enum { enum {
SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ SWP_USED = (1 << 0), /* is slot in swap_info[] used? */
SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */
SWP_ACTIVE = (SWP_USED | SWP_WRITEOK),
/* add others here before... */ /* add others here before... */
SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */
}; };
......
...@@ -1222,7 +1222,7 @@ asmlinkage long sys_swapoff(const char __user * specialfile) ...@@ -1222,7 +1222,7 @@ asmlinkage long sys_swapoff(const char __user * specialfile)
spin_lock(&swap_lock); spin_lock(&swap_lock);
for (type = swap_list.head; type >= 0; type = swap_info[type].next) { for (type = swap_list.head; type >= 0; type = swap_info[type].next) {
p = swap_info + type; p = swap_info + type;
if ((p->flags & SWP_ACTIVE) == SWP_ACTIVE) { if (p->flags & SWP_WRITEOK) {
if (p->swap_file->f_mapping == mapping) if (p->swap_file->f_mapping == mapping)
break; break;
} }
...@@ -1674,7 +1674,7 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags) ...@@ -1674,7 +1674,7 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
else else
p->prio = --least_priority; p->prio = --least_priority;
p->swap_map = swap_map; p->swap_map = swap_map;
p->flags = SWP_ACTIVE; p->flags |= SWP_WRITEOK;
nr_swap_pages += nr_good_pages; nr_swap_pages += nr_good_pages;
total_swap_pages += nr_good_pages; total_swap_pages += nr_good_pages;
......
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