Lest assume that NFFS will try to avoid make holes in inode ID range - this 
mean that it will use only smal ranges of ID, count of the maximum number of 
each kind of inode. This mean that we need to remember (ID, Sequence number) 
pair of deleted inode.
```c
struct nffs_deleted_inode {
    uint32_t ndi_id;            /* deleted object ID. */
    uint32_t ndi_seq;           /* Sequence number. */
};
```
Whenever NFFS attempt to create a new inode it will take spare ID form deletion 
list (uses it with increment sequence number obviously), and just in case the 
list was empty it will get brand new ID.
For current NFFS we need to create a list of deleted inode ID-Seq pairs with 
capacity of FS_NFFS_NUM_INODES * 2 (as there are FILE and DIRECTORY inode kind).

Such a patch will ensure that we will always fit in memory constrains when 
restoring NFFS, but RAM consumption per inode will increase.

[ Full content available at: https://github.com/apache/mynewt-nffs/issues/10 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to