Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1305219iog; Thu, 16 Jun 2022 03:39:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tjeAV2d06dVrtd+JpNBy1ga7F3eLF3zR+VFQW68a66mwMQAfwMgNhNBKJ17q7LpQ47Dbfn X-Received: by 2002:a17:902:d509:b0:167:6ed8:afb5 with SMTP id b9-20020a170902d50900b001676ed8afb5mr4037069plg.137.1655375947665; Thu, 16 Jun 2022 03:39:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655375947; cv=none; d=google.com; s=arc-20160816; b=nyOXTR1pmAISCIC1pX3Z0u2oupk8iDgTmRaqe2xm9wRl8pcY8iI6G4hidl60H5s4gD c4JrTy+TOFv8/wRBIRLEOYnuVb9MXV1k44J2YFFniyyaS6QvgWBw+ZCvyVksjlmQPh2d vG29CneDHN+COXioUNF6Sc87S9e3ceVVDcepTMhFsIAOT7DsI2BwPL7SL0Uv3s2aRRZI 7Xi1MimkKCtQxezuBzSGDSGsLVjiVF0tc6jhmPDtcxNksYmMDFWuyIdXdaAVJTjik0Cw kbD494dva0jsYCy7Ho3s+erBJpytabpwxj7St9xEKd8I60dMPAT2zdQ2m+1qQUKdTGhy pi+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=NkPbXOywn4eKNE1i/84MylJKzvwI8aAV6tmfIQSWrt0=; b=LJoB2akh4afA23gyIo/KMSvjEjpL9OZAOb0WONNIhZY+CJEwEpQimw2nmY52aJlB4C 7DnEg0htOdcIYKMlU9gisnvl+aAYMioCVKFU8BaNWPQ2ulKHrC0MWvl62EVf2LX90hpw N6Bcbe0q5fBUlemTGF63ua/8Xkh48kqmvr8bUhRCj3/BdjEOshA4Sa6vAe5o1dEfzhf9 a0bMWTba732u1Bt09oQfD/co6NkUc4fetNhsLYOs6Qz8CWNp+cx5VseCyDXU99k40wG1 7/yB9dCj18IGByGahn5HMn0w5FJFAr0jd5/Hw4gEbrS1utNidFnKLbHi74vn/Uw9ITN+ YyiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t2-20020a170902b20200b00163f215e3dbsi1786310plr.341.2022.06.16.03.38.52; Thu, 16 Jun 2022 03:39:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229717AbiFPKcs (ORCPT + 99 others); Thu, 16 Jun 2022 06:32:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbiFPKcr (ORCPT ); Thu, 16 Jun 2022 06:32:47 -0400 Received: from michel.telenet-ops.be (michel.telenet-ops.be [IPv6:2a02:1800:110:4::f00:18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9657B1582F for ; Thu, 16 Jun 2022 03:32:44 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed30:5439:2bcc:4a70:48e8]) by michel.telenet-ops.be with bizsmtp id jmYi270064lJ8fu06mYioK; Thu, 16 Jun 2022 12:32:42 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1o1mRv-004AbF-4n; Thu, 16 Jun 2022 12:10:03 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1o1kY2-007ZgO-8u; Thu, 16 Jun 2022 10:08:14 +0200 From: Geert Uytterhoeven To: Ioannis Angelakopoulos , Chris Mason , Josef Bacik , David Sterba Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] btrfs: Fix 64-bit divisions in btrfs_commit_stats_show() on 32-bit Date: Thu, 16 Jun 2022 10:08:14 +0200 Message-Id: <20220616080814.1805417-1-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 32-bit (e.g. m68k): ERROR: modpost: "__udivdi3" [fs/btrfs/btrfs.ko] undefined! Fix this by using div_u64() instead. Reported-by: noreply@ellerman.id.au Fixes: e665ec2ab6e1ae36 ("btrfs: Expose the BTRFS commit stats through sysfs") Signed-off-by: Geert Uytterhoeven --- fs/btrfs/sysfs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index bce2573b02861149..a24cf7e0900a23cb 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #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, -- 2.25.1