Skip to content

Commit e7d0340

Browse files
committed
ioctl: make IOCTL defines private
Don't expose these low level defines anymore. The library should provide all necessary functions/helpers. Signed-off-by: Daniel Wagner <[email protected]>
1 parent d3a745a commit e7d0340

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

libnvme/src/nvme/ioctl.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,6 @@ struct nvme_uring_cmd {
135135
__u32 rsvd2;
136136
};
137137

138-
#define NVME_IOCTL_ID _IO('N', 0x40)
139-
#define NVME_IOCTL_RESET _IO('N', 0x44)
140-
#define NVME_IOCTL_SUBSYS_RESET _IO('N', 0x45)
141-
#define NVME_IOCTL_RESCAN _IO('N', 0x46)
142-
143-
/* io_uring async commands: */
144-
#define NVME_URING_CMD_IO _IOWR('N', 0x80, struct nvme_uring_cmd)
145-
#define NVME_URING_CMD_IO_VEC _IOWR('N', 0x81, struct nvme_uring_cmd)
146-
#define NVME_URING_CMD_ADMIN _IOWR('N', 0x82, struct nvme_uring_cmd)
147-
#define NVME_URING_CMD_ADMIN_VEC _IOWR('N', 0x83, struct nvme_uring_cmd)
148-
149138
#endif /* _UAPI_LINUX_NVME_IOCTL_H */
150139

151140
#endif /* _LINUX_NVME_IOCTL_H */

libnvme/src/nvme/private.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <sys/socket.h>
1515
#include <sys/stat.h>
1616
#include <sys/types.h>
17+
#include <sys/ioctl.h>
1718
#include <ifaddrs.h>
1819

1920
#include <nvme/fabrics.h>
@@ -69,11 +70,22 @@ struct linux_passthru_cmd64 {
6970
__u64 result;
7071
};
7172

73+
#define NVME_IOCTL_ID _IO('N', 0x40)
74+
#define NVME_IOCTL_RESET _IO('N', 0x44)
75+
#define NVME_IOCTL_SUBSYS_RESET _IO('N', 0x45)
76+
#define NVME_IOCTL_RESCAN _IO('N', 0x46)
77+
7278
#define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct linux_passthru_cmd32)
7379
#define NVME_IOCTL_IO_CMD _IOWR('N', 0x43, struct linux_passthru_cmd32)
7480
#define NVME_IOCTL_ADMIN64_CMD _IOWR('N', 0x47, struct linux_passthru_cmd64)
7581
#define NVME_IOCTL_IO64_CMD _IOWR('N', 0x48, struct linux_passthru_cmd64)
7682

83+
/* io_uring async commands: */
84+
#define NVME_URING_CMD_IO _IOWR('N', 0x80, struct nvme_uring_cmd)
85+
#define NVME_URING_CMD_IO_VEC _IOWR('N', 0x81, struct nvme_uring_cmd)
86+
#define NVME_URING_CMD_ADMIN _IOWR('N', 0x82, struct nvme_uring_cmd)
87+
#define NVME_URING_CMD_ADMIN_VEC _IOWR('N', 0x83, struct nvme_uring_cmd)
88+
7789
struct nvme_log {
7890
int fd;
7991
int level;

0 commit comments

Comments
 (0)