Changeset View
Changeset View
Standalone View
Standalone View
sbin/nvmecontrol/devlist.c
Show All 39 Lines | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#include "nvmecontrol.h" | #include "nvmecontrol.h" | ||||
#define DEVLIST_USAGE \ | #define DEVLIST_USAGE \ | ||||
"devlist\n" | "devlist\n" | ||||
#define DEVLIST_DESCR \ | |||||
"Display a list of NVMe controllers and namespaces." | |||||
#define NVME_MAX_UNIT 256 | #define NVME_MAX_UNIT 256 | ||||
static inline uint32_t | static inline uint32_t | ||||
ns_get_sector_size(struct nvme_namespace_data *nsdata) | ns_get_sector_size(struct nvme_namespace_data *nsdata) | ||||
{ | { | ||||
uint8_t flbas_fmt, lbads; | uint8_t flbas_fmt, lbads; | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | devlist(const struct nvme_function *nf, int argc, char *argv[]) | ||||
} | } | ||||
if (found == 0) | if (found == 0) | ||||
printf("No NVMe controllers found.\n"); | printf("No NVMe controllers found.\n"); | ||||
exit(1); | exit(1); | ||||
} | } | ||||
NVME_COMMAND(top, devlist, devlist, DEVLIST_USAGE); | NVME_COMMAND(top, devlist, devlist, DEVLIST_USAGE, NULL, DEVLIST_DESCR); |