mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
proc_sysctl: enhance documentation
commit 1dc8689e4c upstream.
Expand documentation to clarify:
o that paths don't need to exist for the new API callers
o clarify that we *require* callers to keep the memory of
the table around during the lifetime of the sysctls
o annotate routines we are trying to deprecate and later remove
Cc: stable@vger.kernel.org # v5.17
Cc: Christian Brauner <brauner@kernel.org>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f4708645c1
commit
fde64a409b
@@ -1281,7 +1281,10 @@ out:
|
|||||||
* __register_sysctl_table - register a leaf sysctl table
|
* __register_sysctl_table - register a leaf sysctl table
|
||||||
* @set: Sysctl tree to register on
|
* @set: Sysctl tree to register on
|
||||||
* @path: The path to the directory the sysctl table is in.
|
* @path: The path to the directory the sysctl table is in.
|
||||||
* @table: the top-level table structure without any child
|
* @table: the top-level table structure without any child. This table
|
||||||
|
* should not be free'd after registration. So it should not be
|
||||||
|
* used on stack. It can either be a global or dynamically allocated
|
||||||
|
* by the caller and free'd later after sysctl unregistration.
|
||||||
*
|
*
|
||||||
* Register a sysctl table hierarchy. @table should be a filled in ctl_table
|
* Register a sysctl table hierarchy. @table should be a filled in ctl_table
|
||||||
* array. A completely 0 filled entry terminates the table.
|
* array. A completely 0 filled entry terminates the table.
|
||||||
@@ -1396,8 +1399,15 @@ fail:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* register_sysctl - register a sysctl table
|
* register_sysctl - register a sysctl table
|
||||||
* @path: The path to the directory the sysctl table is in.
|
* @path: The path to the directory the sysctl table is in. If the path
|
||||||
* @table: the table structure
|
* doesn't exist we will create it for you.
|
||||||
|
* @table: the table structure. The calller must ensure the life of the @table
|
||||||
|
* will be kept during the lifetime use of the syctl. It must not be freed
|
||||||
|
* until unregister_sysctl_table() is called with the given returned table
|
||||||
|
* with this registration. If your code is non modular then you don't need
|
||||||
|
* to call unregister_sysctl_table() and can instead use something like
|
||||||
|
* register_sysctl_init() which does not care for the result of the syctl
|
||||||
|
* registration.
|
||||||
*
|
*
|
||||||
* Register a sysctl table. @table should be a filled in ctl_table
|
* Register a sysctl table. @table should be a filled in ctl_table
|
||||||
* array. A completely 0 filled entry terminates the table.
|
* array. A completely 0 filled entry terminates the table.
|
||||||
@@ -1413,8 +1423,11 @@ EXPORT_SYMBOL(register_sysctl);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* __register_sysctl_init() - register sysctl table to path
|
* __register_sysctl_init() - register sysctl table to path
|
||||||
* @path: path name for sysctl base
|
* @path: path name for sysctl base. If that path doesn't exist we will create
|
||||||
* @table: This is the sysctl table that needs to be registered to the path
|
* it for you.
|
||||||
|
* @table: This is the sysctl table that needs to be registered to the path.
|
||||||
|
* The caller must ensure the life of the @table will be kept during the
|
||||||
|
* lifetime use of the sysctl.
|
||||||
* @table_name: The name of sysctl table, only used for log printing when
|
* @table_name: The name of sysctl table, only used for log printing when
|
||||||
* registration fails
|
* registration fails
|
||||||
*
|
*
|
||||||
@@ -1559,6 +1572,7 @@ out:
|
|||||||
*
|
*
|
||||||
* Register a sysctl table hierarchy. @table should be a filled in ctl_table
|
* Register a sysctl table hierarchy. @table should be a filled in ctl_table
|
||||||
* array. A completely 0 filled entry terminates the table.
|
* array. A completely 0 filled entry terminates the table.
|
||||||
|
* We are slowly deprecating this call so avoid its use.
|
||||||
*
|
*
|
||||||
* See __register_sysctl_table for more details.
|
* See __register_sysctl_table for more details.
|
||||||
*/
|
*/
|
||||||
@@ -1630,6 +1644,7 @@ err_register_leaves:
|
|||||||
*
|
*
|
||||||
* Register a sysctl table hierarchy. @table should be a filled in ctl_table
|
* Register a sysctl table hierarchy. @table should be a filled in ctl_table
|
||||||
* array. A completely 0 filled entry terminates the table.
|
* array. A completely 0 filled entry terminates the table.
|
||||||
|
* We are slowly deprecating this caller so avoid future uses of it.
|
||||||
*
|
*
|
||||||
* See __register_sysctl_paths for more details.
|
* See __register_sysctl_paths for more details.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user