diff options
author | Joe Thornber <ejt@redhat.com> | 2012-07-27 10:08:08 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-07-27 10:08:08 -0400 |
commit | 51a0f659c03ccc8ec407c7a9f9701d1b4618d515 (patch) | |
tree | 21b05e433e1f513079e51d3ccec1da6b1ea1008f /drivers/md/dm-thin-metadata.c | |
parent | 41675aea32949786cf002c4ab179b85144d3423b (diff) |
dm persistent data: create new dm_block_manager struct
This patch introduces a separate struct for the block_manager.
It also uses IS_ERR to check the return value of dm_bufio_client_create
instead of testing incorrectly for NULL.
Prior to this patch a struct dm_block_manager was really an alias for
a struct dm_bufio_client. We want to add some functionality to the
block manager that will require extra fields, so this one to one
mapping is no longer valid.
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-thin-metadata.c')
-rw-r--r-- | drivers/md/dm-thin-metadata.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index 82b82c318f14..afd84cacca4b 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c | |||
@@ -681,10 +681,11 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev, | |||
681 | bm = dm_block_manager_create(bdev, THIN_METADATA_BLOCK_SIZE, | 681 | bm = dm_block_manager_create(bdev, THIN_METADATA_BLOCK_SIZE, |
682 | THIN_METADATA_CACHE_SIZE, | 682 | THIN_METADATA_CACHE_SIZE, |
683 | THIN_MAX_CONCURRENT_LOCKS); | 683 | THIN_MAX_CONCURRENT_LOCKS); |
684 | if (!bm) { | 684 | if (IS_ERR(bm)) { |
685 | r = PTR_ERR(bm); | ||
685 | DMERR("could not create block manager"); | 686 | DMERR("could not create block manager"); |
686 | kfree(pmd); | 687 | kfree(pmd); |
687 | return ERR_PTR(-ENOMEM); | 688 | return ERR_PTR(r); |
688 | } | 689 | } |
689 | 690 | ||
690 | r = superblock_all_zeroes(bm, &create); | 691 | r = superblock_all_zeroes(bm, &create); |
@@ -694,7 +695,6 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev, | |||
694 | return ERR_PTR(r); | 695 | return ERR_PTR(r); |
695 | } | 696 | } |
696 | 697 | ||
697 | |||
698 | r = init_pmd(pmd, bm, 0, create); | 698 | r = init_pmd(pmd, bm, 0, create); |
699 | if (r) { | 699 | if (r) { |
700 | dm_block_manager_destroy(bm); | 700 | dm_block_manager_destroy(bm); |