41#if !defined (_RTEMS_RFS_BLOCK_H_)
42#define _RTEMS_RFS_BLOCK_H_
57#define rtems_rfs_block_get_number(_h, _b) \
58 ((rtems_rfs_block_no) \
59 (rtems_rfs_read_u32 (rtems_rfs_buffer_data (_h) + \
60 ((_b) * sizeof (rtems_rfs_block_no)))))
70#define rtems_rfs_block_set_number(_h, _b, _n) \
72 rtems_rfs_write_u32 (rtems_rfs_buffer_data (_h) + \
73 ((_b) * sizeof (rtems_rfs_block_no)), (_n)); \
74 rtems_rfs_buffer_mark_dirty (_h); \
170#define rtems_rfs_block_map_is_dirty(_m) ((_m)->dirty)
175#define rtems_rfs_block_map_count(_m) ((_m)->size.count)
180#define rtems_rfs_block_map_size(_m) (&((_m)->size))
185#define rtems_rfs_block_map_size_offset(_m) ((_m)->size.offset)
190#define rtems_rfs_block_map_last(_m) \
191 rtems_rfs_block_pos_last_block (&(_m)->bpos, &(_m)->size)
196#define rtems_rfs_block_map_past_end(_m, _p) \
197 rtems_rfs_block_pos_past_end (_p, &(_m)->size)
202#define rtems_rfs_block_map_pos(_f, _m) \
203 rtems_rfs_block_get_pos (_f, &(_m)->bpos)
208#define rtems_rfs_block_map_block(_m) ((_m)->bpos.bno)
213#define rtems_rfs_block_map_block_offset(_m) ((_m)->bpos.boff)
225 map->size.offset = offset;
RTEMS File Systems Block Position and Size Management.
#define rtems_rfs_block_copy_size(_lhs, _rhs)
Definition: rtems-rfs-block-pos.h:182
rtems_rfs_inode_block rtems_rfs_block_no
Definition: rtems-rfs-block-pos.h:58
uint32_t rtems_rfs_block_off
Definition: rtems-rfs-block-pos.h:63
int rtems_rfs_block_map_seek(rtems_rfs_file_system *fs, rtems_rfs_block_map *map, rtems_rfs_pos_rel offset, rtems_rfs_buffer_block *block)
Definition: rtems-rfs-block.c:352
int rtems_rfs_block_map_shrink(rtems_rfs_file_system *fs, rtems_rfs_block_map *map, size_t blocks)
Definition: rtems-rfs-block.c:668
int rtems_rfs_block_map_free_all(rtems_rfs_file_system *fs, rtems_rfs_block_map *map)
Definition: rtems-rfs-block.c:815
int rtems_rfs_block_map_find(rtems_rfs_file_system *fs, rtems_rfs_block_map *map, rtems_rfs_block_pos *bpos, rtems_rfs_buffer_block *block)
Definition: rtems-rfs-block.c:252
int rtems_rfs_block_map_open(rtems_rfs_file_system *fs, rtems_rfs_inode_handle *inode, rtems_rfs_block_map *map)
Definition: rtems-rfs-block.c:114
struct rtems_rfs_block_map_s rtems_rfs_block_map
int rtems_rfs_block_map_next_block(rtems_rfs_file_system *fs, rtems_rfs_block_map *map, rtems_rfs_buffer_block *block)
Definition: rtems-rfs-block.c:364
int rtems_rfs_block_map_close(rtems_rfs_file_system *fs, rtems_rfs_block_map *map)
Definition: rtems-rfs-block.c:165
int rtems_rfs_block_map_grow(rtems_rfs_file_system *fs, rtems_rfs_block_map *map, size_t blocks, rtems_rfs_block_no *new_block)
Definition: rtems-rfs-block.c:425
Maps Blocks to the Media Interface Layers.
uint32_t rtems_rfs_buffer_block
Definition: rtems-rfs-buffer.h:81
#define RTEMS_RFS_INODE_BLOCKS
Definition: rtems-rfs-file-system.h:86
int64_t rtems_rfs_pos_rel
Definition: rtems-rfs-file-system.h:114
Definition: rtems-rfs-file-system.h:135
Definition: rtems-rfs-inode.h:201
Definition: rtems-rfs-block.h:112
rtems_rfs_buffer_handle singly_buffer
Definition: rtems-rfs-block.h:158
rtems_rfs_block_pos bpos
Definition: rtems-rfs-block.h:136
rtems_rfs_block_size size
Definition: rtems-rfs-block.h:126
rtems_rfs_inode_handle * inode
Definition: rtems-rfs-block.h:121
uint32_t blocks[RTEMS_RFS_INODE_BLOCKS]
Definition: rtems-rfs-block.h:153
rtems_rfs_block_no last_map_block
Definition: rtems-rfs-block.h:142
bool dirty
Definition: rtems-rfs-block.h:116
rtems_rfs_block_no last_data_block
Definition: rtems-rfs-block.h:148
rtems_rfs_buffer_handle doubly_buffer
Definition: rtems-rfs-block.h:163
Definition: rtems-rfs-block-pos.h:71
Definition: rtems-rfs-block-pos.h:161
Definition: rtems-rfs-buffer.h:111