diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-02-28 17:19:49 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-03-13 12:24:18 +0100 |
commit | 796967c3df40a51a9028bc83d1a4b6dbeae07c3f (patch) | |
tree | edd7251883f74506a69f76e6e9fbf173de195f50 /testsuites/libtests/block08/bdbuf_tests.h | |
parent | libblock: Documentation (diff) | |
download | rtems-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 'testsuites/libtests/block08/bdbuf_tests.h')
-rw-r--r-- | testsuites/libtests/block08/bdbuf_tests.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/testsuites/libtests/block08/bdbuf_tests.h b/testsuites/libtests/block08/bdbuf_tests.h index e8affa1cbc..ecd932fa4d 100644 --- a/testsuites/libtests/block08/bdbuf_tests.h +++ b/testsuites/libtests/block08/bdbuf_tests.h @@ -85,7 +85,7 @@ typedef struct bdbuf_test_msg { union { struct driver_req { - dev_t dev; + const rtems_disk_device *dd; uint32_t req; void *argp; } driver_req; @@ -152,7 +152,7 @@ typedef struct test_ctx { extern test_ctx g_test_ctx; /** Device ID used for testing */ -extern dev_t test_dev; +extern const rtems_disk_device *test_dd; /** * Create a message queue for test driver that is used for @@ -259,7 +259,7 @@ extern bool good_test_result; do { \ WAIT_DRV_MSG(msg_); \ if ((msg_)->val.driver_req.req != RTEMS_BLKIO_REQUEST || \ - (msg_)->val.driver_req.dev != test_dev || \ + (msg_)->val.driver_req.dd != test_dd || \ ((rtems_blkdev_request *) \ ((msg_)->val.driver_req.argp))->req != \ RTEMS_BLKDEV_REQ_WRITE) \ @@ -267,7 +267,7 @@ extern bool good_test_result; printk("Unexpected message received by disk driver: " \ "req - 0x%x (0x%x), dev - %d (%d)\n", \ (msg_)->val.driver_req.req, RTEMS_BLKIO_REQUEST, \ - (msg_)->val.driver_req.dev, test_dev); \ + (msg_)->val.driver_req.dd, test_dd); \ return; \ } \ } while (0) |