diff options
Diffstat (limited to 'drivers/md/dm-thin-metadata.h')
| -rw-r--r-- | drivers/md/dm-thin-metadata.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/md/dm-thin-metadata.h b/drivers/md/dm-thin-metadata.h index 9a368567632f..e3c857db195a 100644 --- a/drivers/md/dm-thin-metadata.h +++ b/drivers/md/dm-thin-metadata.h | |||
| @@ -9,16 +9,14 @@ | |||
| 9 | 9 | ||
| 10 | #include "persistent-data/dm-block-manager.h" | 10 | #include "persistent-data/dm-block-manager.h" |
| 11 | #include "persistent-data/dm-space-map.h" | 11 | #include "persistent-data/dm-space-map.h" |
| 12 | #include "persistent-data/dm-space-map-metadata.h" | ||
| 12 | 13 | ||
| 13 | #define THIN_METADATA_BLOCK_SIZE 4096 | 14 | #define THIN_METADATA_BLOCK_SIZE DM_SM_METADATA_BLOCK_SIZE |
| 14 | 15 | ||
| 15 | /* | 16 | /* |
| 16 | * The metadata device is currently limited in size. | 17 | * The metadata device is currently limited in size. |
| 17 | * | ||
| 18 | * We have one block of index, which can hold 255 index entries. Each | ||
| 19 | * index entry contains allocation info about 16k metadata blocks. | ||
| 20 | */ | 18 | */ |
| 21 | #define THIN_METADATA_MAX_SECTORS (255 * (1 << 14) * (THIN_METADATA_BLOCK_SIZE / (1 << SECTOR_SHIFT))) | 19 | #define THIN_METADATA_MAX_SECTORS DM_SM_METADATA_MAX_SECTORS |
| 22 | 20 | ||
| 23 | /* | 21 | /* |
| 24 | * A metadata device larger than 16GB triggers a warning. | 22 | * A metadata device larger than 16GB triggers a warning. |
| @@ -27,6 +25,11 @@ | |||
| 27 | 25 | ||
| 28 | /*----------------------------------------------------------------*/ | 26 | /*----------------------------------------------------------------*/ |
| 29 | 27 | ||
| 28 | /* | ||
| 29 | * Thin metadata superblock flags. | ||
| 30 | */ | ||
| 31 | #define THIN_METADATA_NEEDS_CHECK_FLAG (1 << 0) | ||
| 32 | |||
| 30 | struct dm_pool_metadata; | 33 | struct dm_pool_metadata; |
| 31 | struct dm_thin_device; | 34 | struct dm_thin_device; |
| 32 | 35 | ||
| @@ -161,6 +164,8 @@ int dm_thin_remove_block(struct dm_thin_device *td, dm_block_t block); | |||
| 161 | */ | 164 | */ |
| 162 | bool dm_thin_changed_this_transaction(struct dm_thin_device *td); | 165 | bool dm_thin_changed_this_transaction(struct dm_thin_device *td); |
| 163 | 166 | ||
| 167 | bool dm_pool_changed_this_transaction(struct dm_pool_metadata *pmd); | ||
| 168 | |||
| 164 | bool dm_thin_aborted_changes(struct dm_thin_device *td); | 169 | bool dm_thin_aborted_changes(struct dm_thin_device *td); |
| 165 | 170 | ||
| 166 | int dm_thin_get_highest_mapped_block(struct dm_thin_device *td, | 171 | int dm_thin_get_highest_mapped_block(struct dm_thin_device *td, |
| @@ -202,6 +207,12 @@ int dm_pool_register_metadata_threshold(struct dm_pool_metadata *pmd, | |||
| 202 | dm_sm_threshold_fn fn, | 207 | dm_sm_threshold_fn fn, |
| 203 | void *context); | 208 | void *context); |
| 204 | 209 | ||
| 210 | /* | ||
| 211 | * Updates the superblock immediately. | ||
| 212 | */ | ||
| 213 | int dm_pool_metadata_set_needs_check(struct dm_pool_metadata *pmd); | ||
| 214 | bool dm_pool_metadata_needs_check(struct dm_pool_metadata *pmd); | ||
| 215 | |||
| 205 | /*----------------------------------------------------------------*/ | 216 | /*----------------------------------------------------------------*/ |
| 206 | 217 | ||
| 207 | #endif | 218 | #endif |
