Re: [PATCH] btrfs: simplify expression in btrfs_csum_bytes_to_leaves()
From: Stefan Behrens <hidden>
Date: 2016-01-26 08:16:46
From: Stefan Behrens <hidden>
Date: 2016-01-26 08:16:46
The result of the calculation is different, which doesn't look right. On Tue, 26 Jan 2016 16:13:17 +0900, Byongho Lee wrote:
Simplify expression in btrfs_csum_bytes_to_leaves(). Signed-off-by: Byongho Lee <redacted> --- fs/btrfs/ctree.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index a9496644f47d..3ab8026280a2 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h@@ -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; } /*