[Btrfs-devel] Compression?

Steve Long slong at rathaus.eclipse.co.uk
Wed Jul 4 03:07:10 PDT 2007


> 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.

Sounds cool; inline extents wouldn't be compressed as the amount of data is 
small? Also, I am unsure why more than 1 bit is required to indicate 
compression. Having only external extent items compressed would be good for 
performance on small files (the reason for internal extents aiui) and would 
also mean less space usage.

I guess you could have a heuristic to compress smaller files if it would make 
them fit in an inline extent as well (ie only if needed.)

Hope that makes sense :-)
Regards,
steveL.



More information about the Btrfs-devel mailing list