diff options
author | Mike Snitzer <snitzer@redhat.com> | 2018-09-14 04:16:20 +0300 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2018-09-17 18:49:34 +0300 |
commit | 013ad043906b2befd4a9bfb06219ed9fedd92716 (patch) | |
tree | acdb40e9deeef5a433b8c64533234bc49ea68f95 /drivers/md/dm-thin-metadata.c | |
parent | 7876320f88802b22d4e2daf7eb027dd14175a0f8 (diff) | |
download | linux-013ad043906b2befd4a9bfb06219ed9fedd92716.tar.xz |
dm thin metadata: fix __udivdi3 undefined on 32-bit
sector_div() is only viable for use with sector_t.
dm_block_t is typedef'd to uint64_t -- so use div_u64() instead.
Fixes: 3ab918281 ("dm thin metadata: try to avoid ever aborting transactions")
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-thin-metadata.c')
-rw-r--r-- | drivers/md/dm-thin-metadata.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index 74f6770c70b1..20b0776e39ef 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c @@ -832,10 +832,8 @@ static void __set_metadata_reserve(struct dm_pool_metadata *pmd) if (r) { DMERR("could not get size of metadata device"); pmd->metadata_reserve = max_blocks; - } else { - sector_div(total, 10); - pmd->metadata_reserve = min(max_blocks, total); - } + } else + pmd->metadata_reserve = min(max_blocks, div_u64(total, 10)); } struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev, |