summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-05-11 13:04:26 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-05-11 13:58:43 +0200
commit84ab4fce2400709ebd1fac93a4b8e70e334f29a4 (patch)
treed097ebc71f742c7c4a9356791e14987ee337ad6b
parentFilesystem: PR1893: Fix write and truncate handler (diff)
downloadrtems-84ab4fce2400709ebd1fac93a4b8e70e334f29a4.tar.bz2
libblock: Add RTEMS_BLKIO_PURGEDEV
-rw-r--r--cpukit/libblock/include/rtems/blkdev.h6
-rw-r--r--cpukit/libblock/src/blkdev-ioctl.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/cpukit/libblock/include/rtems/blkdev.h b/cpukit/libblock/include/rtems/blkdev.h
index c51238084b..85c22c1d5e 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 52f19b58a0..d775d1e833 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;