[rtems commit] libblock: New IO control RTEMS_BLKIO_GETDISKDEV

Joel Sherrill joel at rtems.org
Thu Mar 29 14:14:30 UTC 2012


Module:    rtems
Branch:    master
Commit:    14f738c8ed95aa6556303e7eec124d1e33bc03e4
Changeset: http://git.rtems.org/rtems/commit/?id=14f738c8ed95aa6556303e7eec124d1e33bc03e4

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Feb 28 13:03:15 2012 +0100

libblock: New IO control RTEMS_BLKIO_GETDISKDEV

---

 cpukit/libblock/include/rtems/blkdev.h |    1 +
 cpukit/libblock/src/blkdev.c           |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/cpukit/libblock/include/rtems/blkdev.h b/cpukit/libblock/include/rtems/blkdev.h
index e9fa86b..978e930 100644
--- a/cpukit/libblock/include/rtems/blkdev.h
+++ b/cpukit/libblock/include/rtems/blkdev.h
@@ -161,6 +161,7 @@ typedef struct rtems_blkdev_request {
 #define RTEMS_BLKIO_SYNCDEV         _IO('B', 6)
 #define RTEMS_BLKIO_DELETED         _IO('B', 7)
 #define RTEMS_BLKIO_CAPABILITIES    _IO('B', 8)
+#define RTEMS_BLKIO_GETDISKDEV      _IOR('B', 9, rtems_disk_device *)
 
 /** @} */
 
diff --git a/cpukit/libblock/src/blkdev.c b/cpukit/libblock/src/blkdev.c
index 10c14df..c986e69 100644
--- a/cpukit/libblock/src/blkdev.c
+++ b/cpukit/libblock/src/blkdev.c
@@ -211,6 +211,11 @@ rtems_blkdev_generic_ioctl(
             args->ioctl_return = (uint32_t) (rc == RTEMS_SUCCESSFUL ? 0 : -1);
             break;
 
+        case RTEMS_BLKIO_GETDISKDEV:
+            *((rtems_disk_device **) args->buffer) = dd;
+            args->ioctl_return = 0;
+            break;
+
         case RTEMS_BLKIO_REQUEST:
             /*
              * It is not allowed to directly access the driver circumventing




More information about the vc mailing list