VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Al Viro <viro@zeniv.linux.org.uk> 2019-12-20 23:52:55 -0500 committer: Al Viro <viro@zeniv.linux.org.uk> 2020-02-07 14:48:34 -0500 commit: 7f5d38141e309bb4ba995d9726928af85a299c50 parent: 2c3f3dc315565941262e980029c0f74ad118231a
Commit Summary:
new primitive: __fs_parse()
Diffstat:
1 file changed, 14 insertions, 6 deletions
diff --git a/fs/fs_parser.c b/fs/fs_parser.c
index dc5c6737c280..dadb6582874d 100644
--- a/fs/fs_parser.c
+++ b/fs/fs_parser.c
@@ -80,7 +80,7 @@ static const struct fs_parameter_spec *fs_lookup_key(
  * unknown parameters are okay and -EINVAL if there was a conversion issue or
  * the parameter wasn't recognised and unknowns aren't okay.
  */
-int fs_parse(struct fs_context *fc,
+int __fs_parse(struct p_log *log,
 	     const struct fs_parameter_description *desc,
 	     struct fs_parameter *param,
 	     struct fs_parse_result *result)
@@ -113,8 +113,7 @@ int fs_parse(struct fs_context *fc,
 	}
 
 	if (p->flags & fs_param_deprecated)
-		warnf(fc, "%s: Deprecated parameter '%s'",
-		      desc->name, param->key);
+		warn_plog(log, "Deprecated parameter '%s'", param->key);
 
 	if (result->negated)
 		goto okay;
@@ -152,8 +151,8 @@ int fs_parse(struct fs_context *fc,
 	switch (p->type) {
 	case fs_param_is_flag:
 		if (param->type != fs_value_is_flag)
-			return invalf(fc, "%s: Unexpected value for '%s'",
-				      desc->name, param->key);
+			return inval_plog(log, "Unexpected value for '%s'",
+				      param->key);
 		result->boolean = true;
 		goto okay;
 
@@ -238,10 +237,20 @@ okay:
 	return p->opt;
 
 bad_value:
-	return invalf(fc, "%s: Bad value for '%s'", desc->name, param->key);
+	return inval_plog(log, "Bad value for '%s'", param->key);
 unknown_parameter:
 	return -ENOPARAM;
 }
+EXPORT_SYMBOL(__fs_parse);
+
+int fs_parse(struct fs_context *fc,
+	     const struct fs_parameter_description *desc,
+	     struct fs_parameter *param,
+	     struct fs_parse_result *result)
+{
+	struct p_log log = {.prefix = desc->name, .log = fc->log};
+	return __fs_parse(&log, desc, param, result);
+}
 EXPORT_SYMBOL(fs_parse);
 
 /**