Date: Sun, 2 Dec 2018 23:12:27 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341409 - head/sbin/nvmecontrol Message-ID: <201812022312.wB2NCRqO037693@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Sun Dec 2 23:12:26 2018 New Revision: 341409 URL: https://svnweb.freebsd.org/changeset/base/341409 Log: Move common logpage routines into nvmecontrol.h For the upcoming move of vendor specific code into vendor specific files, make the common logpage routines global and move them to nvmecontrol.h. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18403 Modified: head/sbin/nvmecontrol/logpage.c head/sbin/nvmecontrol/nvmecontrol.h Modified: head/sbin/nvmecontrol/logpage.c ============================================================================== --- head/sbin/nvmecontrol/logpage.c Sun Dec 2 23:12:16 2018 (r341408) +++ head/sbin/nvmecontrol/logpage.c Sun Dec 2 23:12:26 2018 (r341409) @@ -53,16 +53,9 @@ SET_DECLARE(logpage, struct logpage_function); #define LOGPAGE_USAGE \ " nvmecontrol logpage <-p page_id> [-b] [-v vendor] [-x] <controller id|namespace id>\n" \ -#define DEFAULT_SIZE (4096) #define MAX_FW_SLOTS (7) -struct kv_name -{ - uint32_t key; - const char *name; -}; - -static const char * +const char * kv_lookup(const struct kv_name *kv, size_t kv_count, uint32_t key) { static char bad[32]; Modified: head/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.h Sun Dec 2 23:12:16 2018 (r341408) +++ head/sbin/nvmecontrol/nvmecontrol.h Sun Dec 2 23:12:26 2018 (r341409) @@ -69,6 +69,14 @@ struct logpage_function { } ; \ NVME_LOGPAGESET(unique ## _lpf) +#define DEFAULT_SIZE (4096) +struct kv_name { + uint32_t key; + const char *name; +}; + +const char *kv_lookup(const struct kv_name *kv, size_t kv_count, uint32_t key); + #define NVME_CTRLR_PREFIX "nvme" #define NVME_NS_PREFIX "ns"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812022312.wB2NCRqO037693>