Changeset View
Changeset View
Standalone View
Standalone View
head/sbin/nvmecontrol/identify.c
Show First 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | for (i = 0; i <= nsdata->nlbaf; i++) { | ||||
printf("LBA Format #%02d: Data Size: %5d Metadata Size: %5d" | printf("LBA Format #%02d: Data Size: %5d Metadata Size: %5d" | ||||
" Performance: %s\n", | " Performance: %s\n", | ||||
i, 1 << lbads, ms, (rp == 0) ? "Best" : | i, 1 << lbads, ms, (rp == 0) ? "Best" : | ||||
(rp == 1) ? "Better" : (rp == 2) ? "Good" : "Degraded"); | (rp == 1) ? "Better" : (rp == 2) ? "Good" : "Degraded"); | ||||
} | } | ||||
} | } | ||||
static void | static void | ||||
identify_ctrlr(struct nvme_function *nf, int argc, char *argv[]) | identify_ctrlr(const struct nvme_function *nf, int argc, char *argv[]) | ||||
{ | { | ||||
struct nvme_controller_data cdata; | struct nvme_controller_data cdata; | ||||
int ch, fd, hexflag = 0, hexlength; | int ch, fd, hexflag = 0, hexlength; | ||||
int verboseflag = 0; | int verboseflag = 0; | ||||
while ((ch = getopt(argc, argv, "vx")) != -1) { | while ((ch = getopt(argc, argv, "vx")) != -1) { | ||||
switch ((char)ch) { | switch ((char)ch) { | ||||
case 'v': | case 'v': | ||||
Show All 30 Lines | if (verboseflag == 1) { | ||||
usage(nf); | usage(nf); | ||||
} | } | ||||
nvme_print_controller(&cdata); | nvme_print_controller(&cdata); | ||||
exit(0); | exit(0); | ||||
} | } | ||||
static void | static void | ||||
identify_ns(struct nvme_function *nf,int argc, char *argv[]) | identify_ns(const struct nvme_function *nf,int argc, char *argv[]) | ||||
{ | { | ||||
struct nvme_namespace_data nsdata; | struct nvme_namespace_data nsdata; | ||||
char path[64]; | char path[64]; | ||||
int ch, fd, hexflag = 0, hexlength; | int ch, fd, hexflag = 0, hexlength; | ||||
int verboseflag = 0; | int verboseflag = 0; | ||||
uint32_t nsid; | uint32_t nsid; | ||||
while ((ch = getopt(argc, argv, "vx")) != -1) { | while ((ch = getopt(argc, argv, "vx")) != -1) { | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | if (verboseflag == 1) { | ||||
usage(nf); | usage(nf); | ||||
} | } | ||||
print_namespace(&nsdata); | print_namespace(&nsdata); | ||||
exit(0); | exit(0); | ||||
} | } | ||||
static void | static void | ||||
identify(struct nvme_function *nf, int argc, char *argv[]) | identify(const struct nvme_function *nf, int argc, char *argv[]) | ||||
{ | { | ||||
char *target; | char *target; | ||||
if (argc < 2) | if (argc < 2) | ||||
usage(nf); | usage(nf); | ||||
while (getopt(argc, argv, "vx") != -1) ; | while (getopt(argc, argv, "vx") != -1) ; | ||||
Show All 20 Lines |