From patchwork Tue Jan 26 16:33:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byongho Lee X-Patchwork-Id: 8124741 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 108F2BEEE5 for ; Tue, 26 Jan 2016 16:33:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4750220265 for ; Tue, 26 Jan 2016 16:33:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 12B4920173 for ; Tue, 26 Jan 2016 16:33:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966725AbcAZQdX (ORCPT ); Tue, 26 Jan 2016 11:33:23 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35215 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966504AbcAZQdV (ORCPT ); Tue, 26 Jan 2016 11:33:21 -0500 Received: by mail-pf0-f196.google.com with SMTP id q63so1132477pfb.2 for ; Tue, 26 Jan 2016 08:33:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=V96y5QUYUQib3xi7Z5xvkF77mUsnL4dEyb/w9+onfNU=; b=qxby+CG9yKuK1f2YmW5gGplK32sb7Lj/d9K3xGMhzWi0k2eJyKKs4InpxUDGJqTugx V6x2h7rIZdroJ5gJg/TboR0eLvuOnEjVhldR5ZKsxl5oLqpGeltHUInCkNJIzRRRgICe vTJ4gAYvtdu6MqW3cTlQCeLAELO0/cs/2ZEm/CC+Uafd48AEADvJ942NyQ/0bbbRO9lI hFEAJ24FDm+Hb2xF7mL9x8a2YOLkR+fW0Iwf/DHtsDov4K8Pe6JTicXbV15UQXKUvnej nuizfjDq62ExzN1yTyVeqf5Y8B+EeIJTUilWt6iIguezKAgN6RUuY2BNKhhtfl1ncqEv V7xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=V96y5QUYUQib3xi7Z5xvkF77mUsnL4dEyb/w9+onfNU=; b=mRq//MD3pOlH8PxkpkF4tlXMbrwSy9nVgd40DaUVMhNoAHZNsbdZ49cRzTet8lgXgc 7NgbPve3qxIZfu71T3fxGy2QySPVrhjxOevsBCt0BQZIeMzCU3YTwb115YRhhX/nXmb4 +ePaB5CIZS4rFDfwO26dKovIfcDoX4lt7pLdMru0/SsGimJTyT9nA/LLN3Z7kxhNkoQ/ KoFg4waIz5oGPQscoRktzKPS+ZMB4cHVHURdJX0VSfMqc395dcwYExfj1ZLDA0ll3GDk qIHqCXp+cprIPfIRKh5mS6CwOx3E35jsMaoZp88oU0mTAVog6n0+vTN+o548HC0u3CPG +VaQ== X-Gm-Message-State: AG10YOT9g9jlj5MpJwa61spcge+L8KesjMYe1TqbF4vtLzC9OV4SKgjmjBdcGbapYeVROA== X-Received: by 10.98.19.130 with SMTP id 2mr35028198pft.31.1453826001452; Tue, 26 Jan 2016 08:33:21 -0800 (PST) Received: from arch-gct.localdomain ([175.114.213.172]) by smtp.gmail.com with ESMTPSA id kw10sm2956717pab.0.2016.01.26.08.33.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Jan 2016 08:33:19 -0800 (PST) From: Byongho Lee To: linux-btrfs@vger.kernel.org, dsterba@suse.cz Subject: [PATCH v2] btrfs: simplify expression in btrfs_calc_trans_metadata_size() Date: Wed, 27 Jan 2016 01:33:04 +0900 Message-Id: <1453825984-12100-1-git-send-email-bhlee.kernel@gmail.com> X-Mailer: git-send-email 2.7.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Simplify expression in btrfs_calc_trans_metadata_size(). Signed-off-by: Byongho Lee Reviewed-by: Stefan Behrens --- v2: Fix wrong function's name in commit log. --- 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; } /*