diff options
author | Joe Thornber <ejt@redhat.com> | 2012-07-27 15:08:08 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-07-27 15:08:08 +0100 |
commit | 51a0f659c03ccc8ec407c7a9f9701d1b4618d515 (patch) | |
tree | 21b05e433e1f513079e51d3ccec1da6b1ea1008f /drivers/md/dm-thin-metadata.c | |
parent | 41675aea32949786cf002c4ab179b85144d3423b (diff) | |
download | linux-51a0f659c03ccc8ec407c7a9f9701d1b4618d515.tar.bz2 |
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, bm = dm_block_manager_create(bdev, THIN_METADATA_BLOCK_SIZE, THIN_METADATA_CACHE_SIZE, THIN_MAX_CONCURRENT_LOCKS); - if (!bm) { + if (IS_ERR(bm)) { + r = PTR_ERR(bm); DMERR("could not create block manager"); kfree(pmd); - return ERR_PTR(-ENOMEM); + return ERR_PTR(r); } r = superblock_all_zeroes(bm, &create); @@ -694,7 +695,6 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev, return ERR_PTR(r); } - r = init_pmd(pmd, bm, 0, create); if (r) { dm_block_manager_destroy(bm); |