Skip to contentSkip to conversation

btrfs: simplify expression in btrfs_calc_trans_metadata_size()

PATCH New Byongho Lee 1 participant 1 message Jan 26, 2016 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 btrfs: simplify expression in btrfs_calc_trans_metadata_size()

Simplify expression in btrfs_calc_trans_metadata_size().

---
v2:
Fix wrong function's name in commit log.

---
 fs/btrfs/ctree.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/btrfs/ctree.h +1 -2
index a9496644f47d..3ab8026280a2 100644
@@ -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;
 }
 
 /*
Signature · 1 line
2.7.0