Skip to content

Commit

Permalink
dm thin metadata: remove unused dm_thin_remove_block and __remove
Browse files Browse the repository at this point in the history
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Zhiqiang Liu authored and Mike Snitzer committed Feb 22, 2022
1 parent 8ca8b1e commit 75274a4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
28 changes: 0 additions & 28 deletions drivers/md/dm-thin-metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -1665,22 +1665,6 @@ int dm_thin_insert_block(struct dm_thin_device *td, dm_block_t block,
return r;
}

static int __remove(struct dm_thin_device *td, dm_block_t block)
{
int r;
struct dm_pool_metadata *pmd = td->pmd;
dm_block_t keys[2] = { td->id, block };

r = dm_btree_remove(&pmd->info, pmd->root, keys, &pmd->root);
if (r)
return r;

td->mapped_blocks--;
td->changed = true;

return 0;
}

static int __remove_range(struct dm_thin_device *td, dm_block_t begin, dm_block_t end)
{
int r;
Expand Down Expand Up @@ -1740,18 +1724,6 @@ static int __remove_range(struct dm_thin_device *td, dm_block_t begin, dm_block_
return dm_btree_insert(&pmd->tl_info, pmd->root, keys, &value, &pmd->root);
}

int dm_thin_remove_block(struct dm_thin_device *td, dm_block_t block)
{
int r = -EINVAL;

pmd_write_lock(td->pmd);
if (!td->pmd->fail_io)
r = __remove(td, block);
pmd_write_unlock(td->pmd);

return r;
}

int dm_thin_remove_range(struct dm_thin_device *td,
dm_block_t begin, dm_block_t end)
{
Expand Down
1 change: 0 additions & 1 deletion drivers/md/dm-thin-metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ int dm_pool_alloc_data_block(struct dm_pool_metadata *pmd, dm_block_t *result);
int dm_thin_insert_block(struct dm_thin_device *td, dm_block_t block,
dm_block_t data_block);

int dm_thin_remove_block(struct dm_thin_device *td, dm_block_t block);
int dm_thin_remove_range(struct dm_thin_device *td,
dm_block_t begin, dm_block_t end);

Expand Down

0 comments on commit 75274a4

Please sign in to comment.