summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/block08/bdbuf_tests.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-02-28 17:19:49 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-03-13 12:24:18 +0100
commit796967c3df40a51a9028bc83d1a4b6dbeae07c3f (patch)
treeedd7251883f74506a69f76e6e9fbf173de195f50 /testsuites/libtests/block08/bdbuf_tests.c
parentlibblock: Documentation (diff)
downloadrtems-796967c3df40a51a9028bc83d1a4b6dbeae07c3f.tar.bz2
libblock: Change bdbuf API
The functions o rtems_bdbuf_get(), o rtems_bdbuf_read(), o rtems_bdbuf_syncdev(), and o rtems_bdbuf_purge_dev(), use now the disk device instead of the device identifier. This makes bdbuf independent of rtems_disk_obtain() and rtems_disk_release(). It is the responsiblity of the file system to obtain the disk device. This also reduces the overhead to get a buffer. The key for the AVL tree uses now the disk device instead of the device identifier. The pointer is interpreted as an unsigned integer. This reduces the memory overhead and makes the comparison operation a bit faster. Removed function rtems_bdbuf_purge_major(). This function was too destructive and could have unpredictable side effects.
Diffstat (limited to '')
-rw-r--r--testsuites/libtests/block08/bdbuf_tests.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/testsuites/libtests/block08/bdbuf_tests.c b/testsuites/libtests/block08/bdbuf_tests.c
index bc6b772fb2..f265a094c1 100644
--- a/testsuites/libtests/block08/bdbuf_tests.c
+++ b/testsuites/libtests/block08/bdbuf_tests.c
@@ -49,7 +49,7 @@ struct bdbuf_test_descr {
#define TEST_SEM_ATTRIBS RTEMS_DEFAULT_ATTRIBUTES
/** Device ID used for testing */
-dev_t test_dev = (dev_t)-1;
+const rtems_disk_device *test_dd = NULL;
/** Test result variable */
bool good_test_result = true;
@@ -108,6 +108,7 @@ run_bdbuf_tests()
rtems_disk_device *disk;
rtems_status_code sc;
dev_t dev = -1;
+ dev_t test_dev;
unsigned int i;
rtems_device_major_number major;
@@ -153,6 +154,13 @@ run_bdbuf_tests()
return;
}
+ test_dd = rtems_disk_obtain(test_dev);
+ if (test_dd == NULL)
+ {
+ printf("Failed to obtain %s disk\n", TEST_DISK_NAME);
+ return;
+ }
+
/*
* On initialization test disk device driver registers
* its RX message queue, so we just need to locate it.