* [PATCH] f2fs: fix building on 32-bit architectures
@ 2015-05-13 20:49 Arnd Bergmann
2015-05-14 0:23 ` Jaegeuk Kim
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2015-05-13 20:49 UTC (permalink / raw)
To: Jaegeuk Kim
Cc: linux-kernel, linux-arm-kernel, Yossi Goldfill, linux-f2fs-devel,
Changman Lee
A bug fix to the debug output extended the type of some local
variables to 64-bit, which now causes the kernel to fail building
because of missing 64-bit division functions:
ERROR: "__aeabi_uldivmod" [fs/f2fs/f2fs.ko] undefined!
In the kernel, we have to use div_u64 or do_div to do this,
in order to annotate that this is an expensive operation.
As the function is only called for debug out, we know this
is not performance critical, so it is safe to use div_u64.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: d1f85bd38db19 ("f2fs: avoid value overflow in showing current status")
---
This patch is required for ARM allmodconfig builds.
diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
index efbc83f07305..75176e0dd6c8 100644
--- a/fs/f2fs/debug.c
+++ b/fs/f2fs/debug.c
@@ -113,10 +113,10 @@ static void update_sit_info(struct f2fs_sb_info *sbi)
ndirty++;
}
}
- dist = MAIN_SECS(sbi) * hblks_per_sec * hblks_per_sec / 100;
- si->bimodal = bimodal / dist;
+ dist = div_u64(MAIN_SECS(sbi) * hblks_per_sec * hblks_per_sec, 100);
+ si->bimodal = div_u64(bimodal, dist);
if (si->dirty_count)
- si->avg_vblocks = total_vblocks / ndirty;
+ si->avg_vblocks = div_u64(total_vblocks, ndirty);
else
si->avg_vblocks = 0;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] f2fs: fix building on 32-bit architectures
2015-05-13 20:49 [PATCH] f2fs: fix building on 32-bit architectures Arnd Bergmann
@ 2015-05-14 0:23 ` Jaegeuk Kim
0 siblings, 0 replies; 2+ messages in thread
From: Jaegeuk Kim @ 2015-05-14 0:23 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-f2fs-devel, linux-kernel, linux-arm-kernel, Yossi Goldfill
Hi Arnd,
Thank you for the patch.
Merged and pushed to -next. :)
Thanks,
On Wed, May 13, 2015 at 10:49:58PM +0200, Arnd Bergmann wrote:
> A bug fix to the debug output extended the type of some local
> variables to 64-bit, which now causes the kernel to fail building
> because of missing 64-bit division functions:
>
> ERROR: "__aeabi_uldivmod" [fs/f2fs/f2fs.ko] undefined!
>
> In the kernel, we have to use div_u64 or do_div to do this,
> in order to annotate that this is an expensive operation.
>
> As the function is only called for debug out, we know this
> is not performance critical, so it is safe to use div_u64.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: d1f85bd38db19 ("f2fs: avoid value overflow in showing current status")
> ---
> This patch is required for ARM allmodconfig builds.
>
> diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
> index efbc83f07305..75176e0dd6c8 100644
> --- a/fs/f2fs/debug.c
> +++ b/fs/f2fs/debug.c
> @@ -113,10 +113,10 @@ static void update_sit_info(struct f2fs_sb_info *sbi)
> ndirty++;
> }
> }
> - dist = MAIN_SECS(sbi) * hblks_per_sec * hblks_per_sec / 100;
> - si->bimodal = bimodal / dist;
> + dist = div_u64(MAIN_SECS(sbi) * hblks_per_sec * hblks_per_sec, 100);
> + si->bimodal = div_u64(bimodal, dist);
> if (si->dirty_count)
> - si->avg_vblocks = total_vblocks / ndirty;
> + si->avg_vblocks = div_u64(total_vblocks, ndirty);
> else
> si->avg_vblocks = 0;
> }
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-14 0:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-13 20:49 [PATCH] f2fs: fix building on 32-bit architectures Arnd Bergmann
2015-05-14 0:23 ` Jaegeuk Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).