diff options
author | Todd Poynor <toddpoynor@google.com> | 2013-04-05 14:28:28 -0700 |
---|---|---|
committer | Todd Poynor <toddpoynor@google.com> | 2013-04-05 16:57:53 -0700 |
commit | 7f2aad725951de989ffe30eb4617e39763db8ace (patch) | |
tree | 602fd781f5a7a80fb73a30dae88af7bdd0e306ee | |
parent | 12b868488bc5abfb5fc0910aa34b32d6209073df (diff) | |
download | kernel_goldelico_gta04-7f2aad725951de989ffe30eb4617e39763db8ace.zip kernel_goldelico_gta04-7f2aad725951de989ffe30eb4617e39763db8ace.tar.gz kernel_goldelico_gta04-7f2aad725951de989ffe30eb4617e39763db8ace.tar.bz2 |
ext4: fixup 64-bit divides in 3.0-stable backport of upstream fix
Replace C division operators with div64_u64 for divides introduced in:
commit 503f4bdcc078e7abee273a85ce322de81b18a224
ext4: use atomic64_t for the per-flexbg free_clusters count
Specific to the 3.0-stable backport of the upstream patch.
Change-Id: Id10180ed16f54f58fc18531092e88f52fc6de31c
Reviewed-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
-rw-r--r-- | fs/ext4/ialloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index dd732c7..443ffb8 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -22,6 +22,7 @@ #include <linux/random.h> #include <linux/bitops.h> #include <linux/blkdev.h> +#include <linux/math64.h> #include <asm/byteorder.h> #include "ext4.h" @@ -356,7 +357,7 @@ static int find_group_flex(struct super_block *sb, struct inode *parent, find_close_to_parent: flexbg_free_blocks = atomic64_read(&flex_group[best_flex].free_blocks); - flex_freeb_ratio = flexbg_free_blocks * 100 / blocks_per_flex; + flex_freeb_ratio = div64_u64(flexbg_free_blocks * 100, blocks_per_flex); if (atomic_read(&flex_group[best_flex].free_inodes) && flex_freeb_ratio > free_block_ratio) goto found_flexbg; @@ -371,7 +372,7 @@ find_close_to_parent: continue; flexbg_free_blocks = atomic64_read(&flex_group[i].free_blocks); - flex_freeb_ratio = flexbg_free_blocks * 100 / blocks_per_flex; + flex_freeb_ratio = div64_u64(flexbg_free_blocks * 100, blocks_per_flex); if (flex_freeb_ratio > free_block_ratio && (atomic_read(&flex_group[i].free_inodes))) { |