2011-12-15 19:34:31 +01:00
|
|
|
// Copyright (C) 2011 Red Hat, Inc. All rights reserved.
|
2011-12-06 13:53:05 +00:00
|
|
|
//
|
2011-12-06 13:43:56 +00:00
|
|
|
// This file is part of the thin-provisioning-tools source.
|
|
|
|
//
|
|
|
|
// thin-provisioning-tools is free software: you can redistribute it
|
|
|
|
// and/or modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation, either version 3 of
|
|
|
|
// the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// thin-provisioning-tools is distributed in the hope that it will be
|
|
|
|
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
|
|
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License along
|
|
|
|
// with thin-provisioning-tools. If not, see
|
|
|
|
// <http://www.gnu.org/licenses/>.
|
|
|
|
|
2011-07-22 16:09:56 +01:00
|
|
|
#ifndef SPACE_MAP_DISK_H
|
|
|
|
#define SPACE_MAP_DISK_H
|
|
|
|
|
2013-10-23 11:39:31 +01:00
|
|
|
#include "persistent-data/transaction_manager.h"
|
2013-01-10 21:36:38 +00:00
|
|
|
#include "persistent-data/space_map.h"
|
2011-07-22 16:09:56 +01:00
|
|
|
|
|
|
|
//----------------------------------------------------------------
|
|
|
|
|
|
|
|
namespace persistent_data {
|
2011-08-31 12:48:41 +01:00
|
|
|
checked_space_map::ptr
|
2014-08-26 11:14:49 +01:00
|
|
|
create_disk_sm(transaction_manager &tm, block_address nr_blocks);
|
2011-08-24 14:27:45 +01:00
|
|
|
|
2011-08-31 12:48:41 +01:00
|
|
|
checked_space_map::ptr
|
2016-06-20 00:40:10 +08:00
|
|
|
open_disk_sm(transaction_manager &tm, void const *root);
|
2011-07-22 16:09:56 +01:00
|
|
|
|
2011-08-31 12:48:41 +01:00
|
|
|
checked_space_map::ptr
|
2014-08-26 11:14:49 +01:00
|
|
|
create_metadata_sm(transaction_manager &tm, block_address nr_blocks);
|
2011-11-03 14:44:00 +00:00
|
|
|
|
|
|
|
checked_space_map::ptr
|
2016-06-20 00:40:10 +08:00
|
|
|
open_metadata_sm(transaction_manager &tm, void const *root);
|
2016-02-27 15:21:05 +08:00
|
|
|
|
2016-03-22 12:04:51 +00:00
|
|
|
bcache::validator::ptr bitmap_validator();
|
2016-02-27 15:21:05 +08:00
|
|
|
|
2016-03-22 12:04:51 +00:00
|
|
|
bcache::validator::ptr index_validator();
|
|
|
|
|
2016-03-21 17:16:41 +00:00
|
|
|
// Get the number of data blocks with minimal IO. Used when
|
|
|
|
// repairing to avoid the bulk of the space maps.
|
|
|
|
block_address
|
|
|
|
get_nr_blocks_in_data_sm(transaction_manager &tm, void *root);
|
2011-07-22 16:09:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------
|
|
|
|
|
|
|
|
#endif
|