From: Jonathan Helman Date: Thu, 27 Apr 2017 16:11:10 +0000 (-0700) Subject: sparc64: modify sys_dax.h for new libdax X-Git-Tag: v4.1.12-102.0.20170530_1700~29 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=04f4ebc92e1754ea4a287c189765c5f96044b1e7;p=users%2Fjedix%2Flinux-maple.git sparc64: modify sys_dax.h for new libdax Orabug: 25927572 Modify sys_dax.h such that new libdax can be compiled by including this file unmodified. Userspace does not have u16, u32, etc. types defined and as stated in Section 5e of Documentation/CodingStyle, we should be using __u16, __u32, etc. in the ioctl structures which are exported to userspace. Further, rename the DAXIOC_DEP_[number] ioctls and use DAXIOC_[name]_OLD instead. Signed-off-by: Jonathan Helman Reviewed-by: Shannon Nelson Reviewed-by: Sanath Kumar Signed-off-by: Allen Pais --- diff --git a/arch/sparc/dax/dax_main.c b/arch/sparc/dax/dax_main.c index 5dfb8bbd37c26..0c3536e1e86c7 100644 --- a/arch/sparc/dax/dax_main.c +++ b/arch/sparc/dax/dax_main.c @@ -298,9 +298,13 @@ static long dax_ioctl(struct file *f, unsigned int cmd, unsigned long arg) sizeof(dax_version))) return -EFAULT; return 0; - case DAXIOC_DEP_1: - case DAXIOC_DEP_3: - case DAXIOC_DEP_4: + case DAXIOC_CCB_THR_INIT_OLD: + case DAXIOC_CA_DEQUEUE_OLD: + case DAXIOC_CCB_EXEC_OLD: + case PERFCOUNT_GET_NODE_COUNT_OLD: + case PERFCOUNT_DAX_SET_COUNTERS_OLD: + case PERFCOUNT_DAX_GET_COUNTERS_OLD: + case PERFCOUNT_DAX_CLEAR_COUNTERS_OLD: dax_err("Old driver API not supported"); return -ENOTTY; default: diff --git a/arch/sparc/dax/sys_dax.h b/arch/sparc/dax/sys_dax.h index 8f180991e882d..7e0cd36711cf2 100644 --- a/arch/sparc/dax/sys_dax.h +++ b/arch/sparc/dax/sys_dax.h @@ -7,11 +7,6 @@ #ifndef _SYS_DAX_H #define _SYS_DAX_H -#ifdef __KERNEL__ -#include "ccb.h" -#else -#include -#endif #include /* DAXIOC_CCB_EXEC dce_ccb_status */ @@ -40,9 +35,13 @@ #define DAXIOC 'D' /* Deprecated IOCTL numbers */ -#define DAXIOC_DEP_1 _IOWR(DAXIOC, 1, struct dax_ccb_thr_init_arg) -#define DAXIOC_DEP_3 _IOWR(DAXIOC, 3, struct dax_ca_dequeue_arg) -#define DAXIOC_DEP_4 _IOWR(DAXIOC, 4, struct dax_ccb_exec_arg) +#define DAXIOC_CCB_THR_INIT_OLD _IOWR(DAXIOC, 1, struct dax_ccb_thr_init_arg) +#define DAXIOC_CA_DEQUEUE_OLD _IOWR(DAXIOC, 3, struct dax_ca_dequeue_arg) +#define DAXIOC_CCB_EXEC_OLD _IOWR(DAXIOC, 4, struct dax_ccb_exec_arg) +#define PERFCOUNT_GET_NODE_COUNT_OLD _IOR('p', 0xB0, void *) +#define PERFCOUNT_DAX_SET_COUNTERS_OLD _IOW('p', 0xBA, void *) +#define PERFCOUNT_DAX_GET_COUNTERS_OLD _IOR('p', 0xBB, void *) +#define PERFCOUNT_DAX_CLEAR_COUNTERS_OLD _IOW('p', 0xBC, void *) /* CCB thread initialization */ #define DAXIOC_CCB_THR_INIT _IOWR(DAXIOC, 6, struct dax_ccb_thr_init_arg) @@ -70,9 +69,9 @@ * dcti_compl_mapoff - return u64 mmap offset */ struct dax_ccb_thr_init_arg { - u32 dcti_ccb_buf_maxlen; - u64 dcti_compl_maplen; - u64 dcti_compl_mapoff; + __u32 dcti_ccb_buf_maxlen; + __u64 dcti_compl_maplen; + __u64 dcti_compl_mapoff; }; /* @@ -86,12 +85,12 @@ struct dax_ccb_thr_init_arg { * dce_nomap_va : bad virtual address when ret is NOMAP or NOACCESS */ struct dax_ccb_exec_arg { - u32 dce_ccb_buf_len; + __u32 dce_ccb_buf_len; void *dce_ccb_buf_addr; - u32 dce_submitted_ccb_buf_len; - u64 dce_ca_region_off; - u32 dce_ccb_status; - u64 dce_nomap_va; + __u32 dce_submitted_ccb_buf_len; + __u64 dce_ca_region_off; + __u32 dce_ccb_status; + __u64 dce_nomap_va; }; /* @@ -100,8 +99,8 @@ struct dax_ccb_exec_arg { * dcd_len_dequeued : byte len of CAs dequeued by the driver */ struct dax_ca_dequeue_arg { - u32 dcd_len_requested; - u32 dcd_len_dequeued; + __u32 dcd_len_requested; + __u32 dcd_len_dequeued; };