diff options
Diffstat (limited to 'drivers/md/dm-thin-metadata.c')
| -rw-r--r-- | drivers/md/dm-thin-metadata.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index 7da347665552..baa87ff12816 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c | |||
| @@ -483,7 +483,7 @@ static int __write_initial_superblock(struct dm_pool_metadata *pmd) | |||
| 483 | 483 | ||
| 484 | disk_super->data_mapping_root = cpu_to_le64(pmd->root); | 484 | disk_super->data_mapping_root = cpu_to_le64(pmd->root); |
| 485 | disk_super->device_details_root = cpu_to_le64(pmd->details_root); | 485 | disk_super->device_details_root = cpu_to_le64(pmd->details_root); |
| 486 | disk_super->metadata_block_size = cpu_to_le32(THIN_METADATA_BLOCK_SIZE >> SECTOR_SHIFT); | 486 | disk_super->metadata_block_size = cpu_to_le32(THIN_METADATA_BLOCK_SIZE); |
| 487 | disk_super->metadata_nr_blocks = cpu_to_le64(bdev_size >> SECTOR_TO_BLOCK_SHIFT); | 487 | disk_super->metadata_nr_blocks = cpu_to_le64(bdev_size >> SECTOR_TO_BLOCK_SHIFT); |
| 488 | disk_super->data_block_size = cpu_to_le32(pmd->data_block_size); | 488 | disk_super->data_block_size = cpu_to_le32(pmd->data_block_size); |
| 489 | 489 | ||
| @@ -651,7 +651,7 @@ static int __create_persistent_data_objects(struct dm_pool_metadata *pmd, bool f | |||
| 651 | { | 651 | { |
| 652 | int r; | 652 | int r; |
| 653 | 653 | ||
| 654 | pmd->bm = dm_block_manager_create(pmd->bdev, THIN_METADATA_BLOCK_SIZE, | 654 | pmd->bm = dm_block_manager_create(pmd->bdev, THIN_METADATA_BLOCK_SIZE << SECTOR_SHIFT, |
| 655 | THIN_METADATA_CACHE_SIZE, | 655 | THIN_METADATA_CACHE_SIZE, |
| 656 | THIN_MAX_CONCURRENT_LOCKS); | 656 | THIN_MAX_CONCURRENT_LOCKS); |
| 657 | if (IS_ERR(pmd->bm)) { | 657 | if (IS_ERR(pmd->bm)) { |
| @@ -1489,6 +1489,23 @@ bool dm_thin_changed_this_transaction(struct dm_thin_device *td) | |||
| 1489 | return r; | 1489 | return r; |
| 1490 | } | 1490 | } |
| 1491 | 1491 | ||
| 1492 | bool dm_pool_changed_this_transaction(struct dm_pool_metadata *pmd) | ||
| 1493 | { | ||
| 1494 | bool r = false; | ||
| 1495 | struct dm_thin_device *td, *tmp; | ||
| 1496 | |||
| 1497 | down_read(&pmd->root_lock); | ||
| 1498 | list_for_each_entry_safe(td, tmp, &pmd->thin_devices, list) { | ||
| 1499 | if (td->changed) { | ||
| 1500 | r = td->changed; | ||
| 1501 | break; | ||
| 1502 | } | ||
| 1503 | } | ||
| 1504 | up_read(&pmd->root_lock); | ||
| 1505 | |||
| 1506 | return r; | ||
| 1507 | } | ||
| 1508 | |||
| 1492 | bool dm_thin_aborted_changes(struct dm_thin_device *td) | 1509 | bool dm_thin_aborted_changes(struct dm_thin_device *td) |
| 1493 | { | 1510 | { |
| 1494 | bool r; | 1511 | bool r; |
