RTEMS
5.1
|
Maps Blocks to the Media Interface Layers. More...
#include <errno.h>
#include <rtems/rfs/rtems-rfs-file-system-fwd.h>
#include <rtems/rfs/rtems-rfs-trace.h>
Go to the source code of this file.
Data Structures | |
struct | _rtems_rfs_buffer |
struct | rtems_rfs_buffer_handle_t |
Macros | |
#define | rtems_rfs_buffer_io_request rtems_rfs_buffer_deviceio_request |
#define | rtems_rfs_buffer_io_release rtems_rfs_buffer_deviceio_release |
#define | rtems_rfs_buffer_link(_h) (&(_h)->buffer->link) |
#define | rtems_rfs_buffer_data(_h) ((void*)((_h)->buffer->buffer)) |
#define | rtems_rfs_buffer_size(_h) ((_h)->buffer->size) |
#define | rtems_rfs_buffer_bnum(_h) ((_h)->bnum) |
#define | rtems_rfs_buffer_dirty(_h) ((_h)->dirty) |
#define | rtems_rfs_buffer_handle_has_block(_h) ((_h)->buffer ? true : false) |
#define | rtems_rfs_buffer_mark_dirty(_h) ((_h)->dirty = true) |
#define | rtems_rfs_buffer_refs(_h) ((_h)->buffer->references) |
#define | rtems_rfs_buffer_refs_up(_h) ((_h)->buffer->references += 1) |
#define | rtems_rfs_buffer_refs_down(_h) ((_h)->buffer->references -= 1) |
Typedefs | |
typedef uint32_t | rtems_rfs_buffer_block |
typedef struct _rtems_rfs_buffer | rtems_rfs_buffer |
typedef struct rtems_rfs_buffer_handle_t | rtems_rfs_buffer_handle |
Functions | |
int | rtems_rfs_buffer_deviceio_request (rtems_rfs_file_system *fs, rtems_rfs_buffer_block block, bool read, rtems_rfs_buffer *buffer) |
int | rtems_rfs_buffer_deviceio_release (rtems_rfs_buffer *handle, bool modified) |
int | rtems_rfs_buffer_handle_request (rtems_rfs_file_system *fs, rtems_rfs_buffer_handle *handle, rtems_rfs_buffer_block block, bool read) |
int | rtems_rfs_buffer_handle_release (rtems_rfs_file_system *fs, rtems_rfs_buffer_handle *handle) |
int | rtems_rfs_buffer_open (const char *name, rtems_rfs_file_system *fs) |
int | rtems_rfs_buffer_close (rtems_rfs_file_system *fs) |
int | rtems_rfs_buffer_sync (rtems_rfs_file_system *fs) |
int | rtems_rfs_buffer_setblksize (rtems_rfs_file_system *fs, uint32_t size) |
int | rtems_rfs_buffers_release (rtems_rfs_file_system *fs) |
Maps Blocks to the Media Interface Layers.
These functions map blocks to the media interface layers.
#define rtems_rfs_buffer_bnum | ( | _h | ) | ((_h)->bnum) |
Return the block number.
#define rtems_rfs_buffer_data | ( | _h | ) | ((void*)((_h)->buffer->buffer)) |
Return the start of the data area of the buffer given a handle.
#define rtems_rfs_buffer_dirty | ( | _h | ) | ((_h)->dirty) |
Return the buffer dirty status.
#define rtems_rfs_buffer_handle_has_block | ( | _h | ) | ((_h)->buffer ? true : false) |
Does the handle have a valid block attached ?
#define rtems_rfs_buffer_link | ( | _h | ) | (&(_h)->buffer->link) |
The buffer linkage.
#define rtems_rfs_buffer_mark_dirty | ( | _h | ) | ((_h)->dirty = true) |
Mark the buffer as dirty.
#define rtems_rfs_buffer_refs | ( | _h | ) | ((_h)->buffer->references) |
Return the reference count.
#define rtems_rfs_buffer_refs_down | ( | _h | ) | ((_h)->buffer->references -= 1) |
Decrement the reference count.
#define rtems_rfs_buffer_refs_up | ( | _h | ) | ((_h)->buffer->references += 1) |
Increment the reference count.
#define rtems_rfs_buffer_size | ( | _h | ) | ((_h)->buffer->size) |
Return the size of the buffer given a handle.
typedef uint32_t rtems_rfs_buffer_block |
Define the method used to interface to the buffers. It can be libblock or device I/O. The libblock interface is to the RTEMS cache and block devices and device I/O accesses the media via a device file handle.The RTEMS RFS I/O Layering.
typedef struct rtems_rfs_buffer_handle_t rtems_rfs_buffer_handle |
RFS Buffer handle.
int rtems_rfs_buffer_close | ( | rtems_rfs_file_system * | fs | ) |
Close the buffer interface.
[in] | fs | is the file system data. |
0 | Successful operation. |
error_code | An error occurred. |
int rtems_rfs_buffer_deviceio_release | ( | rtems_rfs_buffer * | handle, |
bool | modified | ||
) |
Release a buffer to the RTEMS libblock BD buffer cache.
int rtems_rfs_buffer_deviceio_request | ( | rtems_rfs_file_system * | fs, |
rtems_rfs_buffer_block | block, | ||
bool | read, | ||
rtems_rfs_buffer * | buffer | ||
) |
Request a buffer from the device I/O.
int rtems_rfs_buffer_handle_release | ( | rtems_rfs_file_system * | fs, |
rtems_rfs_buffer_handle * | handle | ||
) |
Release a buffer. If the buffer is dirty the buffer is written to disk. The result does not indicate if the data was successfully written to the disk as this operation may be performed in asynchronously to this release.
[in] | fs | is the file system data. |
[in] | handle | is the handle the requested buffer is attached to. |
0 | Successful operation. |
error_code | An error occurred. |
int rtems_rfs_buffer_handle_request | ( | rtems_rfs_file_system * | fs, |
rtems_rfs_buffer_handle * | handle, | ||
rtems_rfs_buffer_block | block, | ||
bool | read | ||
) |
Request a buffer. The buffer can be filled with data from the media (read == true) or you can request a buffer to fill with data.
[in] | fs | is the file system data. |
[in] | handle | is the handle the requested buffer is attached to. |
[in] | block | is the block number. |
[in] | read | Read the data from the disk. |
0 | Successful operation. |
error_code | An error occurred. |
int rtems_rfs_buffer_open | ( | const char * | name, |
rtems_rfs_file_system * | fs | ||
) |
Open the buffer interface.
[in] | name | is a pointer to the device name to the media. |
[in] | fs | is the file system data. |
0 | Successful operation. |
error_code | An error occurred. |
int rtems_rfs_buffer_setblksize | ( | rtems_rfs_file_system * | fs, |
uint32_t | size | ||
) |
Set the block size of the device.
[in] | fs | is the file system data. |
[in] | size | is the new block size. |
0 | Successful operation. |
error_code | An error occurred. |
int rtems_rfs_buffer_sync | ( | rtems_rfs_file_system * | fs | ) |
Sync all buffers to the media.
[in] | fs | is the file system data. |
0 | Successful operation. |
error_code | An error occurred. |
int rtems_rfs_buffers_release | ( | rtems_rfs_file_system * | fs | ) |
Release any chained buffers.
[in] | fs | is the file system data. |
0 | Successful operation. |
error_code | An error occurred. |