[PATCH 1/8] nvmet: add debugfs support
Hannes Reinecke
hare at suse.de
Tue Mar 26 04:55:55 PDT 2024
On 3/23/24 21:25, Sagi Grimberg wrote:
>> +int nvmet_debugfs_subsys_setup(struct nvmet_subsys *subsys)
>> +{
>> + int ret = 0;
>> +
>> + subsys->debugfs_dir = debugfs_create_dir(subsys->subsysnqn,
>> + nvmet_debugfs);
>> + if (IS_ERR(subsys->debugfs_dir)) {
>> + ret = PTR_ERR(subsys->debugfs_dir);
>> + subsys->debugfs_dir = NULL;
>> + }
>> + return ret;
>> +}
>> +
>> +void nvmet_debugfs_subsys_free(struct nvmet_subsys *subsys)
>> +{
>> + debugfs_remove_recursive(subsys->debugfs_dir);
>> +}
>
> The subsys setup/free look trivial enough to just open-code
> in the call-sites.
>
> The rest looks fine to me.
Agreed for the 'free' call, the setup call has to stay as it's
referring to the static dentry 'nvmet_debugfs', which I'd like
to keep private to 'debugfs.c'.
Cheers,
Hannes
More information about the Linux-nvme
mailing list