1 / 13

File System in my eyes

kelvin.xupt@gmail.com 2011.11.28. File System in my eyes. 文件系统的定义. 文件系统是操作系统与用户的接口,为用户管理数据,这些数据通过文件系统直观地存储在介质上。 ---- 《边干边学— Linux 内核指导》李善平

milton
Download Presentation

File System in my eyes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. kelvin.xupt@gmail.com 2011.11.28 File System in my eyes

  2. 文件系统的定义 • 文件系统是操作系统与用户的接口,为用户管理数据,这些数据通过文件系统直观地存储在介质上。 ----《边干边学—Linux内核指导》李善平 • 负责管理在外存上的文件,并把对文件的存取、共享和保护等手段提供给用户。 ----《计算机操作系统》汤子瀛 • Files are managed by the operating system. How they are structured, named, accessed, used, protected, implemented, and managed are major topics in operat-ing system design. As a whole, that part of the operating system dealing with files is known as the file system and is the subject of this chapter. ----《现代操作系统》Andrew S. Tanenbaum 关键字:存储介质、文件系统、用户、文件、数据 由此可见,文件系统的功能:为用户管理存储介质上的文件。如何管理?

  3. 用户态文件系统 • 用户态文件系统指的是位于用户空间的文件系统。 >> FUSE >> HLFS

  4. FUSE

  5. FUSE • FUSE(Filesystem in Userspace)是sourceforge上的一个开源项目,它可以为用户提供编写用户态文件系统的接口。使用FUSE,用户可以不必熟悉Kernel代码,使用标准C库、FUSE库以及GNU C库便可设计出自己需要的文件系统。 • FUSE由三个部分组成:FUSE内核模块、FUSE库以及一些挂载工具。 • FUSE内核模块实现了和VFS的对接,它看起来像一个普通的文件系 统模块;另外,FUSE内核模块实现了一个可以被用户空间进程打开的设备,当VFS发来文件操作请求之后,它将该请求转化为特定格式,并通过设备传递给用户空间进程,用户空间进程在处理完请求后,将结果返回给FUSE内核模块,内核模块再将其还原为Linux kernel需要的格式,并返回给VFS。

  6. FUSE static struct fuse_operations test_op = { .open = test_open, .read = test_read, .write = test_write, .getattr = test_getattr, .mknod = test_mknod, .readlink = test_readlink, .mkdir = test_mkdir, .rmdir = test_rmdir, .readdir = test_readdir };

  7. HLFS • HLFS是cloudxy的一个子项目,为弹性云提供虚拟机镜像的后台存储。 • HLFS(Log-structured File System based on HDFS) is a file system in user space which makes use of HDFS files as its virtual disk.The feature of HLFS is log-structured.It means the data write to HLFSmust be appended in the tail of the virtual disk,thereby speeding up both file writing and crash recovery.

  8. HLFS对存储介质的构建 • HLFS使用LOCAL本地文件系统或者HDFS分布式文件系统的文件来构成具有线性地址空间的存储介质。 • HLFS通过struct back_storage结构体来对LOCAL或HDFS的接口进行抽象,并对HLFS的设计提供统一的接口。

  9. HLFS对存储介质的构建 • HLFS使用LOCAL本地文件系统或者HDFS分布式文件系统的文件来构成具有线性地址空间的存储介质。 • HLFS通过struct back_storage结构体来对LOCAL或HDFS的接口进行抽象,并对HLFS的设计提供统一的接口。

  10. HLFS对存储介质的构建

  11. 重新审视文件系统的定义 >> 存储介质:物理磁盘? 不一定是家里电脑上的250G硬盘,它可能是: 具有固定容量的文件; 内存; 底层的文件系统; 分布式文件系统; 。。。 它是具有线性地址空间的一块存储区域;

  12. >> 操作系统的组成部分? 不一定是操作系统内核的组成部分,它有可能是: C库; 利用FUSE实现的用户态程序; 。。。 它是以文件为数据组织单位给用户提供服务的软件。服务不仅包括传统的读写操作,还包括诸如格式转换之类的其他操作。 重新审视文件系统的定义

  13. 3Q Key file in Glib

More Related