From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pb0-f47.google.com (mail-pb0-f47.google.com [209.85.160.47]) by kanga.kvack.org (Postfix) with ESMTP id 6D6636B0055 for ; Fri, 11 Apr 2014 16:15:57 -0400 (EDT) Received: by mail-pb0-f47.google.com with SMTP id up15so5846632pbc.34 for ; Fri, 11 Apr 2014 13:15:55 -0700 (PDT) Received: from mail-pb0-f41.google.com (mail-pb0-f41.google.com [209.85.160.41]) by mx.google.com with ESMTPS id yd10si4843806pab.248.2014.04.11.13.15.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Apr 2014 13:15:55 -0700 (PDT) Received: by mail-pb0-f41.google.com with SMTP id jt11so5880494pbb.0 for ; Fri, 11 Apr 2014 13:15:54 -0700 (PDT) From: John Stultz Subject: [PATCH 1/4] swap: Cleanup how special swap file numbers are defined Date: Fri, 11 Apr 2014 13:15:37 -0700 Message-Id: <1397247340-3365-2-git-send-email-john.stultz@linaro.org> In-Reply-To: <1397247340-3365-1-git-send-email-john.stultz@linaro.org> References: <1397247340-3365-1-git-send-email-john.stultz@linaro.org> Sender: owner-linux-mm@kvack.org List-ID: To: LKML Cc: John Stultz , Andrew Morton , Android Kernel Team , Johannes Weiner , Robert Love , Mel Gorman , Hugh Dickins , Dave Hansen , Rik van Riel , Dmitry Adamushko , Neil Brown , Andrea Arcangeli , Mike Hommey , Taras Glek , Jan Kara , KOSAKI Motohiro , Michel Lespinasse , Minchan Kim , Keith Packard , "linux-mm@kvack.org" The SWP_HWPOISON and SWP_MIGRATION numbers are defined in a fairly awkward way. Since they are stolen from the top few values of the 1<). As long as the enum values are added to the top of the enum instead of the bottom, the values for the types will be preserved. Cc: Andrew Morton Cc: Android Kernel Team Cc: Johannes Weiner Cc: Robert Love Cc: Mel Gorman Cc: Hugh Dickins Cc: Dave Hansen Cc: Rik van Riel Cc: Dmitry Adamushko Cc: Neil Brown Cc: Andrea Arcangeli Cc: Mike Hommey Cc: Taras Glek Cc: Jan Kara Cc: KOSAKI Motohiro Cc: Michel Lespinasse Cc: Minchan Kim Cc: Keith Packard Cc: linux-mm@kvack.org Signed-off-by: John Stultz --- include/linux/swap.h | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/include/linux/swap.h b/include/linux/swap.h index 46ba0c6..a90ea95 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -49,29 +49,38 @@ static inline int current_is_kswapd(void) * actions on faults. */ +enum { + /* + * NOTE: We use the high bits here (subtracting from + * 1< email@kvack.org