btrfs: Fix 64-bit divisions in btrfs_commit_stats_show() on 32-bit
PATCH 1/1 btrfs: Fix 64-bit divisions in btrfs_commit_stats_show() on 32-bit
On 32-bit (e.g. m68k):
ERROR: modpost: "__udivdi3" [fs/btrfs/btrfs.ko] undefined!
Fix this by using div_u64() instead.
Reported-by [email protected]
Fixes e665ec2ab6e1ae36 ("btrfs: Expose the BTRFS commit stats through sysfs")
Signed-off-by Geert Uytterhoeven <[email protected]>
--- fs/btrfs/sysfs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
fs/btrfs/sysfs.c +4 -3
@@ -9,6 +9,7 @@#include <linux/spinlock.h> #include <linux/completion.h> #include <linux/bug.h> +#include <linux/math64.h> #include <crypto/hash.h> #include "ctree.h"
@@ -1002,9 +1003,9 @@ static ssize_t btrfs_commit_stats_show(struct kobject *kobj,"max_commit_ms %llu\n" "total_commit_ms %llu\n" , fs_info->commit_stats.commit_count, - fs_info->commit_stats.last_commit_dur /NSEC_PER_MSEC , - fs_info->commit_stats.max_commit_dur /NSEC_PER_MSEC , - fs_info->commit_stats.total_commit_dur / NSEC_PER_MSEC); +div_u64 (fs_info->commit_stats.last_commit_dur,NSEC_PER_MSEC ), +div_u64 (fs_info->commit_stats.max_commit_dur,NSEC_PER_MSEC ), + div_u64(fs_info->commit_stats.total_commit_dur, NSEC_PER_MSEC)); } static ssize_t btrfs_commit_stats_store(struct kobject *kobj,
Signature · 1 line
2.25.1
Quoted 9 lines · Geert Uytterhoeven
On 32-bit (e.g. m68k):
ERROR: modpost: "
__udivdi3" [fs/btrfs/btrfs.ko] undefined!Fix this by using
div_u64()instead.Reported-by [email protected]Fixes e665ec2ab6e1ae36 ("btrfs: Expose the BTRFS commit stats through sysfs")Signed-off-by Geert Uytterhoeven <[email protected]>
Folded to the patch, thanks.