#include <stdbool.h>
#include "linux/nvme_ioctl.h"
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#define NVME_IOCTL_TIMEOUT 120000 /* in milliseconds */
#include <sys/stat.h>
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-models.h"
#include "util/suffix.h"
#ifndef NVME_PRINT_H
#define NVME_PRINT_H
-#include "nvme.h"
#include <inttypes.h>
void d(unsigned char *buf, int len, int width, int group);
--- /dev/null
+#ifndef _NVME_PRIVATE_H
+#define _NVME_PRIVATE_H
+
+struct nvme_subsystem;
+struct nvme_ctrl;
+
+struct nvme_namespace {
+ char *name;
+ struct nvme_ctrl *ctrl;
+
+ unsigned nsid;
+ struct nvme_id_ns ns;
+};
+
+struct nvme_ctrl {
+ char *name;
+ char *path;
+ struct nvme_subsystem *subsys;
+
+ char *address;
+ char *transport;
+ char *state;
+ char *ana_state;
+ char *traddr;
+ char *trsvcid;
+ char *host_traddr;
+ char *host_iface;
+ char *hostnqn;
+ char *hostid;
+
+ struct nvme_id_ctrl id;
+
+ int nr_namespaces;
+ struct nvme_namespace *namespaces;
+};
+
+struct nvme_subsystem {
+ char *name;
+ char *subsysnqn;
+
+ int nr_ctrls;
+ struct nvme_ctrl *ctrls;
+
+ int nr_namespaces;
+ struct nvme_namespace *namespaces;
+};
+
+struct nvme_topology {
+ int nr_subsystems;
+ struct nvme_subsystem *subsystems;
+};
+
+void *mmap_registers(const char *dev);
+
+int scan_ctrl_namespace_filter(const struct dirent *d);
+int scan_namespace_filter(const struct dirent *d);
+int scan_ctrl_paths_filter(const struct dirent *d);
+int scan_ctrls_filter(const struct dirent *d);
+int scan_subsys_filter(const struct dirent *d);
+int scan_dev_filter(const struct dirent *d);
+
+int scan_subsystems(struct nvme_topology *t, const char *subsysnqn,
+ __u32 ns_instance, int nsid, char *dev_dir);
+void free_topology(struct nvme_topology *t);
+char *get_nvme_subsnqn(char *path);
+char *nvme_get_ctrl_attr(const char *path, const char *attr);
+
+int uuid_from_dmi(char *uuid);
+int uuid_from_systemd(char *uuid);
+
+#endif /* _NVME_PRIVATE_H */
#include <linux/socket.h>
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-ioctl.h"
#include <errno.h>
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-status.h"
static inline __u8 nvme_generic_status_to_errno(__u16 status)
#include <sys/stat.h>
#include "common.h"
+#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-ioctl.h"
#include "nvme-status.h"
#include "util/json.h"
#endif
#include "util/argconfig.h"
-#include "linux/nvme.h"
enum nvme_print_flags {
NORMAL = 0,
BINARY = 1 << 3, /* binary dump raw bytes */
};
-struct nvme_subsystem;
-struct nvme_ctrl;
-
-struct nvme_namespace {
- char *name;
- struct nvme_ctrl *ctrl;
-
- unsigned nsid;
- struct nvme_id_ns ns;
-};
-
-struct nvme_ctrl {
- char *name;
- char *path;
- struct nvme_subsystem *subsys;
-
- char *address;
- char *transport;
- char *state;
- char *ana_state;
- char *traddr;
- char *trsvcid;
- char *host_traddr;
- char *host_iface;
- char *hostnqn;
- char *hostid;
-
- struct nvme_id_ctrl id;
-
- int nr_namespaces;
- struct nvme_namespace *namespaces;
-};
-
-struct nvme_subsystem {
- char *name;
- char *subsysnqn;
-
- int nr_ctrls;
- struct nvme_ctrl *ctrls;
-
- int nr_namespaces;
- struct nvme_namespace *namespaces;
-};
-
-struct nvme_topology {
- int nr_subsystems;
- struct nvme_subsystem *subsystems;
-};
-
#define SYS_NVME "/sys/class/nvme"
void register_extension(struct plugin *plugin);
enum nvme_print_flags validate_output_format(const char *format);
int __id_ctrl(int argc, char **argv, struct command *cmd,
- struct plugin *plugin, void (*vs)(__u8 *vs, struct json_object *root));
+ struct plugin *plugin, void (*vs)(uint8_t *vs, struct json_object *root));
char *nvme_char_from_block(char *block);
-void *mmap_registers(const char *dev);
extern int current_index;
-int scan_ctrl_namespace_filter(const struct dirent *d);
-int scan_namespace_filter(const struct dirent *d);
-int scan_ctrl_paths_filter(const struct dirent *d);
-int scan_ctrls_filter(const struct dirent *d);
-int scan_subsys_filter(const struct dirent *d);
-int scan_dev_filter(const struct dirent *d);
-
-int scan_subsystems(struct nvme_topology *t, const char *subsysnqn,
- __u32 ns_instance, int nsid, char *dev_dir);
-void free_topology(struct nvme_topology *t);
-char *get_nvme_subsnqn(char *path);
-char *nvme_get_ctrl_attr(const char *path, const char *attr);
-
void *nvme_alloc(size_t len, bool *huge);
void nvme_free(void *p, bool huge);
-int uuid_from_dmi(char *uuid);
-int uuid_from_systemd(char *uuid);
-
unsigned long long elapsed_utime(struct timeval start_time,
struct timeval end_time);
#endif /* _NVME_H */
#include "common.h"
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-ioctl.h"
#include "plugin.h"
#include <sys/time.h>
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-ioctl.h"
#include "plugin.h"
#include "linux/nvme_ioctl.h"
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-ioctl.h"
#include "plugin.h"
#include "common.h"
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-ioctl.h"
#include "plugin.h"
#include "linux/nvme_ioctl.h"
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-ioctl.h"
#include "plugin.h"
#include <libgen.h>
#include <sys/stat.h>
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-status.h"
#include "nvme-ioctl.h"
#include <sys/ioctl.h>
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-ioctl.h"
#include "suffix.h"
#include "common.h"
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-ioctl.h"
#include "plugin.h"
#include "linux/nvme_ioctl.h"
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-ioctl.h"
#include "nvme-status.h"
#include <ctype.h>
#include "linux/nvme_ioctl.h"
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-ioctl.h"
#include "plugin.h"
#include "common.h"
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-ioctl.h"
#include "plugin.h"
#include "linux/nvme_ioctl.h"
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-ioctl.h"
#include "plugin.h"
#include "linux/nvme_ioctl.h"
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-ioctl.h"
#include "plugin.h"
#include "linux/nvme_ioctl.h"
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-ioctl.h"
#include "plugin.h"
#include "common.h"
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-ioctl.h"
#include "plugin.h"
#include "linux/nvme_ioctl.h"
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-print.h"
#include "nvme-ioctl.h"
#include "plugin.h"
#include <sys/stat.h>
#include "nvme.h"
+#include "linux/nvme.h"
+#include "nvme-private.h"
#include "nvme-ioctl.h"
#include "nvme-print.h"
#include "nvme-status.h"