UFFS2 features

UFFS2相较于UFFS1减少了内存占用20%-50%,通过使用更小的节点数据结构实现。允许单个块上存在多个文件/目录,提高了闪存空间效率。目录和符号链接仅占用一页,小文件占用2-32页。将ECC移动到页面备用区,并且支持Linux VFS接口,可在嵌入式Linux中作为文件系统使用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

UFFS2 is under design. Compares to UFFS1, UFFS2 will have new features/improvements:

1) Reduce memory footprint by using smaller tree node data structure, save 20%~50% memory comparing with UFFS1.

typedef struct uffs_HeadNodeSt {
  u16 block;
  u16 info;     //point to info node
  u16 next;
  u16 prev;
} uffs_LoadNode;

typedef struct uffs_InfoNodeSt {
  u16 father;
  u16 serial;
  u16 sum;
  u8 attr:2;      //00 dir, 01 normal file, 10 symbol link, 11 reserved
  u8 status:2;    //data status:
  u8 pageid;
} uffs_InfoNode;

typedef struct uffs_FreeNodeSt {
  u16 block;
  u16 next;
  u16 prev;
} uffs_FreeNode;

typedef struct uffs_DataNodeSt {
  u16 block;
  u16 father;
  u16 serial;
  u8  status; //0 - no free page, 1 - has free page
  u8  page;   //first free page
} uffs_DataNode;

typedef struct uffs_TreeNodeSt {
  union {
     struct uffs_HeadNodeSt head;
     struct uffs_DataNodeSt data;
     struct uffs_FreeNodeSt free;
  } u;
} TreeNode;


Tree nodes memory cost:
total_blocks * 8 + max_files_and_dirs * 8

e.g.:
for 1Gb NAND flash:
page sze: 512,
pages_per_block: 32,
total_blocks: 8192,
max_files_and_dirs: 1000

tree nodes memory cost: 8192 * 8 + 1000 * 8 = 72KB
(compares to UFFS1: 8192 * 16 = 131KB, save 45%)

2) Allow multiple files/dirs on one block. This will significantly improve flash space efficiency in many circumstances.

Directories and symbol link will only cost one page, small file cost 2~pages_per_block pages, configurable. Large files will use full block.

3) Move ECC to page spare.
ECC data are compatible with YAFFS2.

4) Support Linux VFS interface. This will allow using UFFS2 as file system in embedded linux.
UFFS2 can be used as root file system.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值