Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198226
b: refs/heads/master
c: 345ace9
h: refs/heads/master
v: v3
  • Loading branch information
Lee Schermerhorn authored and Linus Torvalds committed May 25, 2010
1 parent ebe3c6d commit 22c22a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b4652e8429100ba5c3ddb49499faa1188c98c246
refs/heads/master: 345ace9c797030e77da8ff211b9502370b9d81ab
18 changes: 12 additions & 6 deletions trunk/mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2121,9 +2121,15 @@ void numa_default_policy(void)
* "local" is pseudo-policy: MPOL_PREFERRED with MPOL_F_LOCAL flag
* Used only for mpol_parse_str() and mpol_to_str()
*/
#define MPOL_LOCAL (MPOL_INTERLEAVE + 1)
static const char * const policy_types[] =
{ "default", "prefer", "bind", "interleave", "local" };
#define MPOL_LOCAL MPOL_MAX
static const char * const policy_modes[] =
{
[MPOL_DEFAULT] = "default",
[MPOL_PREFERRED] = "prefer",
[MPOL_BIND] = "bind",
[MPOL_INTERLEAVE] = "interleave",
[MPOL_LOCAL] = "local"
};


#ifdef CONFIG_TMPFS
Expand Down Expand Up @@ -2169,7 +2175,7 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context)
*flags++ = '\0'; /* terminate mode string */

for (mode = 0; mode <= MPOL_LOCAL; mode++) {
if (!strcmp(str, policy_types[mode])) {
if (!strcmp(str, policy_modes[mode])) {
break;
}
}
Expand Down Expand Up @@ -2324,11 +2330,11 @@ int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, int no_context)
BUG();
}

l = strlen(policy_types[mode]);
l = strlen(policy_modes[mode]);
if (buffer + maxlen < p + l + 1)
return -ENOSPC;

strcpy(p, policy_types[mode]);
strcpy(p, policy_modes[mode]);
p += l;

if (flags & MPOL_MODE_FLAGS) {
Expand Down

0 comments on commit 22c22a5

Please sign in to comment.