Re: Partial Allocation
Josef Bacik <jbacik <at> redhat.com>
2008-12-04 12:15:50 GMT
On Wed, Dec 03, 2008 at 12:32:56AM +0000, Oliver Mattos wrote:
> I presume that in the design of BTRFS, like most other filesystems, a
> block on the underlying storage is either allocated (ie. to store
> metadata or file data), or deallocated (possibly blank or containing
> garbage left over, but the contents are irrelivant).
> Does BTRFS have any system that could allow adding at a later point in
> time a feature which would allow "weak" allocation of blocks, by which I
> mean the block is allocated (ie. storing useful data), but if another
> file needs to be written which has a higher priority and there are not
> many free blocks left, then the data could be replaced.
> I could forsee uses for features like that as a cache - for example my
> web browsing cache is not vital data, and as such doesn't need to use up
> disk space, but it might as well use up any disk space that would
> otherwise go unused. The cache data can always be regenerated, so
> loosing the data isn't a problem.
> Other uses of the feature could be for persistant network caches (ie. to
> store copies of remote files on the network can they can be accessed
> faster locally), but again the cache data isn't critical to the
> operation of the system, so could be stored in "weakly allocated"
> blocks. Further uses could be caches of compressed files (decompressed
> versions of the same files are also saved in other blocks, and depending
> on IO and CPU load either the compressed or decompressed version is
> >From a user-land perspective, these files could be created with a