[Btrfs-devel] Compression?

Chris Mason chris.mason at oracle.com
Fri Jun 29 05:25:13 PDT 2007


On Fri, Jun 29, 2007 at 12:12:16PM +0200, Frank Groeneveld wrote:
> Hi,
> 
> I'm just wondering, is btrfs going to support compression, just like  
> ZFS and Reiser4? That would be a great feature. When designing this  
> filesystem, did you leave it open for later additions, so that  
> somebody can create a patch to add compression, without too much of a  
> hassle?

It would be a disk format change right now, but we've still got a number
of those pending.  I'm definitely interested in compression as a
feature, but I haven't quite worked out the best way to do it yet in my
head.

There are two kinds of file extents, inline and external.  Inline
extents have their data directly in the btree (actually just at the end
of the extent item) and external extents have their data in separate
extents on disk.

A few bits of the type field could be used to indicate if the data in
the extent is compressed or not.  If it is compressed, the extent item
would need an extra field to store the actual uncompressed length of the
data it contains.

-chris



More information about the Btrfs-devel mailing list