<div dir="ltr">Hi guys,<div><br></div><div>I am experimenting with RFS. There is an issue around block addressing in RFS that has been bothering me quite a bit.</div><div><br></div><div>To my knowledge, there are two ways to ID a block in RFS:</div><div><br></div><div>- Via a direct bno</div><div>- Via a group number and a bit (offset)</div><div><br></div><div>They should be fully convertible (1-1 mapping). However, the source code I am reading is inconsistent in converting one to the other. Below is a summary of the different equations used in the code.</div><div><br></div><div>1. In rtems_rfs_group_bitmap_alloc (rtems-rfs-group.c, line #172)</div><div>bno = group * group_blocks + bit</div><div><br></div><div>2. In rtems_rfs_group_bitmap_alloc (rtems-rfs-group.c, line #228)</div><div>bno = group * group_blocks + bit + 1 (via rtems_rfs_group_block() function)</div><div><br></div><div>3. In rtems_rfs_group_bitmap_free (rtems-rfs-group.c, line #283)</div><div>bno = group * group_blocks + bit + 1 (RTEMS_RFS_SUPERBLOCK_SIZE)</div><div><br></div><div>4. In rtems_rfs_group_bitmap_test (rtems-rfs-group.c, line #332)</div><div>bno = group * group_blocks + bit</div><div><br></div><div>#1 and #4 are different from #2 and #3.</div><div><br></div><div>I did a little test. On a newly formatted RFS partition, I called rtems_rfs_group_bitmap_alloc() to allocate a block. Then check if the block is allocated via rtems_rfs_group_bitmap_test. The result confirmed that the addressing is inconsistent, as the bno returned by rtems_rfs_group_bitmap_alloc() is unallocated according to rtems_rfs_group_bitmap_test().</div><div><br></div><div>Is there anything I interpreted incorrectly or is this a real issue?</div><div><br></div><div>Thanks,</div><div>Fan</div></div>