]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sparc64: modify sys_dax.h for new libdax
authorJonathan Helman <jonathan.helman@oracle.com>
Thu, 27 Apr 2017 16:11:10 +0000 (09:11 -0700)
committerShannon Nelson <shannon.nelson@oracle.com>
Wed, 31 May 2017 23:43:47 +0000 (16:43 -0700)
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 <jonathan.helman@oracle.com>
Reviewed-by: Shannon Nelson <shannon.nelson@oracle.com>
Reviewed-by: Sanath Kumar <sanath.s.kumar@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
arch/sparc/dax/dax_main.c
arch/sparc/dax/sys_dax.h

index 5dfb8bbd37c26e53490a21464d5db3409eb9c354..0c3536e1e86c73ee574a6fee5d8074cb54fbc614 100644 (file)
@@ -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:
index 8f180991e882ddb383d1922ffa6ec421b7b4de1f..7e0cd36711cf2664107c2f1ead7ddc93b7340309 100644 (file)
@@ -7,11 +7,6 @@
 #ifndef _SYS_DAX_H
 #define _SYS_DAX_H
 
-#ifdef __KERNEL__
-#include "ccb.h"
-#else
-#include <ccb.h>
-#endif
 #include <linux/types.h>
 
 /* DAXIOC_CCB_EXEC dce_ccb_status */
 #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;
 };