diff options
author | David Sterba <dsterba@suse.cz> | 2015-01-16 16:26:13 (GMT) |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2015-03-03 16:24:00 (GMT) |
commit | b8b93addde1e0192b045da8995e296fc1e40c80f (patch) | |
tree | d78234932a05c824c0feac2ada9bd0a3fce42f72 /fs/btrfs/extent-tree.c | |
parent | 3284da7b7b585e6e8e98f374a51d234d14c7a0a2 (diff) | |
download | linux-b8b93addde1e0192b045da8995e296fc1e40c80f.tar.xz |
btrfs: cleanup 64bit/32bit divs, provably bounded values
The divisor is derived from nodesize or PAGE_SIZE, fits into 32bit type.
Get rid of a few more do_div instances.
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 2cb32bc..4ccc339 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -5032,7 +5032,7 @@ static u64 calc_csum_metadata_size(struct inode *inode, u64 num_bytes, BTRFS_I(inode)->csum_bytes == 0) return 0; - old_csums = (int)div64_u64(BTRFS_I(inode)->csum_bytes, root->sectorsize); + old_csums = (int)div_u64(BTRFS_I(inode)->csum_bytes, root->sectorsize); if (reserve) BTRFS_I(inode)->csum_bytes += num_bytes; else @@ -5041,7 +5041,7 @@ static u64 calc_csum_metadata_size(struct inode *inode, u64 num_bytes, num_csums_per_leaf = (int)div_u64(csum_size, sizeof(struct btrfs_csum_item) + sizeof(struct btrfs_disk_key)); - num_csums = (int)div64_u64(BTRFS_I(inode)->csum_bytes, root->sectorsize); + num_csums = (int)div_u64(BTRFS_I(inode)->csum_bytes, root->sectorsize); num_csums = num_csums + num_csums_per_leaf - 1; num_csums = num_csums / num_csums_per_leaf; |