存储器上的数据结构

存储器上的数据结构

2025 南京大学《操作系统原理》
存储器上的数据结构

文件系统就是数据结构

那玩得花活就多了

  • Persistent data structure, filters, learned index, ...

center

2025 南京大学《操作系统原理》
存储器上的数据结构

首先,数据结构可以不用实现在内核

FUSE: Filesystem in Userspace

  • 😂 果然是违背祖宗的决定
  • FUSE Kernel Module: 负责实现协议 (/dev/fuse)
  • libfuse: 用来实现文件系统
    • 没错,是协议,其他人也能实现,例如 macFUSE
struct fuse_operations null_oper = {
    .getattr    = null_getattr,
    .truncate   = null_truncate,
    .open       = null_open,
    .read       = null_read,
    .write      = null_write,
};
2025 南京大学《操作系统原理》
存储器上的数据结构

其次,任何数据结构都是可以的

B-Tree Filesystem (btrfs)

  • 反正只要 “实现文件系统 API”,干脆 “Everything is a B-Tree”,resize、透明压缩、快照……一次性搞定

center

2025 南京大学《操作系统原理》
存储器上的数据结构

各种领域优化的数据结构

Flash-Friendly Filesystem (f2fs)

center

Enhanced Read-only Filesystem (erofs)

center

2025 南京大学《操作系统原理》