22 #if !defined (_RTEMS_RFS_BLOCK_H_) 23 #define _RTEMS_RFS_BLOCK_H_ 38 #define rtems_rfs_block_get_number(_h, _b) \ 39 ((rtems_rfs_block_no) \ 40 (rtems_rfs_read_u32 (rtems_rfs_buffer_data (_h) + \ 41 ((_b) * sizeof (rtems_rfs_block_no))))) 51 #define rtems_rfs_block_set_number(_h, _b, _n) \ 53 rtems_rfs_write_u32 (rtems_rfs_buffer_data (_h) + \ 54 ((_b) * sizeof (rtems_rfs_block_no)), (_n)); \ 55 rtems_rfs_buffer_mark_dirty (_h); \ 151 #define rtems_rfs_block_map_is_dirty(_m) ((_m)->dirty) 156 #define rtems_rfs_block_map_count(_m) ((_m)->size.count) 161 #define rtems_rfs_block_map_size(_m) (&((_m)->size)) 166 #define rtems_rfs_block_map_size_offset(_m) ((_m)->size.offset) 171 #define rtems_rfs_block_map_last(_m) \ 172 rtems_rfs_block_pos_last_block (&(_m)->bpos, &(_m)->size) 177 #define rtems_rfs_block_map_past_end(_m, _p) \ 178 rtems_rfs_block_pos_past_end (_p, &(_m)->size) 183 #define rtems_rfs_block_map_pos(_f, _m) \ 184 rtems_rfs_block_get_pos (_f, &(_m)->bpos) 189 #define rtems_rfs_block_map_block(_m) ((_m)->bpos.bno) 194 #define rtems_rfs_block_map_block_offset(_m) ((_m)->bpos.boff) 206 map->size.offset = offset;
RTEMS File Systems Block Position and Size Management.
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:233
Definition: rtems-rfs-block-pos.h:141
bool dirty
Definition: rtems-rfs-block.h:97
#define RTEMS_RFS_INODE_BLOCKS
Definition: rtems-rfs-file-system.h:67
uint32_t blocks[RTEMS_RFS_INODE_BLOCKS]
Definition: rtems-rfs-block.h:134
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:333
#define rtems_rfs_block_copy_size(_lhs, _rhs)
Definition: rtems-rfs-block-pos.h:163
Definition: rtems-rfs-file-system.h:123
uint32_t rtems_rfs_buffer_block
Definition: rtems-rfs-buffer.h:62
rtems_rfs_inode_block rtems_rfs_block_no
Definition: rtems-rfs-block-pos.h:39
uint32_t rtems_rfs_block_off
Definition: rtems-rfs-block-pos.h:44
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:345
int rtems_rfs_block_map_shrink(rtems_rfs_file_system *fs, rtems_rfs_block_map *map, size_t blocks)
Definition: rtems-rfs-block.c:649
rtems_rfs_block_no last_data_block
Definition: rtems-rfs-block.h:129
rtems_rfs_inode_handle * inode
Definition: rtems-rfs-block.h:102
rtems_rfs_block_pos bpos
Definition: rtems-rfs-block.h:117
rtems_rfs_buffer_handle singly_buffer
Definition: rtems-rfs-block.h:139
Definition: rtems-rfs-inode.h:181
Definition: rtems-rfs-block-pos.h:51
rtems_rfs_block_no last_map_block
Definition: rtems-rfs-block.h:123
Definition: rtems-rfs-block.h:92
int rtems_rfs_block_map_close(rtems_rfs_file_system *fs, rtems_rfs_block_map *map)
Definition: rtems-rfs-block.c:146
rtems_rfs_buffer_handle doubly_buffer
Definition: rtems-rfs-block.h:144
rtems_rfs_block_size size
Definition: rtems-rfs-block.h:107
Maps Blocks to the Media Interface Layers.
int rtems_rfs_block_map_free_all(rtems_rfs_file_system *fs, rtems_rfs_block_map *map)
Definition: rtems-rfs-block.c:796
Definition: rtems-rfs-buffer.h:91
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:406
unsigned size
Definition: tte.h:74
int64_t rtems_rfs_pos_rel
Definition: rtems-rfs-file-system.h:95
struct rtems_rfs_block_map_s rtems_rfs_block_map
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:95