]> www.infradead.org Git - users/hch/block.git/commit
bcachefs: Replace div_u64 with div64_u64 where second param is u64
authorReed Riley <reed@riley.engineer>
Thu, 5 Sep 2024 16:59:29 +0000 (16:59 +0000)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 9 Sep 2024 13:41:47 +0000 (09:41 -0400)
commit27663d7784b5dfd354a968e06b26452dc93f2a16
treec14c75f9e3bb1cd454b8137f1ff6b9744522c735
parent36f0af4f44a4e465b0af4bf188d780511c1ca189
bcachefs: Replace div_u64 with div64_u64 where second param is u64

Bcachefs often uses this function to divide by nanosecond times - which
can easily cause problems when cast to u32.  For example, `cat
/sys/fs/bcachefs/*/internal/rebalance_status` would return invalid data
in the `duration waited` field because dividing by the number of
nanoseconds in a minute requires the divisor parameter to be u64.

Signed-off-by: Reed Riley <reed@riley.engineer>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/sysfs.c
fs/bcachefs/util.c