diff options
author | David Sterba <dsterba@suse.cz> | 2015-01-16 11:21:12 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2015-03-03 11:23:57 -0500 |
commit | f8c269d7223f6b63cc5936eb191bc3b170d24342 (patch) | |
tree | 2e82cc23da9f436bbb6fde058b3321619f990db2 /fs/btrfs/disk-io.c | |
parent | 351810c1d2aafa288af61844d877941d516fb031 (diff) |
btrfs: cleanup 64bit/32bit divs, compile time constants
Switch to div_u64 if the divisor is a numeric constant or sum of
sizeof()s. We can remove a few instances of do_div that has the hidden
semtantics of changing the 1st argument.
Small power-of-two divisors are converted to bitshifts, large values are
kept intact for clarity.
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 41b320e235d7..73b152138221 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -2277,7 +2277,7 @@ int open_ctree(struct super_block *sb, | |||
2277 | fs_info->free_chunk_space = 0; | 2277 | fs_info->free_chunk_space = 0; |
2278 | fs_info->tree_mod_log = RB_ROOT; | 2278 | fs_info->tree_mod_log = RB_ROOT; |
2279 | fs_info->commit_interval = BTRFS_DEFAULT_COMMIT_INTERVAL; | 2279 | fs_info->commit_interval = BTRFS_DEFAULT_COMMIT_INTERVAL; |
2280 | fs_info->avg_delayed_ref_runtime = div64_u64(NSEC_PER_SEC, 64); | 2280 | fs_info->avg_delayed_ref_runtime = NSEC_PER_SEC >> 6; /* div by 64 */ |
2281 | /* readahead state */ | 2281 | /* readahead state */ |
2282 | INIT_RADIX_TREE(&fs_info->reada_tree, GFP_NOFS & ~__GFP_WAIT); | 2282 | INIT_RADIX_TREE(&fs_info->reada_tree, GFP_NOFS & ~__GFP_WAIT); |
2283 | spin_lock_init(&fs_info->reada_lock); | 2283 | spin_lock_init(&fs_info->reada_lock); |