fs_parser: remove fs_parameter_description name field

Unused now.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Eric Sandeen 2019-12-06 10:45:01 -06:00 committed by Al Viro
parent cc3c0b533a
commit 96cafb9ccb
26 changed files with 11 additions and 44 deletions

View File

@ -518,7 +518,6 @@ Parameters are described using structures defined in linux/fs_parser.h.
There's a core description struct that links everything together: There's a core description struct that links everything together:
struct fs_parameter_description { struct fs_parameter_description {
const char name[16];
const struct fs_parameter_spec *specs; const struct fs_parameter_spec *specs;
const struct fs_parameter_enum *enums; const struct fs_parameter_enum *enums;
}; };
@ -534,19 +533,13 @@ For example:
}; };
static const struct fs_parameter_description afs_fs_parameters = { static const struct fs_parameter_description afs_fs_parameters = {
.name = "kAFS",
.specs = afs_param_specs, .specs = afs_param_specs,
.enums = afs_param_enums, .enums = afs_param_enums,
}; };
The members are as follows: The members are as follows:
(1) const char name[16]; (1) const struct fs_parameter_specification *specs;
The name to be used in error messages generated by the parse helper
functions.
(2) const struct fs_parameter_specification *specs;
Table of parameter specifications, terminated with a null entry, where the Table of parameter specifications, terminated with a null entry, where the
entries are of type: entries are of type:
@ -625,7 +618,7 @@ The members are as follows:
of arguments to specify the type and the flags for anything that doesn't of arguments to specify the type and the flags for anything that doesn't
match one of the above macros. match one of the above macros.
(6) const struct fs_parameter_enum *enums; (2) const struct fs_parameter_enum *enums;
Table of enum value names to integer mappings, terminated with a null Table of enum value names to integer mappings, terminated with a null
entry. This is of type: entry. This is of type:

View File

@ -592,7 +592,6 @@ static const struct fs_parameter_spec spufs_param_specs[] = {
}; };
static const struct fs_parameter_description spufs_fs_parameters = { static const struct fs_parameter_description spufs_fs_parameters = {
.name = "spufs",
.specs = spufs_param_specs, .specs = spufs_param_specs,
}; };

View File

@ -216,7 +216,6 @@ static const struct fs_parameter_spec hypfs_param_specs[] = {
}; };
static const struct fs_parameter_description hypfs_fs_parameters = { static const struct fs_parameter_description hypfs_fs_parameters = {
.name = "hypfs",
.specs = hypfs_param_specs, .specs = hypfs_param_specs,
}; };

View File

@ -2045,7 +2045,6 @@ static const struct fs_parameter_spec rdt_param_specs[] = {
}; };
static const struct fs_parameter_description rdt_fs_parameters = { static const struct fs_parameter_description rdt_fs_parameters = {
.name = "rdt",
.specs = rdt_param_specs, .specs = rdt_param_specs,
}; };

View File

@ -864,7 +864,6 @@ static const struct fs_parameter_spec rbd_param_specs[] = {
}; };
static const struct fs_parameter_description rbd_parameters = { static const struct fs_parameter_description rbd_parameters = {
.name = "rbd",
.specs = rbd_param_specs, .specs = rbd_param_specs,
}; };

View File

@ -1497,7 +1497,6 @@ static const struct fs_parameter_spec ffs_fs_param_specs[] = {
}; };
static const struct fs_parameter_description ffs_fs_fs_parameters = { static const struct fs_parameter_description ffs_fs_fs_parameters = {
.name = "kAFS",
.specs = ffs_fs_param_specs, .specs = ffs_fs_param_specs,
}; };

View File

@ -90,7 +90,6 @@ static const struct fs_parameter_spec afs_param_specs[] = {
}; };
static const struct fs_parameter_description afs_fs_parameters = { static const struct fs_parameter_description afs_fs_parameters = {
.name = "kAFS",
.specs = afs_param_specs, .specs = afs_param_specs,
}; };

View File

@ -199,7 +199,6 @@ static const struct fs_parameter_spec ceph_mount_param_specs[] = {
}; };
static const struct fs_parameter_description ceph_mount_parameters = { static const struct fs_parameter_description ceph_mount_parameters = {
.name = "ceph",
.specs = ceph_mount_param_specs, .specs = ceph_mount_param_specs,
}; };

View File

@ -74,7 +74,8 @@ int register_filesystem(struct file_system_type * fs)
int res = 0; int res = 0;
struct file_system_type ** p; struct file_system_type ** p;
if (fs->parameters && !fs_validate_description(fs->parameters)) if (fs->parameters &&
!fs_validate_description(fs->name, fs->parameters))
return -EINVAL; return -EINVAL;
BUG_ON(strchr(fs->name, '.')); BUG_ON(strchr(fs->name, '.'));

View File

@ -354,20 +354,14 @@ bool validate_constant_table(const struct constant_table *tbl, size_t tbl_size,
* fs_validate_description - Validate a parameter description * fs_validate_description - Validate a parameter description
* @desc: The parameter description to validate. * @desc: The parameter description to validate.
*/ */
bool fs_validate_description(const struct fs_parameter_description *desc) bool fs_validate_description(const char *name,
const struct fs_parameter_description *desc)
{ {
const struct fs_parameter_spec *param, *p2; const struct fs_parameter_spec *param, *p2;
const char *name = desc->name;
bool good = true; bool good = true;
pr_notice("*** VALIDATE %s ***\n", name); pr_notice("*** VALIDATE %s ***\n", name);
if (!name[0]) {
pr_err("VALIDATE Parser: No name\n");
name = "Unknown";
good = false;
}
if (desc->specs) { if (desc->specs) {
for (param = desc->specs; param->name; param++) { for (param = desc->specs; param->name; param++) {
enum fs_parameter_type t = param->type; enum fs_parameter_type t = param->type;

View File

@ -463,7 +463,6 @@ static const struct fs_parameter_spec fuse_param_specs[] = {
}; };
static const struct fs_parameter_description fuse_fs_parameters = { static const struct fs_parameter_description fuse_fs_parameters = {
.name = "fuse",
.specs = fuse_param_specs, .specs = fuse_param_specs,
}; };

View File

@ -1337,7 +1337,6 @@ static const struct fs_parameter_spec gfs2_param_specs[] = {
}; };
static const struct fs_parameter_description gfs2_fs_parameters = { static const struct fs_parameter_description gfs2_fs_parameters = {
.name = "gfs2",
.specs = gfs2_param_specs, .specs = gfs2_param_specs,
}; };

View File

@ -85,7 +85,6 @@ static const struct fs_parameter_spec hugetlb_param_specs[] = {
}; };
static const struct fs_parameter_description hugetlb_fs_parameters = { static const struct fs_parameter_description hugetlb_fs_parameters = {
.name = "hugetlbfs",
.specs = hugetlb_param_specs, .specs = hugetlb_param_specs,
}; };

View File

@ -185,7 +185,6 @@ static const struct fs_parameter_spec jffs2_param_specs[] = {
}; };
const struct fs_parameter_description jffs2_fs_parameters = { const struct fs_parameter_description jffs2_fs_parameters = {
.name = "jffs2",
.specs = jffs2_param_specs, .specs = jffs2_param_specs,
}; };

View File

@ -174,7 +174,6 @@ static const struct fs_parameter_spec nfs_param_specs[] = {
}; };
static const struct fs_parameter_description nfs_fs_parameters = { static const struct fs_parameter_description nfs_fs_parameters = {
.name = "nfs",
.specs = nfs_param_specs, .specs = nfs_param_specs,
}; };

View File

@ -48,7 +48,6 @@ static const struct fs_parameter_spec proc_param_specs[] = {
}; };
static const struct fs_parameter_description proc_fs_parameters = { static const struct fs_parameter_description proc_fs_parameters = {
.name = "proc",
.specs = proc_param_specs, .specs = proc_param_specs,
}; };

View File

@ -187,7 +187,6 @@ static const struct fs_parameter_spec ramfs_param_specs[] = {
}; };
const struct fs_parameter_description ramfs_fs_parameters = { const struct fs_parameter_description ramfs_fs_parameters = {
.name = "ramfs",
.specs = ramfs_param_specs, .specs = ramfs_param_specs,
}; };

View File

@ -107,7 +107,6 @@ static const struct fs_parameter_spec xfs_param_specs[] = {
}; };
static const struct fs_parameter_description xfs_fs_parameters = { static const struct fs_parameter_description xfs_fs_parameters = {
.name = "xfs",
.specs = xfs_param_specs, .specs = xfs_param_specs,
}; };

View File

@ -57,7 +57,6 @@ struct fs_parameter_spec {
}; };
struct fs_parameter_description { struct fs_parameter_description {
const char name[16]; /* Name for logging purposes */
const struct fs_parameter_spec *specs; /* List of param specifications */ const struct fs_parameter_spec *specs; /* List of param specifications */
}; };
@ -97,12 +96,14 @@ extern int lookup_constant(const struct constant_table tbl[], const char *name,
#ifdef CONFIG_VALIDATE_FS_PARSER #ifdef CONFIG_VALIDATE_FS_PARSER
extern bool validate_constant_table(const struct constant_table *tbl, size_t tbl_size, extern bool validate_constant_table(const struct constant_table *tbl, size_t tbl_size,
int low, int high, int special); int low, int high, int special);
extern bool fs_validate_description(const struct fs_parameter_description *desc); extern bool fs_validate_description(const char *name,
const struct fs_parameter_description *desc);
#else #else
static inline bool validate_constant_table(const struct constant_table *tbl, size_t tbl_size, static inline bool validate_constant_table(const struct constant_table *tbl, size_t tbl_size,
int low, int high, int special) int low, int high, int special)
{ return true; } { return true; }
static inline bool fs_validate_description(const struct fs_parameter_description *desc) static inline bool fs_validate_description(const char *name,
const struct fs_parameter_description *desc)
{ return true; } { return true; }
#endif #endif

View File

@ -593,7 +593,6 @@ static const struct fs_parameter_spec bpf_param_specs[] = {
}; };
static const struct fs_parameter_description bpf_fs_parameters = { static const struct fs_parameter_description bpf_fs_parameters = {
.name = "bpf",
.specs = bpf_param_specs, .specs = bpf_param_specs,
}; };

View File

@ -898,7 +898,6 @@ static const struct fs_parameter_spec cgroup1_param_specs[] = {
}; };
const struct fs_parameter_description cgroup1_fs_parameters = { const struct fs_parameter_description cgroup1_fs_parameters = {
.name = "cgroup1",
.specs = cgroup1_param_specs, .specs = cgroup1_param_specs,
}; };

View File

@ -1823,7 +1823,6 @@ static const struct fs_parameter_spec cgroup2_param_specs[] = {
}; };
static const struct fs_parameter_description cgroup2_fs_parameters = { static const struct fs_parameter_description cgroup2_fs_parameters = {
.name = "cgroup2",
.specs = cgroup2_param_specs, .specs = cgroup2_param_specs,
}; };

View File

@ -3404,7 +3404,6 @@ static const struct fs_parameter_spec shmem_param_specs[] = {
}; };
const struct fs_parameter_description shmem_fs_parameters = { const struct fs_parameter_description shmem_fs_parameters = {
.name = "tmpfs",
.specs = shmem_param_specs, .specs = shmem_param_specs,
}; };

View File

@ -291,7 +291,6 @@ static const struct fs_parameter_spec ceph_param_specs[] = {
}; };
static const struct fs_parameter_description ceph_parameters = { static const struct fs_parameter_description ceph_parameters = {
.name = "libceph",
.specs = ceph_param_specs, .specs = ceph_param_specs,
}; };

View File

@ -2818,7 +2818,6 @@ static const struct fs_parameter_spec selinux_param_specs[] = {
}; };
static const struct fs_parameter_description selinux_fs_parameters = { static const struct fs_parameter_description selinux_fs_parameters = {
.name = "SELinux",
.specs = selinux_param_specs, .specs = selinux_param_specs,
}; };
@ -7145,7 +7144,7 @@ static __init int selinux_init(void)
else else
pr_debug("SELinux: Starting in permissive mode\n"); pr_debug("SELinux: Starting in permissive mode\n");
fs_validate_description(&selinux_fs_parameters); fs_validate_description("selinux", &selinux_fs_parameters);
return 0; return 0;
} }

View File

@ -689,7 +689,6 @@ static const struct fs_parameter_spec smack_param_specs[] = {
}; };
static const struct fs_parameter_description smack_fs_parameters = { static const struct fs_parameter_description smack_fs_parameters = {
.name = "smack",
.specs = smack_param_specs, .specs = smack_param_specs,
}; };