dotcloud/docker — pull request #5404 by alexlarsson (2014-04-25 13:58:26+00:00)
Title: Make devicemapper backend able to support multiple processes

This changes a few aspects of the devicemapper backend.
First of all it changes the allocation of device-ids to rely on the kernel to atomically say whether a device create succeeded. If not we get EEXIST, and try another.
Secondly, it changes the storage of the metadata (basically the mapping from docker id to device id on the pool) to be stored in one file per device, rather than in one single file. Also these files are read lazily when accessed.
Third, it ensures we're never setting up the devicemapper loopback stuff if the right poo device already works.

The code migrates the existing metadata format the first time its run, so it is backwards compatible. However
once you've upgraded its not really possible to go back to an earlier version.

These together should make it possible to use the Get/Put operations of the driver outside of the docker daemon, assuming that the daemon already created the container devices, and that the daemon initialized the pool first.

I believe this should be enough to allow all current backends to use Get/Put in a separate runtime process.