]> www.infradead.org Git - users/dwmw2/linux.git/commit
netconsole: Helper to count number of used entries
authorBreno Leitao <leitao@debian.org>
Thu, 6 Feb 2025 11:05:54 +0000 (03:05 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Feb 2025 15:04:18 +0000 (15:04 +0000)
commit563fe939a81ab08198b78dc8451ef3090969f30b
treed45c4d99f1a3370738db64c0f81f5117acac2f00
parent4205f6495eea62c7f4042346e045e4ac706e1830
netconsole: Helper to count number of used entries

Add a helper function nr_extradata_entries() to count the number of used
extradata entries in a netconsole target. This refactors the duplicate
code for counting entries into a single function, which will be reused
by upcoming CPU sysdata changes.

The helper uses list_count_nodes() to count the number of children in
the userdata group configfs hierarchy.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netconsole.c