48#if !defined (_RTEMS_RFS_BLOCK_POS_H_)
49#define _RTEMS_RFS_BLOCK_POS_H_
97#define rtems_rfs_block_copy_bpos(_lhs, _rhs) \
98 do { (_lhs)->bno = (_rhs)->bno; \
99 (_lhs)->boff = (_rhs)->boff; \
100 (_lhs)->block = (_rhs)->block; } while (0)
182#define rtems_rfs_block_copy_size(_lhs, _rhs) \
183 do { (_lhs)->count = (_rhs)->count; \
184 (_lhs)->offset = (_rhs)->offset; } while (0)
189#define rtems_rfs_block_pos_last_block(_p, _s) \
190 ((((_p)->bno == 0) && ((_s)->count == 0)) || ((_p)->bno == ((_s)->count - 1)))
195#define rtems_rfs_block_pos_past_end(_p, _s) \
196 (((_p)->bno && ((_s)->count == 0)) || \
197 ((_p)->bno >= (_s)->count) || \
198 (((_p)->bno == ((_s)->count - 1)) && ((_p)->boff > (_s)->offset)))
203#define rtems_rfs_block_pos_block_past_end(_p, _s) \
204 (((_p)->bno && ((_s)->count == 0)) || ((_p)->bno >= (_s)->count))
210#define rtems_rfs_block_size_get_bpos(_s, _b) \
211 do { (_b)->bno = (_s)->count; \
212 (_b)->boff = (_s)->offset; \
214 if ((_b)->boff) --(_b)->bno; } while (0)
219#define rtems_rfs_block_size_equal(_lhs, _rhs) \
220 (((_lhs)->count == (_rhs)->count) && ((_lhs)->offset == (_rhs)->offset))
void rtems_rfs_block_get_bpos(rtems_rfs_file_system *fs, rtems_rfs_pos pos, rtems_rfs_block_pos *bpos)
Definition: rtems-rfs-block.c:68
rtems_rfs_pos rtems_rfs_block_get_size(rtems_rfs_file_system *fs, rtems_rfs_block_size *size)
Definition: rtems-rfs-block.c:98
void rtems_rfs_block_get_block_size(rtems_rfs_file_system *fs, rtems_rfs_pos pos, rtems_rfs_block_size *size)
Definition: rtems-rfs-block.c:84
struct rtems_rfs_block_pos_s rtems_rfs_block_pos
rtems_rfs_pos rtems_rfs_block_get_pos(rtems_rfs_file_system *fs, rtems_rfs_block_pos *bpos)
Definition: rtems-rfs-block.c:77
struct rtems_rfs_block_size_s rtems_rfs_block_size
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
uint64_t rtems_rfs_pos
Definition: rtems-rfs-file-system.h:109
int64_t rtems_rfs_pos_rel
Definition: rtems-rfs-file-system.h:114
RTEMS File System Information Node.
uint32_t rtems_rfs_inode_block
Definition: rtems-rfs-inode.h:108
Definition: rtems-rfs-file-system.h:135
Definition: rtems-rfs-block-pos.h:71
rtems_rfs_block_off boff
Definition: rtems-rfs-block-pos.h:81
rtems_rfs_block_no bno
Definition: rtems-rfs-block-pos.h:76
rtems_rfs_block_no block
Definition: rtems-rfs-block-pos.h:87
Definition: rtems-rfs-block-pos.h:161
rtems_rfs_block_off offset
Definition: rtems-rfs-block-pos.h:172
rtems_rfs_block_no count
Definition: rtems-rfs-block-pos.h:166