40#if !defined (_RTEMS_RFS_FILE_SYSTEM_H_)
41#define _RTEMS_RFS_FILE_SYSTEM_H_
48#define RTEMS_RFS_SB_OFFSET_MAGIC (0)
49#define RTEMS_RFS_SB_MAGIC (0x28092001)
50#define RTEMS_RFS_SB_OFFSET_VERSION (RTEMS_RFS_SB_OFFSET_MAGIC + 4)
51#define RTEMS_RFS_SB_OFFSET_BLOCK_SIZE (RTEMS_RFS_SB_OFFSET_VERSION + 4)
52#define RTEMS_RFS_SB_OFFSET_BLOCKS (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE + 4)
53#define RTEMS_RFS_SB_OFFSET_BAD_BLOCKS (RTEMS_RFS_SB_OFFSET_BLOCKS + 4)
54#define RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH (RTEMS_RFS_SB_OFFSET_BAD_BLOCKS + 4)
55#define RTEMS_RFS_SB_OFFSET_GROUPS (RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH + 4)
56#define RTEMS_RFS_SB_OFFSET_GROUP_BLOCKS (RTEMS_RFS_SB_OFFSET_GROUPS + 4)
57#define RTEMS_RFS_SB_OFFSET_GROUP_INODES (RTEMS_RFS_SB_OFFSET_GROUP_BLOCKS + 4)
58#define RTEMS_RFS_SB_OFFSET_INODE_SIZE (RTEMS_RFS_SB_OFFSET_GROUP_INODES + 4)
63#define RTEMS_RFS_VERSION (0x00000000)
69#define RTEMS_RFS_VERSION_MASK INT32_C(0x00000000)
75#define RTEMS_RFS_ROOT_INO (1)
80#define RTEMS_RFS_EMPTY_INO (0)
86#define RTEMS_RFS_INODE_BLOCKS (5)
93#define RTEMS_RFS_INODE_OVERHEAD_PERCENTAGE (1)
99#define RTEMS_RFS_SUPERBLOCK_SIZE (1)
104#define RTEMS_RFS_FS_MAX_HELD_BUFFERS (5)
119#define RTEMS_RFS_FS_BITMAPS_HOLD (1 << 0)
122#define RTEMS_RFS_FS_NO_LOCAL_CACHE (1 << 1)
126#define RTEMS_RFS_FS_FORCE_OPEN (1 << 2)
128#define RTEMS_RFS_FS_READ_ONLY (1 << 3)
159#if RTEMS_RFS_USE_LIBBLOCK
286#define rtems_rfs_fs_flags(_f) ((_f)->flags)
292#define rtems_rfs_fs_release_bitmaps(_f) (!((_f)->flags & RTEMS_RFS_FS_BITMAPS_HOLD))
299#define rtems_rfs_fs_no_local_cache(_f) ((_f)->flags & RTEMS_RFS_FS_NO_LOCAL_CACHE)
306#if RTEMS_RFS_USE_LIBBLOCK
307#define rtems_rfs_fs_device(_fs) ((_fs)->disk)
309#define rtems_rfs_fs_device(_fs) ((_fs)->device)
317#define rtems_rfs_fs_blocks(_fs) ((_fs)->blocks)
324#define rtems_rfs_fs_block_size(_fs) ((_fs)->block_size)
331#define rtems_rfs_fs_inodes(_fs) ((_fs)->inodes)
342#define rtems_rfs_fs_block(_fs, _grp, _blk) \
343 ((((_fs)->group_blocks) * (_grp)) + (_blk) + 1)
350#if RTEMS_RFS_USE_LIBBLOCK
351#define rtems_rfs_fs_media_blocks(_fs) ((_fs)->disk->size)
353#define rtems_rfs_fs_media_blocks(_fs) ((_fs)->media_size)
362#if RTEMS_RFS_USE_LIBBLOCK
363#define rtems_rfs_fs_media_block_size(_fs) ((_fs)->disk->media_block_size)
365#define rtems_rfs_fs_media_block_size(_fs) (1)
371#define rtems_rfs_fs_max_name(_fs) ((_fs)->max_name_length)
378#define rtems_rfs_fs_max_block_map_blocks(_fs) ((_fs)->block_map_doubly_blocks)
383#define rtems_rfs_fs_user(_fs) ((_fs)->user)
416 uint32_t max_held_buffers,
uint64_t rtems_rfs_fs_size(rtems_rfs_file_system *fs)
Definition: rtems-rfs-file-system.c:51
int rtems_rfs_fs_open(const char *name, void *user, uint32_t flags, uint32_t max_held_buffers, rtems_rfs_file_system **fs)
Definition: rtems-rfs-file-system.c:215
uint64_t rtems_rfs_fs_media_size(rtems_rfs_file_system *fs)
Definition: rtems-rfs-file-system.c:59
uint64_t rtems_rfs_pos
Definition: rtems-rfs-file-system.h:109
int rtems_rfs_fs_close(rtems_rfs_file_system *fs)
Definition: rtems-rfs-file-system.c:329
int64_t rtems_rfs_pos_rel
Definition: rtems-rfs-file-system.h:114
RTEMS File Systems Group Management.
Definition: rtems-rfs-file-system.h:135
uint32_t release_count
Definition: rtems-rfs-file-system.h:256
rtems_chain_control file_shares
Definition: rtems-rfs-file-system.h:273
uint32_t release_modified_count
Definition: rtems-rfs-file-system.h:267
size_t inodes_per_block
Definition: rtems-rfs-file-system.h:212
rtems_chain_control release
Definition: rtems-rfs-file-system.h:251
rtems_rfs_group * groups
Definition: rtems-rfs-file-system.h:192
uint32_t buffers_count
Definition: rtems-rfs-file-system.h:245
size_t blocks_per_block
Definition: rtems-rfs-file-system.h:217
size_t block_map_doubly_blocks
Definition: rtems-rfs-file-system.h:230
size_t block_map_singly_blocks
Definition: rtems-rfs-file-system.h:223
uint32_t max_held_buffers
Definition: rtems-rfs-file-system.h:235
size_t size
Definition: rtems-rfs-file-system.h:170
void * user
Definition: rtems-rfs-file-system.h:278
int device
Definition: rtems-rfs-file-system.h:157
size_t blocks
Definition: rtems-rfs-file-system.h:146
uint32_t flags
Definition: rtems-rfs-file-system.h:139
size_t group_blocks
Definition: rtems-rfs-file-system.h:202
uint32_t bad_blocks
Definition: rtems-rfs-file-system.h:182
int group_count
Definition: rtems-rfs-file-system.h:197
size_t block_size
Definition: rtems-rfs-file-system.h:152
uint32_t inodes
Definition: rtems-rfs-file-system.h:176
uint32_t max_name_length
Definition: rtems-rfs-file-system.h:187
rtems_chain_control release_modified
Definition: rtems-rfs-file-system.h:262
size_t group_inodes
Definition: rtems-rfs-file-system.h:207
rtems_chain_control buffers
Definition: rtems-rfs-file-system.h:240
Creates bit allocator for blocks in the group simpler.
Definition: rtems-rfs-group.h:71
Description of a disk device (logical and physical disks).
Definition: diskdevs.h:177
This union represents a chain control block.
Definition: chain.h:96