History

nfit, libnvdimm: deprecate the generic SMART ioctl

The kernel's ND_IOCTL_SMART_THRESHOLD command is based on a payload definition that has become broken / out-of-sync with recent versions of the NVDIMM_FAMILY_INTEL definition. Deprecate the use of the ND_IOCTL_SMART_THRESHOLD command in favor of the ND_CMD_CALL approach taken by NVDIMM_FAMILY_{HPE,MSFT}, where we can manage the per-vendor variance in userspace. In a couple years, when the new scheme is widely deployed in userspace packages, the ND_IOCTL_SMART_THRESHOLD support can be removed. For now we prevent new binaries from compiling against the kernel header definitions, but kernel still compatible with old binaries. The libndctl.h [1] header is now the authoritative interface definition for NVDIMM SMART. [1]: https://github.com/pmem/ndctl Signed-off-by: Dan Williams <dan.j.williams@intel.com>

Dan Williams committed 8 years ago

Commit cdd77d31 parent ae64f9b4 files · +84 −71Browse files

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

Unified · Split

include/uapi/linux/ndctl.h+0−54
@@ -15,54 +15,6 @@ · 14 unmodified lines
1515
1616 #include <linux/types.h>
1717
18−struct nd_cmd_smart {
19− __u32 status;
20− __u8 data[128];
21−} __packed;
22−
23−#define ND_SMART_HEALTH_VALID (1 << 0)
24−#define ND_SMART_SPARES_VALID (1 << 1)
25−#define ND_SMART_USED_VALID (1 << 2)
26−#define ND_SMART_TEMP_VALID (1 << 3)
27−#define ND_SMART_CTEMP_VALID (1 << 4)
28−#define ND_SMART_ALARM_VALID (1 << 9)
29−#define ND_SMART_SHUTDOWN_VALID (1 << 10)
30−#define ND_SMART_VENDOR_VALID (1 << 11)
31−#define ND_SMART_SPARE_TRIP (1 << 0)
32−#define ND_SMART_TEMP_TRIP (1 << 1)
33−#define ND_SMART_CTEMP_TRIP (1 << 2)
34−#define ND_SMART_NON_CRITICAL_HEALTH (1 << 0)
35−#define ND_SMART_CRITICAL_HEALTH (1 << 1)
36−#define ND_SMART_FATAL_HEALTH (1 << 2)
37−
38−struct nd_smart_payload {
39− __u32 flags;
40− __u8 reserved0[4];
41− __u8 health;
42− __u8 spares;
43− __u8 life_used;
44− __u8 alarm_flags;
45− __u16 temperature;
46− __u16 ctrl_temperature;
47− __u8 reserved1[15];
48− __u8 shutdown_state;
49− __u32 vendor_size;
50− __u8 vendor_data[92];
51−} __packed;
52−
53−struct nd_cmd_smart_threshold {
54− __u32 status;
55− __u8 data[8];
56−} __packed;
57−
58−struct nd_smart_threshold_payload {
59− __u8 alarm_control;
60− __u8 reserved0;
61− __u16 temperature;
62− __u8 spares;
63− __u8 reserved[3];
64−} __packed;
65−
6618 struct nd_cmd_dimm_flags {
6719 __u32 status;
6820 __u32 flags;
@@ -211,12 +163,6 @@ static inline const char *nvdimm_cmd_name(unsigned cmd) · 142 unmodified lines
211163
212164 #define ND_IOCTL 'N'
213165
214−#define ND_IOCTL_SMART _IOWR(ND_IOCTL, ND_CMD_SMART,\
215− struct nd_cmd_smart)
216−
217−#define ND_IOCTL_SMART_THRESHOLD _IOWR(ND_IOCTL, ND_CMD_SMART_THRESHOLD,\
218− struct nd_cmd_smart_threshold)
219−
220166 #define ND_IOCTL_DIMM_FLAGS _IOWR(ND_IOCTL, ND_CMD_DIMM_FLAGS,\
221167 struct nd_cmd_dimm_flags)
222168