dotcloud/docker — pull request #3073 by alexlarsson (2013-12-05 21:54:41+00:00)
Title: Refcount driver mounts

This adds a Put() operation to the driver API which pairs with the Get() call.
All callers of Get() are changed to have a corresponding Put() which lets us balance the uses of a particular ID.
We then use this in the devicemapper driver to avoid leaving mounts around.

For instance, we almost never need any images of init layers mounted, only when e.g. diffing or calculating sizes. We also don't want to leave stray mounts for every container that was ever run (we currently even mount old ones on daemon start!).