Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/6] Avoid 64-bit divisions that need __udivdi3() or __umoddi3()
@ 2026-11-25 12:42 Josef Schlehofer
  2026-11-25 12:42 ` [PATCH 1/6] fs: btrfs: Avoid a 64-bit modulo in __btrfs_devread() Josef Schlehofer
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Josef Schlehofer @ 2026-11-25 12:42 UTC (permalink / raw)
  To: u-boot
  Cc: Tom Rini, Christophe Leroy (CS GROUP), Bradley Morgan,
	Marek Behún, Qu Wenruo, Joao Marcos Costa, Richard Genoud,
	Thomas Petazzoni, Miquel Raynal, Peng Fan, Jaehoon Chung,
	Tanmay Kathpalia, linux-btrfs

U-Boot's private libgcc does not provide __udivdi3() and __umoddi3().
v3 of the mpc85xx LTO series links mpc85xx LTO builds with it and added
both routines [1]. Christophe Leroy asked why the callers do not avoid
'/' and '%' on 64-bit operands instead, and Tom Rini asked to update
the common code [2].

Patches 1-4 avoid the divisions that make the mpc85xx LTO builds call
__udivdi3() or __umoddi3(), in btrfs, squashfs, mmc_berase() and
get_win_cnt() of the mpc8xxx PAMU code. They do not depend on each
other. Patch 5 removes fs/btrfs/dev.c, which nothing uses and which
holds another 64-bit modulo. Patch 6 converts the remaining divisions
in btrfs. U-Boot never runs them, but builds without LTO still link the
ones in the RAID5/6 code. My reply in that thread announced these
conversions for v4 of the LTO series. They are sent on their own
instead.

Patch 2 and my big-endian fix for squashfs [3] conflict in
sqfs_read_nest(). I will rebase whichever of them goes in second.

Build tested with a buildman world build on a fork's CI, and sandbox
test.py gives the same results as before. Run tested on qemu-ppce500
(btrfs) and qemu_arm (btrfs, squashfs, mmc erase), and on a Turris 1.1
with the mpc85xx LTO patches on top, which boots from an SD card and
loads files from btrfs. The PAMU change is build tested only.

[1] https://lore.kernel.org/u-boot/20261119133310.22732-5-pepe.schlehofer@gmail.com/
[2] https://lore.kernel.org/u-boot/20261119200924.GB3176972@bill-the-cat/
[3] https://lore.kernel.org/u-boot/20261125095537.37979-1-pepe.schlehofer@gmail.com/

Josef Schlehofer (6):
  fs: btrfs: Avoid a 64-bit modulo in __btrfs_devread()
  fs/squashfs: Avoid 64-bit divisions
  mmc: Use div_u64() in mmc_berase()
  powerpc: mpc8xxx: Avoid a 64-bit division in get_win_cnt()
  fs: btrfs: Remove the unused dev.c
  fs: btrfs: Avoid the remaining 64-bit divisions

 arch/powerpc/cpu/mpc8xxx/fsl_pamu.c |  2 +-
 drivers/mmc/mmc_write.c             |  2 +-
 fs/btrfs/Makefile                   |  2 +-
 fs/btrfs/compat.h                   |  8 ++------
 fs/btrfs/dev.c                      | 25 -------------------------
 fs/btrfs/volumes.c                  | 19 +++++++++++--------
 fs/btrfs/volumes.h                  |  9 +++++----
 fs/squashfs/sqfs.c                  | 21 +++++++++++----------
 fs/squashfs/sqfs_inode.c            |  5 +++--
 9 files changed, 35 insertions(+), 58 deletions(-)
 delete mode 100644 fs/btrfs/dev.c


base-commit: 79497816056122c49b3b135e14cbac59374e636c
-- 
2.54.0 (Apple Git-157)


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-11-26  9:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 12:42 [PATCH 0/6] Avoid 64-bit divisions that need __udivdi3() or __umoddi3() Josef Schlehofer
2026-11-25 12:42 ` [PATCH 1/6] fs: btrfs: Avoid a 64-bit modulo in __btrfs_devread() Josef Schlehofer
2026-11-25 20:11   ` Qu Wenruo
2026-11-25 12:42 ` [PATCH 5/6] fs: btrfs: Remove the unused dev.c Josef Schlehofer
2026-11-25 20:14   ` Qu Wenruo
2026-11-26  9:15     ` Josef Schlehofer
2026-11-26  9:20       ` Qu Wenruo
2026-11-25 12:42 ` [PATCH 6/6] fs: btrfs: Avoid the remaining 64-bit divisions Josef Schlehofer
2026-11-25 20:15   ` Qu Wenruo
2026-11-25 15:45 ` [PATCH 0/6] Avoid 64-bit divisions that need __udivdi3() or __umoddi3() Bradley Morgan
2026-11-25 15:51   ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox