RTEMS CPU Kit with SuperCore
4.11.3
|
Block Device Buffer Management. More...
#include <rtems.h>
#include <rtems/libio.h>
#include <rtems/chain.h>
#include <rtems/blkdev.h>
#include <rtems/diskdevs.h>
Go to the source code of this file.
Data Structures | |
struct | rtems_bdbuf_buffer |
To manage buffers we using buffer descriptors (BD). More... | |
struct | rtems_bdbuf_buffer::rtems_bdbuf_avl_node |
struct | rtems_bdbuf_group |
A group is a continuous block of buffer descriptors. More... | |
struct | rtems_bdbuf_config |
Buffering configuration definition. More... | |
Macros | |
#define | RTEMS_BDBUF_MAX_READ_AHEAD_BLOCKS_DEFAULT 0 |
The default value for the maximum read-ahead blocks disables the read-ahead feature. | |
#define | RTEMS_BDBUF_MAX_WRITE_BLOCKS_DEFAULT 16 |
Default maximum number of blocks to write at once. | |
#define | RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT 15 |
Default swap-out task priority. | |
#define | RTEMS_BDBUF_SWAPOUT_TASK_SWAP_PERIOD_DEFAULT 250 |
Default swap-out task swap period in milli seconds. | |
#define | RTEMS_BDBUF_SWAPOUT_TASK_BLOCK_HOLD_DEFAULT 1000 |
Default swap-out task block hold time in milli seconds. | |
#define | RTEMS_BDBUF_SWAPOUT_WORKER_TASKS_DEFAULT 0 |
Default swap-out worker tasks. More... | |
#define | RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT |
Default swap-out worker task priority. More... | |
#define | RTEMS_BDBUF_READ_AHEAD_TASK_PRIORITY_DEFAULT RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT |
Default read-ahead task priority. More... | |
#define | RTEMS_BDBUF_TASK_STACK_SIZE_DEFAULT RTEMS_MINIMUM_STACK_SIZE |
Default task stack size for swap-out and worker tasks. | |
#define | RTEMS_BDBUF_CACHE_MEMORY_SIZE_DEFAULT (64 * 512) |
Default size of memory allocated to the cache. | |
#define | RTEMS_BDBUF_BUFFER_MIN_SIZE_DEFAULT (512) |
Default minimum size of buffers. | |
#define | RTEMS_BDBUF_BUFFER_MAX_SIZE_DEFAULT (4096) |
Default maximum size of buffers. | |
Typedefs | |
typedef struct rtems_bdbuf_group | rtems_bdbuf_group |
typedef struct rtems_bdbuf_buffer | rtems_bdbuf_buffer |
To manage buffers we using buffer descriptors (BD). More... | |
typedef struct rtems_bdbuf_config | rtems_bdbuf_config |
Buffering configuration definition. More... | |
Functions | |
rtems_status_code | rtems_bdbuf_init (void) |
Prepare buffering layer to work - initialize buffer descritors and (if it is neccessary) buffers. More... | |
rtems_status_code | rtems_bdbuf_get (rtems_disk_device *dd, rtems_blkdev_bnum block, rtems_bdbuf_buffer **bd) |
Get block buffer for data to be written into. More... | |
rtems_status_code | rtems_bdbuf_read (rtems_disk_device *dd, rtems_blkdev_bnum block, rtems_bdbuf_buffer **bd) |
Get the block buffer and if not already in the cache read from the disk. More... | |
rtems_status_code | rtems_bdbuf_release (rtems_bdbuf_buffer *bd) |
Release the buffer obtained by a read call back to the cache. More... | |
rtems_status_code | rtems_bdbuf_release_modified (rtems_bdbuf_buffer *bd) |
Release the buffer allocated with a get or read call placing it on the modified list. More... | |
rtems_status_code | rtems_bdbuf_sync (rtems_bdbuf_buffer *bd) |
Release the buffer as modified and wait until it has been synchronized with the disk by writing it. More... | |
rtems_status_code | rtems_bdbuf_syncdev (rtems_disk_device *dd) |
Synchronize all modified buffers for this device with the disk and wait until the transfers have completed. More... | |
void | rtems_bdbuf_purge_dev (rtems_disk_device *dd) |
Purges all buffers corresponding to the disk device dd. More... | |
rtems_status_code | rtems_bdbuf_set_block_size (rtems_disk_device *dd, uint32_t block_size, bool sync) |
Sets the block size of a disk device. More... | |
void | rtems_bdbuf_get_device_stats (const rtems_disk_device *dd, rtems_blkdev_stats *stats) |
Returns the block device statistics. | |
void | rtems_bdbuf_reset_device_stats (rtems_disk_device *dd) |
Resets the block device statistics. | |
Variables | |
const rtems_bdbuf_config | rtems_bdbuf_configuration |
External reference to the configuration. More... | |
Block Device Buffer Management.