Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75b870ff authored by Paul Keith's avatar Paul Keith Committed by derfelot
Browse files

fs: sdfat: Fix compilation for 32-bit targets

This commit was accidentally reverted during the update to 2.0.8. Re-apply it to keep in line with the kernel-sdfat repo.
parent 932355d5
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -325,6 +325,7 @@ int amap_create(struct super_block *sb, u32 pack_ratio, u32 sect_per_au, u32 hid
	int i, i_clu, i_au;
	int i_au_root = -1, i_au_hot_from = INT_MAX;
	u32 misaligned_sect = hidden_sect;
	u64 tmp;

	BUG_ON(!fsi->bd_opened);

@@ -383,7 +384,9 @@ int amap_create(struct super_block *sb, u32 pack_ratio, u32 sect_per_au, u32 hid

	amap->sb = sb;

	amap->n_au = (fsi->num_sectors + misaligned_sect + sect_per_au - 1) / sect_per_au;
	tmp = fsi->num_sectors + misaligned_sect + sect_per_au - 1;
	do_div(tmp, sect_per_au);
	amap->n_au = tmp;
	amap->n_clean_au = 0;
	amap->n_full_au = 0;