History

Merge tag 'libnvdimm-for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Pull libnvdimm updates from Dan Williams: - Improve the efficiency and performance of reading nvdimm-namespace labels. Reduce the amount of label data read at driver load time by a few orders of magnitude. Reduce heavyweight call-outs to platform-firmware routines. - Handle media errors located in the 'struct page' array stored on a persistent memory namespace. Let the kernel clear these errors rather than an awkward userspace workaround. - Fix Address Range Scrub (ARS) completion tracking. Correct occasions where the kernel indicates completion of ARS before submission. - Fix asynchronous device registration reference counting. - Add support for reporting an nvdimm dirty-shutdown-count via sysfs. - Fix various small libnvdimm core and uapi issues. * tag 'libnvdimm-for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: (21 commits) acpi, nfit: Further restrict userspace ARS start requests acpi, nfit: Fix Address Range Scrub completion tracking UAPI: ndctl: Remove use of PAGE_SIZE UAPI: ndctl: Fix g++-unsupported initialisation in headers tools/testing/nvdimm: Populate dirty shutdown data acpi, nfit: Collect shutdown status acpi, nfit: Introduce nfit_mem flags libnvdimm, label: Fix sparse warning nvdimm: Use namespace index data to reduce number of label reads needed nvdimm: Split label init out from the logic for getting config data nvdimm: Remove empty if statement nvdimm: Clarify comment in sizeof_namespace_index nvdimm: Sanity check labeloff libnvdimm, dimm: Maximize label transfer size libnvdimm, pmem: Fix badblocks population for 'raw' namespaces libnvdimm, namespace: Drop the repeat assignment for variable dev->parent libnvdimm, region: Fail badblocks listing for inactive regions libnvdimm, pfn: during init, clear errors in the metadata area libnvdimm: Set device node in nd_device_register libnvdimm: Hold reference on parent while scheduling async init ...

Linus Torvalds committed 8 years ago

Commit 6078e072 parents df132e4 594861220 files · +564 −217Browse files

Showing the changes to include/uapi/linux (1 of 20 files). Show all

Unified · Split

include/uapi/linux/ndctl.h+21−31
@@ -128,37 +128,31 @@ enum { · 127 unmodified lines
128128
129129 static inline const char *nvdimm_bus_cmd_name(unsigned cmd)
130130 {
131− static const char * const names[] = {
132− [ND_CMD_ARS_CAP] = "ars_cap",
133− [ND_CMD_ARS_START] = "ars_start",
134− [ND_CMD_ARS_STATUS] = "ars_status",
135− [ND_CMD_CLEAR_ERROR] = "clear_error",
136− [ND_CMD_CALL] = "cmd_call",
137− };
138−
139− if (cmd < ARRAY_SIZE(names) && names[cmd])
140− return names[cmd];
141− return "unknown";
131+ switch (cmd) {
132+ case ND_CMD_ARS_CAP: return "ars_cap";
133+ case ND_CMD_ARS_START: return "ars_start";
134+ case ND_CMD_ARS_STATUS: return "ars_status";
135+ case ND_CMD_CLEAR_ERROR: return "clear_error";
136+ case ND_CMD_CALL: return "cmd_call";
137+ default: return "unknown";
138+ }
142139 }
143140
144141 static inline const char *nvdimm_cmd_name(unsigned cmd)
145142 {
146− static const char * const names[] = {
147− [ND_CMD_SMART] = "smart",
148− [ND_CMD_SMART_THRESHOLD] = "smart_thresh",
149− [ND_CMD_DIMM_FLAGS] = "flags",
150− [ND_CMD_GET_CONFIG_SIZE] = "get_size",
151− [ND_CMD_GET_CONFIG_DATA] = "get_data",
152− [ND_CMD_SET_CONFIG_DATA] = "set_data",
153− [ND_CMD_VENDOR_EFFECT_LOG_SIZE] = "effect_size",
154− [ND_CMD_VENDOR_EFFECT_LOG] = "effect_log",
155− [ND_CMD_VENDOR] = "vendor",
156− [ND_CMD_CALL] = "cmd_call",
157− };
158−
159− if (cmd < ARRAY_SIZE(names) && names[cmd])
160− return names[cmd];
161− return "unknown";
143+ switch (cmd) {
144+ case ND_CMD_SMART: return "smart";
145+ case ND_CMD_SMART_THRESHOLD: return "smart_thresh";
146+ case ND_CMD_DIMM_FLAGS: return "flags";
147+ case ND_CMD_GET_CONFIG_SIZE: return "get_size";
148+ case ND_CMD_GET_CONFIG_DATA: return "get_data";
149+ case ND_CMD_SET_CONFIG_DATA: return "set_data";
150+ case ND_CMD_VENDOR_EFFECT_LOG_SIZE: return "effect_size";
151+ case ND_CMD_VENDOR_EFFECT_LOG: return "effect_log";
152+ case ND_CMD_VENDOR: return "vendor";
153+ case ND_CMD_CALL: return "cmd_call";
154+ default: return "unknown";
155+ }
162156 }
163157
164158 #define ND_IOCTL 'N'
@@ -208,10 +202,6 @@ enum nd_driver_flags { · 43 unmodified lines
208202 ND_DRIVER_DAX_PMEM = 1 << ND_DEVICE_DAX_PMEM,
209203 };
210204
211−enum {
212− ND_MIN_NAMESPACE_SIZE = PAGE_SIZE,
213−};
214−
215205 enum ars_masks {
216206 ARS_STATUS_MASK = 0x0000FFFF,
217207 ARS_EXT_STATUS_SHIFT = 16,