mirror of
https://github.com/torvalds/linux.git
synced 2026-10-31 20:24:02 +01:00
Add per-namespace debugfs directory support under the subsystem debugfs directory. Each enabled namespace gets a ns<nsid>/ directory created during nvmet_ns_enable() and removed during nvmet_ns_disable(). This provides the infrastructure for exposing namespace-specific debug information in subsequent patches. Reviewed-by: Daniel Wagner <dwagner@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Guixin Liu <kanie@linux.alibaba.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
48 lines
1.2 KiB
C
48 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* DebugFS interface for the NVMe target.
|
|
* Copyright (c) 2022-2024 Shadow
|
|
* Copyright (c) 2024 SUSE LLC
|
|
*/
|
|
#ifndef NVMET_DEBUGFS_H
|
|
#define NVMET_DEBUGFS_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
#ifdef CONFIG_NVME_TARGET_DEBUGFS
|
|
int nvmet_debugfs_subsys_setup(struct nvmet_subsys *subsys);
|
|
void nvmet_debugfs_subsys_free(struct nvmet_subsys *subsys);
|
|
int nvmet_debugfs_ctrl_setup(struct nvmet_ctrl *ctrl);
|
|
void nvmet_debugfs_ctrl_free(struct nvmet_ctrl *ctrl);
|
|
void nvmet_debugfs_ns_setup(struct nvmet_ns *ns);
|
|
void nvmet_debugfs_ns_free(struct nvmet_ns *ns);
|
|
|
|
int __init nvmet_init_debugfs(void);
|
|
void nvmet_exit_debugfs(void);
|
|
#else
|
|
static inline int nvmet_debugfs_subsys_setup(struct nvmet_subsys *subsys)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline void nvmet_debugfs_subsys_free(struct nvmet_subsys *subsys){}
|
|
|
|
static inline int nvmet_debugfs_ctrl_setup(struct nvmet_ctrl *ctrl)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline void nvmet_debugfs_ctrl_free(struct nvmet_ctrl *ctrl) {}
|
|
|
|
static inline void nvmet_debugfs_ns_setup(struct nvmet_ns *ns) {}
|
|
static inline void nvmet_debugfs_ns_free(struct nvmet_ns *ns) {}
|
|
|
|
static inline int __init nvmet_init_debugfs(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void nvmet_exit_debugfs(void) {}
|
|
|
|
#endif
|
|
|
|
#endif /* NVMET_DEBUGFS_H */
|