RTEMS 6.1-rc6
|
#include <stdbool.h>
#include <stdint.h>
#include <errno.h>
#include <rtems/rfs/rtems-rfs-file-system.h>
#include <rtems/rfs/rtems-rfs-inode.h>
#include <rtems/rfs/rtems-rfs-mutex.h>
#include <rtems/libio_.h>
#include <rtems/fs.h>
Go to the source code of this file.
Data Structures | |
struct | rtems_rfs_rtems_private |
Macros | |
#define | RTEMS_RFS_RTEMS_ERROR 0 |
#define | RTEMS_RFS_RTEMS_TRACE 0 |
#define | rtems_rfs_rtems_error(_m, _e) (((errno = (_e)) == 0) ? 0 : -1) |
#define | RTEMS_RFS_RTEMS_DEBUG_ALL (0xffffffff) |
#define | RTEMS_RFS_RTEMS_DEBUG_ERROR_MSGS (1 << 0) |
#define | RTEMS_RFS_RTEMS_DEBUG_EVAL_PATH (1 << 1) |
#define | RTEMS_RFS_RTEMS_DEBUG_EVAL_FOR_MAKE (1 << 2) |
#define | RTEMS_RFS_RTEMS_DEBUG_EVAL_PERMS (1 << 3) |
#define | RTEMS_RFS_RTEMS_DEBUG_MKNOD (1 << 4) |
#define | RTEMS_RFS_RTEMS_DEBUG_RMNOD (1 << 5) |
#define | RTEMS_RFS_RTEMS_DEBUG_LINK (1 << 6) |
#define | RTEMS_RFS_RTEMS_DEBUG_UNLINK (1 << 7) |
#define | RTEMS_RFS_RTEMS_DEBUG_CHOWN (1 << 8) |
#define | RTEMS_RFS_RTEMS_DEBUG_READLINK (1 << 9) |
#define | RTEMS_RFS_RTEMS_DEBUG_FCHMOD (1 << 10) |
#define | RTEMS_RFS_RTEMS_DEBUG_STAT (1 << 11) |
#define | RTEMS_RFS_RTEMS_DEBUG_RENAME (1 << 12) |
#define | RTEMS_RFS_RTEMS_DEBUG_DIR_RMNOD (1 << 13) |
#define | RTEMS_RFS_RTEMS_DEBUG_FILE_OPEN (1 << 14) |
#define | RTEMS_RFS_RTEMS_DEBUG_FILE_CLOSE (1 << 15) |
#define | RTEMS_RFS_RTEMS_DEBUG_FILE_READ (1 << 16) |
#define | RTEMS_RFS_RTEMS_DEBUG_FILE_WRITE (1 << 17) |
#define | RTEMS_RFS_RTEMS_DEBUG_FILE_LSEEK (1 << 18) |
#define | RTEMS_RFS_RTEMS_DEBUG_FILE_FTRUNC (1 << 19) |
#define | rtems_rfs_rtems_trace(_m) (0) |
#define | rtems_rfs_rtems_trace_set_mask(_m) |
#define | rtems_rfs_rtems_trace_clear_mask(_m) |
#define | rtems_rfs_rtems_pathloc_dev(_loc) ((rtems_rfs_file_system*)((_loc)->mt_entry->fs_info)) |
#define | rtems_rfs_rtems_set_pathloc_ino(_loc, _ino) (_loc)->node_access = (void*)((intptr_t)(_ino)) |
#define | rtems_rfs_rtems_get_pathloc_ino(_loc) ((rtems_rfs_ino) (intptr_t)((_loc)->node_access)) |
#define | rtems_rfs_rtems_set_pathloc_doff(_loc, _doff) (_loc)->node_access_2 = (void*)((intptr_t)(_doff)) |
#define | rtems_rfs_rtems_get_pathloc_doff(_loc) ((uint32_t) (intptr_t)((_loc)->node_access_2)) |
#define | rtems_rfs_rtems_get_iop_ino(_iop) ((intptr_t)(_iop)->pathinfo.node_access) |
#define | rtems_rfs_rtems_get_iop_file_handle(_iop) ((rtems_rfs_file_handle*)(_iop)->pathinfo.node_access_2) |
#define | rtems_rfs_rtems_set_iop_file_handle(_iop, _fh) (_iop)->pathinfo.node_access_2 = (_fh) |
#define | rtems_rfs_rtems_handlers(_h) &rtems_rfs_rtems_ ## _h ## _handlers |
Typedefs | |
typedef struct rtems_rfs_rtems_private | rtems_rfs_rtems_private |
Functions | |
bool | rtems_rfs_rtems_set_handlers (rtems_filesystem_location_info_t *pathloc, rtems_rfs_inode_handle *inode) |
uint16_t | rtems_rfs_rtems_imode (mode_t mode) |
mode_t | rtems_rfs_rtems_mode (int imode) |
int | rtems_rfs_rtems_fstat (const rtems_filesystem_location_info_t *pathloc, struct stat *buf) |
int | rtems_rfs_rtems_rmnod (const rtems_filesystem_location_info_t *parent_pathloc, const rtems_filesystem_location_info_t *pathloc) |
int | rtems_rfs_rtems_fdatasync (rtems_libio_t *iop) |
Variables | |
const rtems_filesystem_file_handlers_r | rtems_rfs_rtems_dir_handlers |
const rtems_filesystem_file_handlers_r | rtems_rfs_rtems_device_handlers |
const rtems_filesystem_file_handlers_r | rtems_rfs_rtems_link_handlers |
const rtems_filesystem_file_handlers_r | rtems_rfs_rtems_file_handlers |
RTEMS File System RTEMS Header file.
This file is not to be installed. It binds the RFS file system to RTEMS.
#define RTEMS_RFS_RTEMS_DEBUG_ALL (0xffffffff) |
Trace message defines the RTEMS bindings of the RTEMS RFS. This is a development tool where can edit the values below to control the various trace output.
#define RTEMS_RFS_RTEMS_ERROR 0 |
RTEMS RFS RTEMS Error Enable. Set to 1 for printing of errors. Default is off.
#define rtems_rfs_rtems_error | ( | _m, | |
_e | |||
) | (((errno = (_e)) == 0) ? 0 : -1) |
If we are not handling errors provide a define that removes the strings from the code.
#define rtems_rfs_rtems_get_iop_file_handle | ( | _iop | ) | ((rtems_rfs_file_handle*)(_iop)->pathinfo.node_access_2) |
Get the file handle from the I/O pointer.
_iop | The I/O pointer. |
#define rtems_rfs_rtems_get_iop_ino | ( | _iop | ) | ((intptr_t)(_iop)->pathinfo.node_access) |
Get the ino from the I/O pointer.
[in] | _iop | is the I/O pointer. |
#define rtems_rfs_rtems_get_pathloc_doff | ( | _loc | ) | ((uint32_t) (intptr_t)((_loc)->node_access_2)) |
Get the directory offset (doff) given a path location.
[in] | _loc | is a pointer to the path location. |
#define rtems_rfs_rtems_get_pathloc_ino | ( | _loc | ) | ((rtems_rfs_ino) (intptr_t)((_loc)->node_access)) |
Get the inode number (ino) given a path location.
[in] | _loc | is a pointer to the path location. |
#define rtems_rfs_rtems_handlers | ( | _h | ) | &rtems_rfs_rtems_ ## _h ## _handlers |
Create the name of the handler's table given the type of handlers.
[in] | _h | is the name of the handlers. |
#define rtems_rfs_rtems_pathloc_dev | ( | _loc | ) | ((rtems_rfs_file_system*)((_loc)->mt_entry->fs_info)) |
Return the file system structure given a path location.
[in] | _loc | is a pointer to the path location. |
#define rtems_rfs_rtems_set_iop_file_handle | ( | _iop, | |
_fh | |||
) | (_iop)->pathinfo.node_access_2 = (_fh) |
Set the file handle in the I/O pointer.
[in] | _iop | is the I/O pointer. |
[in] | _fh | is the file handle. |
#define rtems_rfs_rtems_set_pathloc_doff | ( | _loc, | |
_doff | |||
) | (_loc)->node_access_2 = (void*)((intptr_t)(_doff)) |
Set the directory offset (doff) into the path location.
[in] | _loc | is a pointer to the path location. |
[in] | _doff | is the doff to set in the path location. |
#define rtems_rfs_rtems_set_pathloc_ino | ( | _loc, | |
_ino | |||
) | (_loc)->node_access = (void*)((intptr_t)(_ino)) |
Set the inode number (ino) into the path location.
[in] | _loc | is a pointer to the path location. |
[in] | _ino | is the ino to set in the path location. |
#define RTEMS_RFS_RTEMS_TRACE 0 |
RTEMS RFS RTEMS Trace Enable. Set to 1 for printing of errors. Default is off.
#define rtems_rfs_rtems_trace | ( | _m | ) | (0) |
Call to check if this part is bring traced. If RTEMS_RFS_RTEMS_TRACE is defined to 0 the code is dead code elminiated when built with -Os, -O2, or higher.
[in] | mask | is the part of the API to trace. |
true | Tracing is active for the mask. |
false | Do not trace. |
#define rtems_rfs_rtems_trace_clear_mask | ( | _m | ) |
Clear the mask.
[in] | mask | is the mask bits to clear. |
mask | The previous mask. |
#define rtems_rfs_rtems_trace_set_mask | ( | _m | ) |
Set the mask.
[in] | mask | is the mask bits to set. |
mask | The previous mask. |
typedef struct rtems_rfs_rtems_private rtems_rfs_rtems_private |
Add shell trace shell command. Private RFS RTEMS Port data.
int rtems_rfs_rtems_fdatasync | ( | rtems_libio_t * | iop | ) |
The following routine does a sync on an inode node. Currently it flushes everything related to this device.
iop |
The following routine does a sync on an inode node. Currently it flushes everything related to this device.
iop |
int rtems_rfs_rtems_fstat | ( | const rtems_filesystem_location_info_t * | pathloc, |
struct stat * | buf | ||
) |
The following routine does a stat on a node.
uint16_t rtems_rfs_rtems_imode | ( | mode_t | mode | ) |
Convert the system mode flags to inode mode flags.
[in] | mode | is the system mode flags. |
mode_t rtems_rfs_rtems_mode | ( | int | imode | ) |
Convert the inode mode flags to system mode flags.
[in] | imode | is the inode mode flags |
int rtems_rfs_rtems_rmnod | ( | const rtems_filesystem_location_info_t * | parent_pathloc, |
const rtems_filesystem_location_info_t * | pathloc | ||
) |
Routine to remove a node from the RFS file system.
parent_pathloc | |
pathloc |
Routine to remove a node from the RFS file system.
parent_pathloc | |
pathloc |
bool rtems_rfs_rtems_set_handlers | ( | rtems_filesystem_location_info_t * | pathloc, |
rtems_rfs_inode_handle * | inode | ||
) |
Set the handlers in the path location based on the mode of the inode.
[in] | loc | is a pointer to the path location to set the handlers in. |
[in] | inode | is the inode handle to check the mode of for the type of handlers. |
true | The handlers have been set. |
false | There are no handlers for the mode. |
|
extern |
The handlers.
|
extern |
Handler table for RFS link nodes