COW: Extend checking allocated bits to beyond one sector
commit091b1108ca6d6e3bfaea5f095f219bf5ea8c316b
authorCharlie Shepherd <charlie@ctshepherd.com>
Fri, 15 Nov 2013 18:47:02 +0000 (15 19:47 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 29 Nov 2013 12:40:36 +0000 (29 13:40 +0100)
treebad6073c7b68b1bdb66e674e307e14b0984b9ab4
parent14b98fdaf3422fef19718033be9eca7e0b776a26
COW: Extend checking allocated bits to beyond one sector

cow_co_is_allocated() only checks one sector's worth of allocated bits
before returning. This is allowed but (slightly) inefficient, so extend
it to check all of the file's metadata sectors.

Signed-off-by: Charlie Shepherd <charlie@ctshepherd.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
[kwolf: silenced compiler warning (-Wmaybe-uninitialized for changed)]
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/cow.c