NVME(4): Add NVME_GET_NAMESPACE IO control

Update #3821.
This commit is contained in:
Sebastian Huber 2019-09-20 14:00:43 +02:00
parent eb4dcdf76d
commit 6735da1a70
2 changed files with 8 additions and 0 deletions

View File

@ -44,6 +44,9 @@
#define NVME_PASSTHROUGH_CMD _IOWR('n', 0, struct nvme_pt_command)
#define NVME_RESET_CONTROLLER _IO('n', 1)
#define NVME_GET_NSID _IOR('n', 2, struct nvme_get_nsid)
#ifdef __rtems__
#define NVME_GET_NAMESPACE _IOR('n', 10, struct nvme_namespace *)
#endif /* __rtems__ */
#define NVME_IO_TEST _IOWR('n', 100, struct nvme_io_test)
#define NVME_BIO_TEST _IOWR('n', 101, struct nvme_io_test)

View File

@ -96,6 +96,11 @@ nvme_ns_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int flag,
gnsid->nsid = ns->id;
break;
}
#ifdef __rtems__
case NVME_GET_NAMESPACE:
*(struct nvme_namespace **)arg = ns;
break;
#endif /* __rtems__ */
case DIOCGMEDIASIZE:
*(off_t *)arg = (off_t)nvme_ns_get_size(ns);
break;