免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2952 | 回复: 0
打印 上一主题 下一主题

A short history of btrfs [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-01-23 12:00 |只看该作者 |倒序浏览

                文章是去年中旬lwn发表的,算是入门btrfs的小文。(
http://lwn.net/Articles/342892/
)对于有过fs开发经验的童鞋來說,,看懂這篇文章并不難。尤其是看到作者深入讲述了btrfs的诸多优点后,脑海里的文件系统的数据布局比较,很容易理解他的优势。 比如inode,file,directory-entry,BITMAP等等,BTRFS完全用BTREE来组织,节省了查找的时间。先简单看下面两张图:

Btrfs, instead, creates a disk layout which looks more like:

In both diagrams, red blocks denote wasted disk space and red arrows denote seeks
第二张图片,打眼一看就知道与上面图片中所代表的谁好谁差了。明显下面的同一个object的数据是聚合在一起。
这里有两个概念:抽象数据与原生数据。 BTRFS ON-DISK DATAS ONLY CONTAINS 三种类型,disk-key/header/item。但是许多抽象的树也放在磁盘里,这些抽象出来的数据是有上面三种原生数据构成的。
还有,原生数据本身也是抽象数据的一部分。
比如下面这段话:We should take a quick look at the structure of the btree nodes and leaves themselves. Each node and leaf is an extent in the btree - nodes are extents full of  pairs, and leaves contain items. Large file data is stored outside of the btree leaves, with the item describing the extent kept in the leaf itself.
btrfs extent Back references 先弄清楚这个概念。
Back references give btrfs a major advantage over every other file system in its class “The result is beautifully generic and elegant: Everything on disk is a btree containing reference counted, checksummed extents of items, organized by  keys.”
Btrfs Back References
http://oss.oracle.com/projects/btrfs/dist/documentation/btrfs-backrefs.html
有点像cgroup里的css_set。Back references have three main goals:
  • Differentiate between all holders of references to an extent so that when a reference is dropped we can make sure it was a valid reference before freeing the extent.
  • Provide enough information to quickly find the holders of an extent if we notice a given block is corrupted or bad.
  • Make it easy to migrate blocks for FS shrinking or storage pool maintenance. This is actually the same as #2, but with a slightly different use case.
File Extent BackrefsBtree Extent Backrefs
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/110888/showart_2158343.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP