mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
synced 2025-09-13 11:07:46 +10:00
fs/cachefiles: simplify one-level sysctl registration for cachefiles_sysctls
There is no need to declare an extra tables to just create directory, this can be easily be done with a prefix path with register_sysctl(). Simplify this registration. Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
This commit is contained in:
parent
f5d2b92c85
commit
3d379b8d0d
@ -22,18 +22,9 @@ static struct ctl_table cachefiles_sysctls[] = {
|
|||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct ctl_table cachefiles_sysctls_root[] = {
|
|
||||||
{
|
|
||||||
.procname = "cachefiles",
|
|
||||||
.mode = 0555,
|
|
||||||
.child = cachefiles_sysctls,
|
|
||||||
},
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
|
|
||||||
int __init cachefiles_register_error_injection(void)
|
int __init cachefiles_register_error_injection(void)
|
||||||
{
|
{
|
||||||
cachefiles_sysctl = register_sysctl_table(cachefiles_sysctls_root);
|
cachefiles_sysctl = register_sysctl("cachefiles", cachefiles_sysctls);
|
||||||
if (!cachefiles_sysctl)
|
if (!cachefiles_sysctl)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user