diff options
Diffstat (limited to 'mm/shmem.c')
-rw-r--r-- | mm/shmem.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/mm/shmem.c b/mm/shmem.c index 9435f298dd75..177c7a7d2bb3 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -1125,20 +1125,26 @@ static int shmem_parse_mpol(char *value, unsigned short *policy, | |||
1125 | *policy_nodes = node_states[N_HIGH_MEMORY]; | 1125 | *policy_nodes = node_states[N_HIGH_MEMORY]; |
1126 | err = 0; | 1126 | err = 0; |
1127 | } | 1127 | } |
1128 | |||
1129 | *mode_flags = 0; | ||
1128 | if (flags) { | 1130 | if (flags) { |
1131 | /* | ||
1132 | * Currently, we only support two mutually exclusive | ||
1133 | * mode flags. | ||
1134 | */ | ||
1129 | if (!strcmp(flags, "static")) | 1135 | if (!strcmp(flags, "static")) |
1130 | *mode_flags |= MPOL_F_STATIC_NODES; | 1136 | *mode_flags |= MPOL_F_STATIC_NODES; |
1131 | if (!strcmp(flags, "relative")) | 1137 | else if (!strcmp(flags, "relative")) |
1132 | *mode_flags |= MPOL_F_RELATIVE_NODES; | 1138 | *mode_flags |= MPOL_F_RELATIVE_NODES; |
1133 | 1139 | else | |
1134 | if ((*mode_flags & MPOL_F_STATIC_NODES) && | 1140 | err = 1; /* unrecognized flag */ |
1135 | (*mode_flags & MPOL_F_RELATIVE_NODES)) | ||
1136 | err = 1; | ||
1137 | } | 1141 | } |
1138 | out: | 1142 | out: |
1139 | /* Restore string for error message */ | 1143 | /* Restore string for error message */ |
1140 | if (nodelist) | 1144 | if (nodelist) |
1141 | *--nodelist = ':'; | 1145 | *--nodelist = ':'; |
1146 | if (flags) | ||
1147 | *--flags = '='; | ||
1142 | return err; | 1148 | return err; |
1143 | } | 1149 | } |
1144 | 1150 | ||