[PATCH linux-next] sysctl: add comments to make the code more clear

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: xu xin <xu.xin16@xxxxxxxxxx>

Adding some comments for ctl_table is more clear.

Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
Signed-off-by: xu xin <xu.xin16@xxxxxxxxxx>
---
 include/linux/sysctl.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 180adf7da785..105b18a290c4 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -131,14 +131,14 @@ static inline void *proc_sys_poll_event(struct ctl_table_poll *poll)
 /* A sysctl table is an array of struct ctl_table: */
 struct ctl_table {
 	const char *procname;		/* Text ID for /proc/sys, or zero */
-	void *data;
-	int maxlen;
-	umode_t mode;
+	void *data;			/* a pointer to data for use by proc_handler */
+	int maxlen;			/* the maximum size in bytes of the data */
+	umode_t mode;			/* the file permissions for the /proc/sys file */
 	struct ctl_table *child;	/* Deprecated */
 	proc_handler *proc_handler;	/* Callback for text formatting */
-	struct ctl_table_poll *poll;
+	struct ctl_table_poll *poll;	/* Support for userspace poll() to watch for changes */
 	void *extra1;
-	void *extra2;
+	void *extra2;			/* extra pointers usually as minimum and maximum of data */
 } __randomize_layout;
 
 struct ctl_node {
-- 
2.25.1




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux