From cc3c0b533ab9142eac2e291628fbfca3685f38cd Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 21 Dec 2019 00:16:49 -0500 Subject: add prefix to fs_context->log ... turning it into struct p_log embedded into fs_context. Initialize the prefix with fs_type->name, turning fs_parse() into a trivial inline wrapper for __fs_parse(). This makes fs_parameter_description->name completely unused. Signed-off-by: Al Viro --- include/linux/fs_context.h | 4 ++-- include/linux/fs_parser.h | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/linux/fs_context.h b/include/linux/fs_context.h index 41f37d33e358..b2ad9b0a7af4 100644 --- a/include/linux/fs_context.h +++ b/include/linux/fs_context.h @@ -97,7 +97,7 @@ struct fs_context { struct user_namespace *user_ns; /* The user namespace for this mount */ struct net *net_ns; /* The network namespace for this mount */ const struct cred *cred; /* The mounter's credentials */ - struct fc_log *log; /* Logging buffer */ + struct p_log log; /* Logging buffer */ const char *source; /* The source name (eg. dev path) */ void *security; /* Linux S&M options */ void *s_fs_info; /* Proposed s_fs_info */ @@ -189,7 +189,7 @@ struct fc_log { extern __attribute__((format(printf, 4, 5))) void logfc(struct fc_log *log, const char *prefix, char level, const char *fmt, ...); -#define __logfc(fc, l, fmt, ...) logfc((fc)->log, NULL, \ +#define __logfc(fc, l, fmt, ...) logfc((fc)->log.log, NULL, \ l, fmt, ## __VA_ARGS__) #define __plog(p, l, fmt, ...) logfc((p)->log, (p)->prefix, \ l, fmt, ## __VA_ARGS__) diff --git a/include/linux/fs_parser.h b/include/linux/fs_parser.h index b0fba26a4ffe..37459124c1c1 100644 --- a/include/linux/fs_parser.h +++ b/include/linux/fs_parser.h @@ -78,10 +78,15 @@ extern int __fs_parse(struct p_log *log, const struct fs_parameter_description *desc, struct fs_parameter *value, struct fs_parse_result *result); -extern int fs_parse(struct fs_context *fc, - const struct fs_parameter_description *desc, - struct fs_parameter *value, - struct fs_parse_result *result); + +static inline int fs_parse(struct fs_context *fc, + const struct fs_parameter_description *desc, + struct fs_parameter *param, + struct fs_parse_result *result) +{ + return __fs_parse(&fc->log, desc, param, result); +} + extern int fs_lookup_param(struct fs_context *fc, struct fs_parameter *param, bool want_bdev, -- cgit v1.2.3