add helper function to count data objects in vdi

This also removes redudant object checks in dog, and improves the
performance of 'dog vdi list' when the vdi disk size is not so big.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
dog: remove redundant memset

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
dog: count the number of data objects for each 64 bit

This improves the performance of 'dog vdi list' especially when the
target vdi is sparse or fully allocated.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
add const where appropriate

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
group: remove unused function

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
md: fix memory leak after removing the disk

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
md: move purge_directory in init_path_space()

Or it will falsely remove .stale directory for newly added disk. For startup,
we don't purge directory.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests/functional: fix false alarm due to md changes

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
script/Makefile.am: fix

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>