dotcloud/docker — pull request #2370 by alexlarsson (2013-10-24 11:26:50+00:00)
Title: Implement container size calculations for devicemapper

This solves https://github.com/dotcloud/docker/issues/2271 by implementing size calculation based on Container.Changes(). Its a bit slow as it needs to recurse over the filesystems, but it at least works.

The actual GetSize() calculation is the last commit. The other are a series of commits that are meant to make concurrent Mount()/Unmount() of devicemapper devices "safe". Currently they can be problematic if two threads mount and then unmount in parallel, as the first to unmount will try to deactivate the device used by the second thread.