Source
1671
1671
int r = -EINVAL;
1672
1672
1673
1673
down_write(&td->pmd->root_lock);
1674
1674
if (!td->pmd->fail_io)
1675
1675
r = __remove_range(td, begin, end);
1676
1676
up_write(&td->pmd->root_lock);
1677
1677
1678
1678
return r;
1679
1679
}
1680
1680
1681
-
int dm_pool_block_is_used(struct dm_pool_metadata *pmd, dm_block_t b, bool *result)
1681
+
int dm_pool_block_is_shared(struct dm_pool_metadata *pmd, dm_block_t b, bool *result)
1682
1682
{
1683
1683
int r;
1684
1684
uint32_t ref_count;
1685
1685
1686
1686
down_read(&pmd->root_lock);
1687
1687
r = dm_sm_get_count(pmd->data_sm, b, &ref_count);
1688
1688
if (!r)
1689
-
*result = (ref_count != 0);
1689
+
*result = (ref_count > 1);
1690
1690
up_read(&pmd->root_lock);
1691
1691
1692
1692
return r;
1693
1693
}
1694
1694
1695
1695
int dm_pool_inc_data_range(struct dm_pool_metadata *pmd, dm_block_t b, dm_block_t e)
1696
1696
{
1697
1697
int r = 0;
1698
1698
1699
1699
down_write(&pmd->root_lock);