Lines Matching full:param

57 	struct fs_parameter *param, bool *negated)  in fs_lookup_key()  argument
60 const char *name = param->key; in fs_lookup_key()
61 bool want_flag = param->type == fs_value_is_flag; in fs_lookup_key()
90 * @param: The parameter.
106 struct fs_parameter *param, in __fs_parse() argument
113 p = fs_lookup_key(desc, param, &result->negated); in __fs_parse()
118 warn_plog(log, "Deprecated parameter '%s'", param->key); in __fs_parse()
124 if (param->type != fs_value_is_flag) in __fs_parse()
126 param->key); in __fs_parse()
129 int ret = p->type(log, p, param, result); in __fs_parse()
140 * @param: The parameter.
146 struct fs_parameter *param, in fs_lookup_param() argument
155 switch (param->type) { in fs_lookup_param()
157 f = getname_kernel(param->string); in fs_lookup_param()
160 param->dirfd = AT_FDCWD; in fs_lookup_param()
164 f = param->name; in fs_lookup_param()
168 return invalf(fc, "%s: not usable as path", param->key); in fs_lookup_param()
171 ret = filename_lookup(param->dirfd, f, flags, _path, NULL); in fs_lookup_param()
173 errorf(fc, "%s: Lookup failure for '%s'", param->key, f->name); in fs_lookup_param()
183 param->key, f->name); in fs_lookup_param()
194 static int fs_param_bad_value(struct p_log *log, struct fs_parameter *param) in fs_param_bad_value() argument
196 return inval_plog(log, "Bad value for '%s'", param->key); in fs_param_bad_value()
200 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_bool() argument
203 if (param->type != fs_value_is_string) in fs_param_is_bool()
204 return fs_param_bad_value(log, param); in fs_param_is_bool()
205 if (!*param->string && (p->flags & fs_param_can_be_empty)) in fs_param_is_bool()
207 b = lookup_constant(bool_names, param->string, -1); in fs_param_is_bool()
209 return fs_param_bad_value(log, param); in fs_param_is_bool()
216 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_u32() argument
219 if (param->type != fs_value_is_string) in fs_param_is_u32()
220 return fs_param_bad_value(log, param); in fs_param_is_u32()
221 if (!*param->string && (p->flags & fs_param_can_be_empty)) in fs_param_is_u32()
223 if (kstrtouint(param->string, base, &result->uint_32) < 0) in fs_param_is_u32()
224 return fs_param_bad_value(log, param); in fs_param_is_u32()
230 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_s32() argument
232 if (param->type != fs_value_is_string) in fs_param_is_s32()
233 return fs_param_bad_value(log, param); in fs_param_is_s32()
234 if (!*param->string && (p->flags & fs_param_can_be_empty)) in fs_param_is_s32()
236 if (kstrtoint(param->string, 0, &result->int_32) < 0) in fs_param_is_s32()
237 return fs_param_bad_value(log, param); in fs_param_is_s32()
243 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_u64() argument
245 if (param->type != fs_value_is_string) in fs_param_is_u64()
246 return fs_param_bad_value(log, param); in fs_param_is_u64()
247 if (!*param->string && (p->flags & fs_param_can_be_empty)) in fs_param_is_u64()
249 if (kstrtoull(param->string, 0, &result->uint_64) < 0) in fs_param_is_u64()
250 return fs_param_bad_value(log, param); in fs_param_is_u64()
256 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_enum() argument
259 if (param->type != fs_value_is_string) in fs_param_is_enum()
260 return fs_param_bad_value(log, param); in fs_param_is_enum()
261 if (!*param->string && (p->flags & fs_param_can_be_empty)) in fs_param_is_enum()
263 c = __lookup_constant(p->data, param->string); in fs_param_is_enum()
265 return fs_param_bad_value(log, param); in fs_param_is_enum()
272 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_string() argument
274 if (param->type != fs_value_is_string || in fs_param_is_string()
275 (!*param->string && !(p->flags & fs_param_can_be_empty))) in fs_param_is_string()
276 return fs_param_bad_value(log, param); in fs_param_is_string()
282 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_blob() argument
284 if (param->type != fs_value_is_blob) in fs_param_is_blob()
285 return fs_param_bad_value(log, param); in fs_param_is_blob()
291 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_fd() argument
293 switch (param->type) { in fs_param_is_fd()
295 if ((!*param->string && !(p->flags & fs_param_can_be_empty)) || in fs_param_is_fd()
296 kstrtouint(param->string, 0, &result->uint_32) < 0) in fs_param_is_fd()
302 result->uint_32 = param->dirfd; in fs_param_is_fd()
309 return fs_param_bad_value(log, param); in fs_param_is_fd()
315 struct fs_parameter *param, in fs_param_is_file_or_string() argument
318 switch (param->type) { in fs_param_is_file_or_string()
320 return fs_param_is_string(log, p, param, result); in fs_param_is_file_or_string()
322 result->uint_32 = param->dirfd; in fs_param_is_file_or_string()
329 return fs_param_bad_value(log, param); in fs_param_is_file_or_string()
334 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_uid() argument
338 if (fs_param_is_u32(log, p, param, result) != 0) in fs_param_is_uid()
339 return fs_param_bad_value(log, param); in fs_param_is_uid()
343 return inval_plog(log, "Invalid uid '%s'", param->string); in fs_param_is_uid()
351 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_gid() argument
355 if (fs_param_is_u32(log, p, param, result) != 0) in fs_param_is_gid()
356 return fs_param_bad_value(log, param); in fs_param_is_gid()
360 return inval_plog(log, "Invalid gid '%s'", param->string); in fs_param_is_gid()
368 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_blockdev() argument
375 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_path() argument
439 const struct fs_parameter_spec *param, *p2; in fs_validate_description() local
442 for (param = desc; param->name; param++) { in fs_validate_description()
444 for (p2 = desc; p2 < param; p2++) { in fs_validate_description()
445 if (strcmp(param->name, p2->name) == 0) { in fs_validate_description()
446 if (is_flag(param) != is_flag(p2)) in fs_validate_description()
448 pr_err("VALIDATE %s: PARAM[%s]: Duplicate\n", in fs_validate_description()
449 name, param->name); in fs_validate_description()