diff options
author | Brett Holman <bholman.devel@gmail.com> | 2021-08-17 17:14:26 -0600 |
---|---|---|
committer | Brett Holman <bholman.devel@gmail.com> | 2021-08-18 16:56:17 -0600 |
commit | 4cfe4b643bd0a99ac09a7b2d580f9e19273eca5a (patch) | |
tree | 47b57564b3ce4c5fadccd143bbfc76b936744490 | |
parent | 3a680e1341a3755491543db6e53eb7d4fa21ee89 (diff) |
bcachefs: Fix 32 bit build failures
This fix replaces multiple 64 bit divisions with do_div() equivalents.
Signed-off-by: Brett Holman <bholman.devel@gmail.com>
-rw-r--r-- | fs/bcachefs/buckets.c | 2 | ||||
-rw-r--r-- | fs/bcachefs/tests.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 00aaed3f545f..c951c1dc10dd 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -666,7 +666,7 @@ static s64 ptr_disk_sectors(s64 sectors, struct extent_ptr_decoded p) return p.crc.compression_type && p.crc.compression_type != BCH_COMPRESSION_TYPE_incompressible - ? DIV_ROUND_UP(sectors * p.crc.compressed_size, + ? DIV_ROUND_UP_ULL(sectors * p.crc.compressed_size, p.crc.uncompressed_size) : sectors; } diff --git a/fs/bcachefs/tests.c b/fs/bcachefs/tests.c index 4d8d50fd7642..44b812dc4053 100644 --- a/fs/bcachefs/tests.c +++ b/fs/bcachefs/tests.c @@ -778,7 +778,7 @@ static int btree_perf_test_thread(void *data) wait_event(j->ready_wait, !atomic_read(&j->ready)); } - ret = j->fn(j->c, j->nr / j->nr_threads); + ret = j->fn(j->c, div64_u64(j->nr, j->nr_threads)); if (ret) j->ret = ret; @@ -854,11 +854,11 @@ int bch2_btree_perf_test(struct bch_fs *c, const char *testname, scnprintf(name_buf, sizeof(name_buf), "%s:", testname); bch2_hprint(&PBUF(nr_buf), nr); - bch2_hprint(&PBUF(per_sec_buf), nr * NSEC_PER_SEC / time); + bch2_hprint(&PBUF(per_sec_buf), div64_u64(nr * NSEC_PER_SEC, time)); printk(KERN_INFO "%-12s %s with %u threads in %5llu sec, %5llu nsec per iter, %5s per sec\n", name_buf, nr_buf, nr_threads, - time / NSEC_PER_SEC, - time * nr_threads / nr, + div_u64(time, NSEC_PER_SEC), + div_u64(time * nr_threads, nr), per_sec_buf); return j.ret; } |