Subject: configfs: Create config_item from netconsole

From: Breno Leitao <[email-masked]>
Date: Thu, 28 Sep 2023 07:44:58 -0700

Right now there is a limitation in netconsole, where it is impossible to
disable or modify the target created from the command line parameter.
(netconsole=...).

"netconsole" cmdline parameter sets the remote IP, and if the remote IP
changes, the machine needs to be rebooted (with the new remote IP set in
the command line parameter).

I am planning to reuse the dynamic netconsole mechanism for
the 'command line' target, i.e., create a `cmdline` configfs_item for
the "command line" target, so, the user can modify the "command line"
target in configfs in runtime. Something as :

	echo 0 > /sys/kernel/config/netconsole/cmdline/enabled
	echo <new-IP> > /sys/kernel/config/netconsole/cmdline/remote_ip
	echo 1 > /sys/kernel/config/netconsole/cmdline/enabled

I didn't find a configfs API to register a configfs_item into a
config_group. Basically the make_item() callbacks are called once the
inode is created by the user at mkdir(2) time, but now I need to create
it at the driver initialization.

Should I create a configfs_register_item() to solve this problem?

Thanks!