OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 0/7] Start using sysctl paths in the core kernel code
Re: [PATCH 1/7][QUOTA] Move sysctl management code under ifdef CONFIG_SYSCTL [message #24315 is a reply to message #24311] Mon, 03 December 2007 23:32 Go to previous messageGo to previous message
ebiederm is currently offline  ebiederm
Messages: 1354
Registered: February 2006
Senior Member
Andrew Morton <akpm@linux-foundation.org> writes:

>> +#ifdef CONFIG_SYSCTL
>>  static ctl_table fs_dqstats_table[] = {
>>  	{
>>  		.ctl_name	= FS_DQ_LOOKUPS,
>> @@ -1918,6 +1919,7 @@ static ctl_table sys_table[] = {
>>  	},
>>  	{ .ctl_name = 0 },
>>  };
>> +#endif
>>  
>>  static int __init dquot_init(void)
>>  {
>> @@ -1926,7 +1928,9 @@ static int __init dquot_init(void)
>>  
>>  	printk(KERN_NOTICE "VFS: Disk quotas %s\n", __DQUOT_VERSION__);
>>  
>> +#ifdef CONFIG_SYSCTL
>>  	register_sysctl_table(sys_table);
>> +#endif
>>  
>>  	dquot_cachep = kmem_cache_create("dquot",
>>  			sizeof(struct dquot), sizeof(unsigned long) * 4,
>
> We should avoid the ifdefs around the register_sysctl_table() call.
>
> At present the !CONFIG_SYSCTL implementation of register_sysctl_table() is
> a non-inlined NULL-returning stub.  All we have to do is to inline that stub
> then these ifdefs can go away.

Yes agreed.  What we need to do is to give the compiler enough information
to know that the sysctl table is not used.

Making the function an inline and having the table marked "static"
should be enough for the compiler to do the optimization for us instead
of having to manually remove sysctl tables by hand.

Doing it with an inline function should save us a lot of work and maintenance
in the long run.   I will see if I can cook up that patch.

> The same applies to register_sysctl_paths().

Agreed.

Eric
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH 3/4] netns: Initialize fl_net in structures allocated with dst_alloc
Next Topic: [PATCH 4/4] netns: prevent usage of flowi with not initialized fl_net in routing
Goto Forum:
  


Current Time: Thu Aug 21 11:13:21 GMT 2025

Total time taken to generate the page: 0.06031 seconds