diff options
author | Kuniyuki Iwashima <kuniyu@amazon.com> | 2024-07-31 13:07:17 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-08-03 22:38:44 +0100 |
commit | 768e4bb6a75e3c6a034df7c67edac20bd222857e (patch) | |
tree | dbf45faf8087ca30a2d44701ecd227122d8f1ec7 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 1ad001347fb1ca1f036144b42a6f1df6615e4104 (diff) |
net: Don't register pernet_operations if only one of id or size is specified.
We can allocate per-netns memory for struct pernet_operations by specifying
id and size.
register_pernet_operations() assigns an id to pernet_operations and later
ops_init() allocates the specified size of memory as net->gen->ptr[id].
If id is missing, no memory is allocated. If size is not specified,
pernet_operations just wastes an entry of net->gen->ptr[] for every netns.
net_generic is available only when both id and size are specified, so let's
ensure that.
While we are at it, we add const to both fields.
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions