btrfs: simplify expression in btrfs_calc_trans_metadata_size()
authorByongho Lee <bhlee.kernel@gmail.com>
Tue, 26 Jan 2016 16:33:04 +0000 (01:33 +0900)
committerDavid Sterba <dsterba@suse.com>
Thu, 18 Feb 2016 10:33:17 +0000 (11:33 +0100)
Simplify expression in btrfs_calc_trans_metadata_size().

Signed-off-by: Byongho Lee <bhlee.kernel@gmail.com>
Reviewed-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h

index bfe4a337fb4d13a058446265b7baf4a1437aa602..91449e41d88d927ec070e0e3c8cdaa8d503a7c77 100644 (file)
@@ -3448,8 +3448,7 @@ u64 btrfs_csum_bytes_to_leaves(struct btrfs_root *root, u64 csum_bytes);
 static inline u64 btrfs_calc_trans_metadata_size(struct btrfs_root *root,
                                                 unsigned num_items)
 {
-       return (root->nodesize + root->nodesize * (BTRFS_MAX_LEVEL - 1)) *
-               2 * num_items;
+       return root->nodesize * BTRFS_MAX_LEVEL * 2 * num_items;
 }
 
 /*