[space map disk] tidy up: add const qualifier

This commit is contained in:
Ming-Hung Tsai 2016-06-20 00:40:10 +08:00
parent 3439dbfdfc
commit 7eac48793c
4 changed files with 10 additions and 10 deletions

View File

@ -742,7 +742,7 @@ persistent_data::create_disk_sm(transaction_manager &tm,
}
checked_space_map::ptr
persistent_data::open_disk_sm(transaction_manager &tm, void *root)
persistent_data::open_disk_sm(transaction_manager &tm, void const *root)
{
sm_root_disk d;
sm_root v;
@ -770,7 +770,7 @@ persistent_data::create_metadata_sm(transaction_manager &tm, block_address nr_bl
}
checked_space_map::ptr
persistent_data::open_metadata_sm(transaction_manager &tm, void *root)
persistent_data::open_metadata_sm(transaction_manager &tm, void const *root)
{
sm_root_disk d;
sm_root v;

View File

@ -29,13 +29,13 @@ namespace persistent_data {
create_disk_sm(transaction_manager &tm, block_address nr_blocks);
checked_space_map::ptr
open_disk_sm(transaction_manager &tm, void *root);
open_disk_sm(transaction_manager &tm, void const *root);
checked_space_map::ptr
create_metadata_sm(transaction_manager &tm, block_address nr_blocks);
checked_space_map::ptr
open_metadata_sm(transaction_manager &tm, void *root);
open_metadata_sm(transaction_manager &tm, void const *root);
bcache::validator::ptr bitmap_validator();

View File

@ -9,7 +9,7 @@ using namespace thin_provisioning;
namespace {
void count_trees(transaction_manager::ptr tm,
superblock_detail::superblock &sb,
superblock_detail::superblock const &sb,
block_counter &bc) {
// Count the device tree
@ -30,12 +30,12 @@ namespace {
}
void count_space_maps(transaction_manager::ptr tm,
superblock_detail::superblock &sb,
superblock_detail::superblock const &sb,
block_counter &bc) {
// Count the metadata space map (no-throw)
try {
persistent_space_map::ptr metadata_sm =
open_metadata_sm(*tm, static_cast<void *>(&sb.metadata_space_map_root_));
open_metadata_sm(*tm, static_cast<void const *>(&sb.metadata_space_map_root_));
metadata_sm->count_metadata(bc);
} catch (std::exception &e) {
cerr << e.what() << endl;
@ -44,7 +44,7 @@ namespace {
// Count the data space map (no-throw)
{
persistent_space_map::ptr data_sm =
open_disk_sm(*tm, static_cast<void *>(&sb.data_space_map_root_));
open_disk_sm(*tm, static_cast<void const *>(&sb.data_space_map_root_));
data_sm->count_metadata(bc);
}
}
@ -53,7 +53,7 @@ namespace {
//----------------------------------------------------------------
void thin_provisioning::count_metadata(transaction_manager::ptr tm,
superblock_detail::superblock &sb,
superblock_detail::superblock const &sb,
block_counter &bc,
bool skip_metadata_snap) {
// Count the superblock

View File

@ -8,7 +8,7 @@
namespace thin_provisioning {
void count_metadata(transaction_manager::ptr tm,
superblock_detail::superblock &sb,
superblock_detail::superblock const &sb,
block_counter &bc,
bool skip_metadata_snap = false);
}