Lines Matching refs:param

56 	struct fs_parameter *param, bool *negated)  in fs_lookup_key()  argument
59 const char *name = param->key; in fs_lookup_key()
60 bool want_flag = param->type == fs_value_is_flag; in fs_lookup_key()
105 struct fs_parameter *param, in __fs_parse() argument
112 p = fs_lookup_key(desc, param, &result->negated); in __fs_parse()
117 warn_plog(log, "Deprecated parameter '%s'", param->key); in __fs_parse()
123 if (param->type != fs_value_is_flag) in __fs_parse()
125 param->key); in __fs_parse()
128 int ret = p->type(log, p, param, result); in __fs_parse()
145 struct fs_parameter *param, in fs_lookup_param() argument
154 switch (param->type) { in fs_lookup_param()
156 f = getname_kernel(param->string); in fs_lookup_param()
162 f = param->name; in fs_lookup_param()
166 return invalf(fc, "%s: not usable as path", param->key); in fs_lookup_param()
169 ret = filename_lookup(param->dirfd, f, flags, _path, NULL); in fs_lookup_param()
171 errorf(fc, "%s: Lookup failure for '%s'", param->key, f->name); in fs_lookup_param()
181 param->key, f->name); in fs_lookup_param()
192 static int fs_param_bad_value(struct p_log *log, struct fs_parameter *param) in fs_param_bad_value() argument
194 return inval_plog(log, "Bad value for '%s'", param->key); in fs_param_bad_value()
198 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_bool() argument
201 if (param->type != fs_value_is_string) in fs_param_is_bool()
202 return fs_param_bad_value(log, param); in fs_param_is_bool()
203 if (!*param->string && (p->flags & fs_param_can_be_empty)) in fs_param_is_bool()
205 b = lookup_constant(bool_names, param->string, -1); in fs_param_is_bool()
207 return fs_param_bad_value(log, param); in fs_param_is_bool()
214 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_u32() argument
217 if (param->type != fs_value_is_string) in fs_param_is_u32()
218 return fs_param_bad_value(log, param); in fs_param_is_u32()
219 if (!*param->string && (p->flags & fs_param_can_be_empty)) in fs_param_is_u32()
221 if (kstrtouint(param->string, base, &result->uint_32) < 0) in fs_param_is_u32()
222 return fs_param_bad_value(log, param); in fs_param_is_u32()
228 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_s32() argument
230 if (param->type != fs_value_is_string) in fs_param_is_s32()
231 return fs_param_bad_value(log, param); in fs_param_is_s32()
232 if (!*param->string && (p->flags & fs_param_can_be_empty)) in fs_param_is_s32()
234 if (kstrtoint(param->string, 0, &result->int_32) < 0) in fs_param_is_s32()
235 return fs_param_bad_value(log, param); in fs_param_is_s32()
241 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_u64() argument
243 if (param->type != fs_value_is_string) in fs_param_is_u64()
244 return fs_param_bad_value(log, param); in fs_param_is_u64()
245 if (!*param->string && (p->flags & fs_param_can_be_empty)) in fs_param_is_u64()
247 if (kstrtoull(param->string, 0, &result->uint_64) < 0) in fs_param_is_u64()
248 return fs_param_bad_value(log, param); in fs_param_is_u64()
254 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_enum() argument
257 if (param->type != fs_value_is_string) in fs_param_is_enum()
258 return fs_param_bad_value(log, param); in fs_param_is_enum()
259 if (!*param->string && (p->flags & fs_param_can_be_empty)) in fs_param_is_enum()
261 c = __lookup_constant(p->data, param->string); in fs_param_is_enum()
263 return fs_param_bad_value(log, param); in fs_param_is_enum()
270 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_string() argument
272 if (param->type != fs_value_is_string || in fs_param_is_string()
273 (!*param->string && !(p->flags & fs_param_can_be_empty))) in fs_param_is_string()
274 return fs_param_bad_value(log, param); in fs_param_is_string()
280 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_blob() argument
282 if (param->type != fs_value_is_blob) in fs_param_is_blob()
283 return fs_param_bad_value(log, param); in fs_param_is_blob()
289 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_fd() argument
291 switch (param->type) { in fs_param_is_fd()
293 if ((!*param->string && !(p->flags & fs_param_can_be_empty)) || in fs_param_is_fd()
294 kstrtouint(param->string, 0, &result->uint_32) < 0) in fs_param_is_fd()
300 result->uint_32 = param->dirfd; in fs_param_is_fd()
307 return fs_param_bad_value(log, param); in fs_param_is_fd()
312 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_blockdev() argument
319 struct fs_parameter *param, struct fs_parse_result *result) in fs_param_is_path() argument
383 const struct fs_parameter_spec *param, *p2; in fs_validate_description() local
386 for (param = desc; param->name; param++) { in fs_validate_description()
388 for (p2 = desc; p2 < param; p2++) { in fs_validate_description()
389 if (strcmp(param->name, p2->name) == 0) { in fs_validate_description()
390 if (is_flag(param) != is_flag(p2)) in fs_validate_description()
393 name, param->name); in fs_validate_description()