[PATCH] libblock: Do resource allocation in one place

Chris Johns chrisj at rtems.org
Thu Feb 21 02:56:03 UTC 2013


Sebastian Huber wrote:
>
> -  /*
> -   * Create the worker threads.
> -   */
> -  rtems_bdbuf_swapout_workers_open ();
> -

Why the need to move this to the bdbuf init ? The worker threads are 
part of the implementation of the swapout task. This abstraction is 
being removed.

>
>   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);
> -}

I do not understand why this call is needed. What is it working around ?

Chris



More information about the devel mailing list