RTEMS 6.1-rc1
|
RTEMS File System Data. More...
#include <rtems/rfs/rtems-rfs-group.h>
Go to the source code of this file.
Data Structures | |
struct | _rtems_rfs_file_system |
Macros | |
#define | RTEMS_RFS_SB_OFFSET_MAGIC (0) |
#define | RTEMS_RFS_SB_MAGIC (0x28092001) |
#define | RTEMS_RFS_SB_OFFSET_VERSION (RTEMS_RFS_SB_OFFSET_MAGIC + 4) |
#define | RTEMS_RFS_SB_OFFSET_BLOCK_SIZE (RTEMS_RFS_SB_OFFSET_VERSION + 4) |
#define | RTEMS_RFS_SB_OFFSET_BLOCKS (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE + 4) |
#define | RTEMS_RFS_SB_OFFSET_BAD_BLOCKS (RTEMS_RFS_SB_OFFSET_BLOCKS + 4) |
#define | RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH (RTEMS_RFS_SB_OFFSET_BAD_BLOCKS + 4) |
#define | RTEMS_RFS_SB_OFFSET_GROUPS (RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH + 4) |
#define | RTEMS_RFS_SB_OFFSET_GROUP_BLOCKS (RTEMS_RFS_SB_OFFSET_GROUPS + 4) |
#define | RTEMS_RFS_SB_OFFSET_GROUP_INODES (RTEMS_RFS_SB_OFFSET_GROUP_BLOCKS + 4) |
#define | RTEMS_RFS_SB_OFFSET_INODE_SIZE (RTEMS_RFS_SB_OFFSET_GROUP_INODES + 4) |
#define | RTEMS_RFS_VERSION (0x00000000) |
#define | RTEMS_RFS_VERSION_MASK INT32_C(0x00000000) |
#define | RTEMS_RFS_ROOT_INO (1) |
#define | RTEMS_RFS_EMPTY_INO (0) |
#define | RTEMS_RFS_INODE_BLOCKS (5) |
#define | RTEMS_RFS_INODE_OVERHEAD_PERCENTAGE (1) |
#define | RTEMS_RFS_SUPERBLOCK_SIZE (1) |
#define | RTEMS_RFS_FS_MAX_HELD_BUFFERS (5) |
#define | RTEMS_RFS_FS_BITMAPS_HOLD (1 << 0) |
#define | RTEMS_RFS_FS_NO_LOCAL_CACHE (1 << 1) |
#define | RTEMS_RFS_FS_FORCE_OPEN (1 << 2) |
#define | RTEMS_RFS_FS_READ_ONLY (1 << 3) |
#define | rtems_rfs_fs_flags(_f) ((_f)->flags) |
#define | rtems_rfs_fs_release_bitmaps(_f) (!((_f)->flags & RTEMS_RFS_FS_BITMAPS_HOLD)) |
#define | rtems_rfs_fs_no_local_cache(_f) ((_f)->flags & RTEMS_RFS_FS_NO_LOCAL_CACHE) |
#define | rtems_rfs_fs_device(_fs) ((_fs)->device) |
#define | rtems_rfs_fs_blocks(_fs) ((_fs)->blocks) |
#define | rtems_rfs_fs_block_size(_fs) ((_fs)->block_size) |
#define | rtems_rfs_fs_inodes(_fs) ((_fs)->inodes) |
#define | rtems_rfs_fs_block(_fs, _grp, _blk) ((((_fs)->group_blocks) * (_grp)) + (_blk) + 1) |
#define | rtems_rfs_fs_media_blocks(_fs) ((_fs)->media_size) |
#define | rtems_rfs_fs_media_block_size(_fs) (1) |
#define | rtems_rfs_fs_max_name(_fs) ((_fs)->max_name_length) |
#define | rtems_rfs_fs_max_block_map_blocks(_fs) ((_fs)->block_map_doubly_blocks) |
#define | rtems_rfs_fs_user(_fs) ((_fs)->user) |
Typedefs | |
typedef uint64_t | rtems_rfs_pos |
typedef int64_t | rtems_rfs_pos_rel |
Functions | |
uint64_t | rtems_rfs_fs_size (rtems_rfs_file_system *fs) |
uint64_t | rtems_rfs_fs_media_size (rtems_rfs_file_system *fs) |
int | rtems_rfs_fs_open (const char *name, void *user, uint32_t flags, uint32_t max_held_buffers, rtems_rfs_file_system **fs) |
int | rtems_rfs_fs_close (rtems_rfs_file_system *fs) |
RTEMS File System Data.
RTEMS File System Data
This file defines the file system data.
#define RTEMS_RFS_EMPTY_INO (0) |
Empty inode number.
#define RTEMS_RFS_FS_BITMAPS_HOLD (1 << 0) |
Flags to control the file system. Do not release bitmaps when finished. Default is off so they are released.
Calculate a block in the file system given the group and the block within the group.
[in] | _fs | is a pointer to the file system. |
[in] | _grp | is the group. |
[in] | _blk | is the block within the group. |
The block size.
[in] | _fs | is a pointer to the file system. |
The size of the disk in blocks.
[in] | _fs | is a pointer to the file system. |
The disk device number.
[in] | _fs | is a pointer to the file system. |
#define rtems_rfs_fs_flags | ( | _f | ) | ((_f)->flags) |
Return the flags.
[in] | _fs | is a pointer to the file system. |
#define RTEMS_RFS_FS_FORCE_OPEN (1 << 2) |
Force open and ignore any errors.
The number of inodes.
[in] | _fs | is a pointer to the file system. |
Return the maximum number of blocks in a block map.
#define RTEMS_RFS_FS_MAX_HELD_BUFFERS (5) |
The maximum number of buffers held by the file system at any one time.
The maximum length of a name supported by the file system.
#define rtems_rfs_fs_media_block_size | ( | _fs | ) | (1) |
The media block size. This is the size of a block on disk. For a device I/O this value is 1.
[in] | _fs | is a pointer to the file system. |
The media size of the disk in media size blocks.
[in] | _fs | is a pointer to the file system. |
#define RTEMS_RFS_FS_NO_LOCAL_CACHE (1 << 1) |
Do not cache the buffers and release directly to the buffer support layer. The default is to hold buffers.
#define rtems_rfs_fs_no_local_cache | ( | _f | ) | ((_f)->flags & RTEMS_RFS_FS_NO_LOCAL_CACHE) |
Are the buffers locally cache or released back to the buffering layer ?
[in] | _fs | is a pointer to the file system. |
#define RTEMS_RFS_FS_READ_ONLY (1 << 3) |
Make the mount read-only. Currently not supported.
#define rtems_rfs_fs_release_bitmaps | ( | _f | ) | (!((_f)->flags & RTEMS_RFS_FS_BITMAPS_HOLD)) |
Should bitmap buffers be released when finished ?
[in] | _fs | is a pointer to the file system. |
#define RTEMS_RFS_INODE_BLOCKS (5) |
The number of blocks in the inode. This number effects the size of the inode and that effects the overhead of the inode tables in a group.
#define RTEMS_RFS_INODE_OVERHEAD_PERCENTAGE (1) |
The inode overhead is the percentage of space reserved for inodes. It is calculated as the percentage number of blocks in a group. The number of blocks in a group is the number of bits a block can hold.
#define RTEMS_RFS_ROOT_INO (1) |
The root inode number. Do not use 0 as this has special meaning in some Unix operating systems.
#define RTEMS_RFS_SB_OFFSET_MAGIC (0) |
Superblock offsets and values.
#define RTEMS_RFS_SUPERBLOCK_SIZE (1) |
Number of blocks in the superblock. Yes I know it is a superblock and not superblocks but if for any reason this needs to change it is handled.
#define RTEMS_RFS_VERSION (0x00000000) |
RFS Version Number.
#define RTEMS_RFS_VERSION_MASK INT32_C(0x00000000) |
RFS Version Number Mask. The mask determines which bits of the version number indicate compatility issues.
typedef uint64_t rtems_rfs_pos |
Absolute position. Make a 64bit value.
typedef int64_t rtems_rfs_pos_rel |
Relative position. Make a 64bit value.
int rtems_rfs_fs_close | ( | rtems_rfs_file_system * | fs | ) |
Close the file system.
[in] | fs | is the file system data. |
0 | Successful operation. |
-1 | Error. See errno |
uint64_t rtems_rfs_fs_media_size | ( | rtems_rfs_file_system * | fs | ) |
The size of the disk in bytes calculated from the media parameters..
[in] | fs | is a pointer to the file system. |
int rtems_rfs_fs_open | ( | const char * | name, |
void * | user, | ||
uint32_t | flags, | ||
uint32_t | max_held_buffers, | ||
rtems_rfs_file_system ** | fs | ||
) |
Open the file system given a file path.
[in] | name | is a pointer to the device to open. |
[in] | fs | is the file system data filled in by this call. |
[in] | user | is a pointer to the user data. |
[in] | flags | is a initial set of user flags for the file system. |
[in] | max_held_buffers | is the maximum number of buffers the RFS holds. |
0 | Successful operation. |
-1 | Error. See errno |
uint64_t rtems_rfs_fs_size | ( | rtems_rfs_file_system * | fs | ) |
Return the size of the disk in bytes.
[in] | fs | is a pointer to the file system. |