[rtems commit] libblock: Add RTEMS_BLKIO_PURGEDEV
Sebastian Huber
sebh at rtems.org
Fri May 11 11:57:21 UTC 2012
Module: rtems
Branch: master
Commit: 84ab4fce2400709ebd1fac93a4b8e70e334f29a4
Changeset: http://git.rtems.org/rtems/commit/?id=84ab4fce2400709ebd1fac93a4b8e70e334f29a4
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri May 11 13:04:26 2012 +0200
libblock: Add RTEMS_BLKIO_PURGEDEV
---
cpukit/libblock/include/rtems/blkdev.h | 6 ++++++
cpukit/libblock/src/blkdev-ioctl.c | 4 ++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/cpukit/libblock/include/rtems/blkdev.h b/cpukit/libblock/include/rtems/blkdev.h
index c512380..85c22c1 100644
--- a/cpukit/libblock/include/rtems/blkdev.h
+++ b/cpukit/libblock/include/rtems/blkdev.h
@@ -162,6 +162,7 @@ typedef struct rtems_blkdev_request {
#define RTEMS_BLKIO_DELETED _IO('B', 7)
#define RTEMS_BLKIO_CAPABILITIES _IO('B', 8)
#define RTEMS_BLKIO_GETDISKDEV _IOR('B', 9, rtems_disk_device *)
+#define RTEMS_BLKIO_PURGEDEV _IO('B', 10)
/** @} */
@@ -204,6 +205,11 @@ static inline int rtems_disk_fd_sync(int fd)
return ioctl(fd, RTEMS_BLKIO_SYNCDEV);
}
+static inline int rtems_disk_fd_purge(int fd)
+{
+ return ioctl(fd, RTEMS_BLKIO_PURGEDEV);
+}
+
/**
* Only consecutive multi-sector buffer requests are supported.
*
diff --git a/cpukit/libblock/src/blkdev-ioctl.c b/cpukit/libblock/src/blkdev-ioctl.c
index 52f19b5..d775d1e 100644
--- a/cpukit/libblock/src/blkdev-ioctl.c
+++ b/cpukit/libblock/src/blkdev-ioctl.c
@@ -60,6 +60,10 @@ rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
*(rtems_disk_device **) argp = dd;
break;
+ case RTEMS_BLKIO_PURGEDEV:
+ rtems_bdbuf_purge_dev(dd);
+ break;
+
default:
errno = EINVAL;
rc = -1;
More information about the vc
mailing list