Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765798AbYBMBEi (ORCPT ); Tue, 12 Feb 2008 20:04:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753365AbYBMBE0 (ORCPT ); Tue, 12 Feb 2008 20:04:26 -0500 Received: from relay2.sgi.com ([192.48.171.30]:50811 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753066AbYBMBEZ (ORCPT ); Tue, 12 Feb 2008 20:04:25 -0500 Date: Tue, 12 Feb 2008 17:04:24 -0800 (PST) From: Christoph Lameter X-X-Sender: clameter@schroedinger.engr.sgi.com To: Paul Jackson cc: Lee Schermerhorn , rientjes@google.com, akpm@linux-foundation.org, ak@suse.de, linux-kernel@vger.kernel.org Subject: Re: [patch 1/4] mempolicy: convert MPOL constants to enum In-Reply-To: <20080212183158.3ff4ccd5.pj@sgi.com> Message-ID: References: <1202861432.4974.29.camel@localhost> <20080212183158.3ff4ccd5.pj@sgi.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1042 Lines: 29 On Tue, 12 Feb 2008, Paul Jackson wrote: > I'm inclined toward the original types for the 'policy' field. Good. And remove the enum. > Specifically, I'd suggest adding the one line for 'mode_f_static_nodes' > as below, and leaving the code involving the encoding of the policy > field alone. > > struct mempolicy { > atomic_t refcnt; > short policy; /* See MPOL_* above */ > int mode_f_static_nodes:1; /* <== Added line <== */ It would be better to add some sort of flags field? > Single bit fields (The ":1" above) provide the simplest way to add > boolean flags to structs. Let the compiler do the work of packing > and unpacking the field. We usually do that with unsigned XXX and constants. You may want to check multiple flags at once or do other fancy things. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/