diff options
Diffstat (limited to 'include/linux/mempolicy.h')
-rw-r--r-- | include/linux/mempolicy.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 389a06e8ee21..f2bab4d2fc40 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -8,6 +8,12 @@ | |||
8 | * Copyright 2003,2004 Andi Kleen SuSE Labs | 8 | * Copyright 2003,2004 Andi Kleen SuSE Labs |
9 | */ | 9 | */ |
10 | 10 | ||
11 | /* | ||
12 | * Both the MPOL_* mempolicy mode and the MPOL_F_* optional mode flags are | ||
13 | * passed by the user to either set_mempolicy() or mbind() in an 'int' actual. | ||
14 | * The MPOL_MODE_FLAGS macro determines the legal set of optional mode flags. | ||
15 | */ | ||
16 | |||
11 | /* Policies */ | 17 | /* Policies */ |
12 | enum { | 18 | enum { |
13 | MPOL_DEFAULT, | 19 | MPOL_DEFAULT, |
@@ -17,7 +23,14 @@ enum { | |||
17 | MPOL_MAX, /* always last member of enum */ | 23 | MPOL_MAX, /* always last member of enum */ |
18 | }; | 24 | }; |
19 | 25 | ||
20 | /* Flags for get_mem_policy */ | 26 | /* Flags for set_mempolicy */ |
27 | /* | ||
28 | * MPOL_MODE_FLAGS is the union of all possible optional mode flags passed to | ||
29 | * either set_mempolicy() or mbind(). | ||
30 | */ | ||
31 | #define MPOL_MODE_FLAGS (0) | ||
32 | |||
33 | /* Flags for get_mempolicy */ | ||
21 | #define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */ | 34 | #define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */ |
22 | #define MPOL_F_ADDR (1<<1) /* look up vma using address */ | 35 | #define MPOL_F_ADDR (1<<1) /* look up vma using address */ |
23 | #define MPOL_F_MEMS_ALLOWED (1<<2) /* return allowed memories */ | 36 | #define MPOL_F_MEMS_ALLOWED (1<<2) /* return allowed memories */ |
@@ -66,6 +79,7 @@ struct mm_struct; | |||
66 | struct mempolicy { | 79 | struct mempolicy { |
67 | atomic_t refcnt; | 80 | atomic_t refcnt; |
68 | unsigned short policy; /* See MPOL_* above */ | 81 | unsigned short policy; /* See MPOL_* above */ |
82 | unsigned short flags; /* See set_mempolicy() MPOL_F_* above */ | ||
69 | union { | 83 | union { |
70 | short preferred_node; /* preferred */ | 84 | short preferred_node; /* preferred */ |
71 | nodemask_t nodes; /* interleave/bind */ | 85 | nodemask_t nodes; /* interleave/bind */ |
@@ -136,7 +150,7 @@ struct shared_policy { | |||
136 | }; | 150 | }; |
137 | 151 | ||
138 | void mpol_shared_policy_init(struct shared_policy *info, unsigned short policy, | 152 | void mpol_shared_policy_init(struct shared_policy *info, unsigned short policy, |
139 | nodemask_t *nodes); | 153 | unsigned short flags, nodemask_t *nodes); |
140 | int mpol_set_shared_policy(struct shared_policy *info, | 154 | int mpol_set_shared_policy(struct shared_policy *info, |
141 | struct vm_area_struct *vma, | 155 | struct vm_area_struct *vma, |
142 | struct mempolicy *new); | 156 | struct mempolicy *new); |
@@ -203,7 +217,7 @@ static inline int mpol_set_shared_policy(struct shared_policy *info, | |||
203 | } | 217 | } |
204 | 218 | ||
205 | static inline void mpol_shared_policy_init(struct shared_policy *info, | 219 | static inline void mpol_shared_policy_init(struct shared_policy *info, |
206 | unsigned short policy, nodemask_t *nodes) | 220 | unsigned short policy, unsigned short flags, nodemask_t *nodes) |
207 | { | 221 | { |
208 | } | 222 | } |
209 | 223 | ||