Skip to content

Commit

Permalink
quota: simplify two-level sysctl registration for fs_dqstats_table
Browse files Browse the repository at this point in the history
There is no need to declare two tables to just create directories,
this can be easily be done with a prefix path with register_sysctl().

Simplify this registration.

Signed-off-by: Luis Chamberlain <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
mcgrof authored and jankara committed Mar 13, 2023
1 parent f768dc3 commit dced733
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions fs/quota/dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -2948,32 +2948,14 @@ static struct ctl_table fs_dqstats_table[] = {
{ },
};

static struct ctl_table fs_table[] = {
{
.procname = "quota",
.mode = 0555,
.child = fs_dqstats_table,
},
{ },
};

static struct ctl_table sys_table[] = {
{
.procname = "fs",
.mode = 0555,
.child = fs_table,
},
{ },
};

static int __init dquot_init(void)
{
int i, ret;
unsigned long nr_hash, order;

printk(KERN_NOTICE "VFS: Disk quotas %s\n", __DQUOT_VERSION__);

register_sysctl_table(sys_table);
register_sysctl("fs/quota", fs_dqstats_table);

dquot_cachep = kmem_cache_create("dquot",
sizeof(struct dquot), sizeof(unsigned long) * 4,
Expand Down

0 comments on commit dced733

Please sign in to comment.