swapfile: remove SWP_ACTIVE mask
authorHugh Dickins <hugh@veritas.com>
Tue, 6 Jan 2009 22:39:48 +0000 (14:39 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 6 Jan 2009 23:59:05 +0000 (15:59 -0800)
Remove the SWP_ACTIVE mask: it just obscures the SWP_WRITEOK flag.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/swap.h
mm/swapfile.c

index 3a31cc25bd2c696b8b8b0ba84cd77c6352438597..410c8e473727092258e52e4582ea8ba1bda06634 100644 (file)
@@ -120,7 +120,6 @@ struct swap_extent {
 enum {
        SWP_USED        = (1 << 0),     /* is slot in swap_info[] used? */
        SWP_WRITEOK     = (1 << 1),     /* ok to write to this swap?    */
-       SWP_ACTIVE      = (SWP_USED | SWP_WRITEOK),
                                        /* add others here before... */
        SWP_SCANNING    = (1 << 8),     /* refcount in scan_swap_map */
 };
index e2adc8eb9317b4490de8f6ff55cc6888b985ab01..915cb3fc43d7287b738d6c1ba7b5e793402ba60a 100644 (file)
@@ -1222,7 +1222,7 @@ asmlinkage long sys_swapoff(const char __user * specialfile)
        spin_lock(&swap_lock);
        for (type = swap_list.head; type >= 0; type = swap_info[type].next) {
                p = swap_info + type;
-               if ((p->flags & SWP_ACTIVE) == SWP_ACTIVE) {
+               if (p->flags & SWP_WRITEOK) {
                        if (p->swap_file->f_mapping == mapping)
                                break;
                }
@@ -1674,7 +1674,7 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
        else
                p->prio = --least_priority;
        p->swap_map = swap_map;
-       p->flags = SWP_ACTIVE;
+       p->flags |= SWP_WRITEOK;
        nr_swap_pages += nr_good_pages;
        total_swap_pages += nr_good_pages;