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