Messages in this thread |  | | | Date | Tue, 12 Feb 2008 17:04:24 -0800 (PST) | | From | Christoph Lameter <> | | Subject | Re: [patch 1/4] mempolicy: convert MPOL constants to enum | |
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.
|  |