Closed andriyndev closed 6 months ago
I already figured it out. Initially, I didn't pay attention that the 0xff
value is cast to int8_t
, i.e. it's turned into -1
.
Ah yes, the theory here is we could at some point add "splice" tags with deletions to the mdir larger >1. But I think this is unlikely to ever actually happen....
I'm trying to investigate the source code of littlefs. From what I understand,
LFS_TYPE_SPLICE
is the type1 forLFS_TYPE_CREATE
andLFS_TYPE_DELETE
, and forLFS_TYPE_CREATE
lfs_tag_splice()
returns1
while forLFS_TYPE_DELETE
it returns0xff
but I cannot understand what's the actual meaning of these values. For example, this return value is used in the following piece of code:which I cannot understand so far. My assumption is that
tempcount
holds the currently calculated number of files in the directory but I'm not sure since in the linefrom what I understand, we add
1
forLFS_TYPE_CREATE
, and0xff
forLFS_TYPE_DELETE
that makes no sense to me. Also, in linesDoes this mean that the number of files in the directory is always bigger than the number of the biggest tag id in the directory?