From 71cf3e9d2f67f8c73abf8677ed92cbcc4008928d Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 20 Feb 2013 13:30:43 +0100 Subject: libblock: Do resource allocation in one place All resource allocations take place in rtems_bdbuf_init() now. After rtems_bdbuf_init() no fatal errors can happen due to configuration errors or resource limits. This makes it easier to detect configuration errors for users. --- testsuites/fstests/fsbdpart01/init.c | 16 ---------------- testsuites/fstests/support/ramdisk_support.c | 17 ----------------- 2 files changed, 33 deletions(-) (limited to 'testsuites') diff --git a/testsuites/fstests/fsbdpart01/init.c b/testsuites/fstests/fsbdpart01/init.c index aea0da08d1..bf6719cd20 100644 --- a/testsuites/fstests/fsbdpart01/init.c +++ b/testsuites/fstests/fsbdpart01/init.c @@ -100,20 +100,6 @@ static void test_logical_disks(const char *const *rdax, bool exists) } } -static void initialize_swapout_task(void) -{ - int fd = open(rda, O_RDONLY); - int rv = 0; - - rtems_test_assert(fd >= 0); - - rv = rtems_disk_fd_sync(fd); - rtems_test_assert(rv == 0); - - rv = close(fd); - rtems_test_assert(rv == 0); -} - static void test_bdpart(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; @@ -128,8 +114,6 @@ static void test_bdpart(void) memset(&actual_format, 0, sizeof(actual_format)); memset(&actual_partitions [0], 0, sizeof(actual_partitions)); - initialize_swapout_task(); - rtems_resource_snapshot_take(&before); for (i = 0; i < PARTITION_COUNT; ++i) { diff --git a/testsuites/fstests/support/ramdisk_support.c b/testsuites/fstests/support/ramdisk_support.c index 17dbb67820..0b6b50d386 100644 --- a/testsuites/fstests/support/ramdisk_support.c +++ b/testsuites/fstests/support/ramdisk_support.c @@ -28,20 +28,6 @@ dev_t dev = 0; -static void initialize_swapout_task(void) -{ - int fd = open(RAMDISK_PATH, O_RDONLY); - int rv = 0; - - rtems_test_assert(fd >= 0); - - rv = rtems_disk_fd_sync(fd); - rtems_test_assert(rv == 0); - - rv = close(fd); - rtems_test_assert(rv == 0); -} - void init_ramdisk (void) { @@ -52,9 +38,6 @@ init_ramdisk (void) rc = ramdisk_register (RAMDISK_BLOCK_SIZE, RAMDISK_BLOCK_COUNT, false, RAMDISK_PATH, &dev); rtems_test_assert (rc == 0); - - - initialize_swapout_task(); } void -- cgit v1.2.3