The current default behavior of Docker is COW (copy on write), aka allocate on write. This relies on free space in a drive in order to write to disk.
In contrast - with memory, unreferenced files are left available, to be overwritten if something else is needed, or re-linked in constant time if they are needed once again.
We'd like to implement a similar mechanism for caching remote files on a local disk. That is, there would be a set location for files which would be allowed to be overwritten if the space was needed, or linked if the files themselves were needed.
Such a piece of software would ideally hook in to the FS driver when it tries do a write, or when it reports space available. It is my assumption that a polling method would be insufficient, as a piece of software may allocate arbitrary large files at any time.
Does anything like this exist already in the open source world? If not, is it possible? Are there major impediments? What is a good way to get started?