Skip to content

Commit 2cb5c86

Browse files
committed
Merge tag 'sysctl-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl
Pull sysctl updates from Joel Granados: "No functional changes - additional testing is required for the rest of the pending changes. - New shared repo for sysctl maintenance - check-sysctl-docs adjustment for API changes by Thomas Weißschuh" * tag 'sysctl-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl: scripts: check-sysctl-docs: handle per-namespace sysctls ipc: remove linebreaks from arguments of __register_sysctl_table scripts: check-sysctl-docs: adapt to new API MAINTAINERS: Update sysctl tree location
2 parents bf3a69c + 4f1136a commit 2cb5c86

File tree

3 files changed

+34
-36
lines changed

3 files changed

+34
-36
lines changed

MAINTAINERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -17689,7 +17689,7 @@ M: Joel Granados <[email protected]>
1768917689
1769017690
1769117691
S: Maintained
17692-
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git sysctl-next
17692+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl.git sysctl-next
1769317693
F: fs/proc/proc_sysctl.c
1769417694
F: include/linux/sysctl.h
1769517695
F: kernel/sysctl-test.c

ipc/ipc_sysctl.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,7 @@ bool setup_ipc_sysctls(struct ipc_namespace *ns)
292292
tbl[i].data = NULL;
293293
}
294294

295-
ns->ipc_sysctls = __register_sysctl_table(&ns->ipc_set,
296-
"kernel", tbl,
295+
ns->ipc_sysctls = __register_sysctl_table(&ns->ipc_set, "kernel", tbl,
297296
ARRAY_SIZE(ipc_sysctls));
298297
}
299298
if (!ns->ipc_sysctls) {

scripts/check-sysctl-docs

+32-33
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Example invocation:
99
# scripts/check-sysctl-docs -vtable="kernel" \
1010
# Documentation/admin-guide/sysctl/kernel.rst \
11-
# $(git grep -l register_sysctl_)
11+
# $(git grep -l register_sysctl)
1212
#
1313
# Specify -vdebug=1 to see debugging information
1414

@@ -20,14 +20,10 @@ BEGIN {
2020
}
2121

2222
# The following globals are used:
23-
# children: maps ctl_table names and procnames to child ctl_table names
2423
# documented: maps documented entries (each key is an entry)
2524
# entries: maps ctl_table names and procnames to counts (so
2625
# enumerating the subkeys for a given ctl_table lists its
2726
# procnames)
28-
# files: maps procnames to source file names
29-
# paths: maps ctl_path names to paths
30-
# curpath: the name of the current ctl_path struct
3127
# curtable: the name of the current ctl_table struct
3228
# curentry: the name of the current proc entry (procname when parsing
3329
# a ctl_table, constructed path when parsing a ctl_path)
@@ -94,42 +90,23 @@ FNR == NR {
9490

9591
# Stage 2: process each file and find all sysctl tables
9692
BEGINFILE {
97-
delete children
9893
delete entries
99-
delete paths
100-
curpath = ""
10194
curtable = ""
10295
curentry = ""
96+
delete vars
10397
if (debug) print "Processing file " FILENAME
10498
}
10599

106-
/^static struct ctl_path/ {
107-
match($0, /static struct ctl_path ([^][]+)/, tables)
108-
curpath = tables[1]
109-
if (debug) print "Processing path " curpath
110-
}
111-
112-
/^static struct ctl_table/ {
113-
match($0, /static struct ctl_table ([^][]+)/, tables)
114-
curtable = tables[1]
100+
/^static( const)? struct ctl_table/ {
101+
match($0, /static( const)? struct ctl_table ([^][]+)/, tables)
102+
curtable = tables[2]
115103
if (debug) print "Processing table " curtable
116104
}
117105

118106
/^};$/ {
119-
curpath = ""
120107
curtable = ""
121108
curentry = ""
122-
}
123-
124-
curpath && /\.procname[\t ]*=[\t ]*".+"/ {
125-
match($0, /.procname[\t ]*=[\t ]*"([^"]+)"/, names)
126-
if (curentry) {
127-
curentry = curentry "/" names[1]
128-
} else {
129-
curentry = names[1]
130-
}
131-
if (debug) print "Setting path " curpath " to " curentry
132-
paths[curpath] = curentry
109+
delete vars
133110
}
134111

135112
curtable && /\.procname[\t ]*=[\t ]*".+"/ {
@@ -140,10 +117,32 @@ curtable && /\.procname[\t ]*=[\t ]*".+"/ {
140117
file[curentry] = FILENAME
141118
}
142119

143-
/\.child[\t ]*=/ {
144-
child = trimpunct($NF)
145-
if (debug) print "Linking child " child " to table " curtable " entry " curentry
146-
children[curtable][curentry] = child
120+
/register_sysctl.*/ {
121+
match($0, /register_sysctl(|_init|_sz)\("([^"]+)" *, *([^,)]+)/, tables)
122+
if (debug) print "Registering table " tables[3] " at " tables[2]
123+
if (tables[2] == table) {
124+
for (entry in entries[tables[3]]) {
125+
printentry(entry)
126+
}
127+
}
128+
}
129+
130+
/kmemdup.*/ {
131+
match($0, /([^ \t]+) *= *kmemdup\(([^,]+) *,/, names)
132+
if (debug) print "Found variable " names[1] " for table " names[2]
133+
if (names[2] in entries) {
134+
vars[names[1]] = names[2]
135+
}
136+
}
137+
138+
/__register_sysctl_table.*/ {
139+
match($0, /__register_sysctl_table\([^,]+, *"([^"]+)" *, *([^,]+)/, tables)
140+
if (debug) print "Registering variable table " tables[2] " at " tables[1]
141+
if (tables[1] == table && tables[2] in vars) {
142+
for (entry in entries[vars[tables[2]]]) {
143+
printentry(entry)
144+
}
145+
}
147146
}
148147

149148
END {

0 commit comments

Comments
 (0)