Skip to content
Commit c00716be authored by Eric Blake's avatar Eric Blake Committed by Kevin Wolf
Browse files

block: Minimize raw use of bds->total_sectors



bdrv_is_allocated_above() was relying on intermediate->total_sectors,
which is a field that can have stale contents depending on the value
of intermediate->has_variable_length.  An audit shows that we are safe
(we were first calling through bdrv_co_get_block_status() which in
turn calls bdrv_nb_sectors() and therefore just refreshed the current
length), but it's nicer to favor our accessor functions to avoid having
to repeat such an audit, even if it means refresh_total_sectors() is
called more frequently.

Suggested-by: default avatarJohn Snow <jsnow@redhat.com>
Signed-off-by: default avatarEric Blake <eblake@redhat.com>
Reviewed-by: default avatarManos Pitsidianakis <el13635@mail.ntua.gr>
Reviewed-by: default avatarJeff Cody <jcody@redhat.com>
Reviewed-by: default avatarJohn Snow <jsnow@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent d6a644bb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment