From patchwork Tue Apr 24 23:37:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timofey Titovets X-Patchwork-Id: 10361205 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B41F960209 for ; Tue, 24 Apr 2018 23:41:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A371028DCC for ; Tue, 24 Apr 2018 23:41:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9849428E8F; Tue, 24 Apr 2018 23:41:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4652E28DCC for ; Tue, 24 Apr 2018 23:41:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751165AbeDXXlG (ORCPT ); Tue, 24 Apr 2018 19:41:06 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:40026 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750853AbeDXXlB (ORCPT ); Tue, 24 Apr 2018 19:41:01 -0400 Received: by mail-lf0-f68.google.com with SMTP id j16-v6so5563966lfb.7 for ; Tue, 24 Apr 2018 16:41:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XwsTKshkqhuMiCzmKb8pI6hKcoRjsSMMYZ40RV6elj0=; b=Ldf/Cr5RYkhUSdF6SDVy9MAbK/oettgXl8scA5Ur+Vah78EhIawCZ929ia05myBrPN HVh414S7UIhIGtB0m+eH65h6ZGqarjcxE/LikJInJmmAm9zxW0bHa1sEIw87Arla4IZy TwDuF1xIUFwtO4I57s44g/i8EzYHyDghEDJGOm6Pban2nWfAcW5SXHDEXsdin6a0rrM3 zPPIZu//45Zo3j04whl6+kcSiY6tuvlP7qCZe6+xVVtIQD4uvMxgLTGhQghOcuLXNOYy 3oDykvy+Seu6Vl+bI12qm3TPicWA0kdgecKsvR8T3WWcpqObuOXoOCSXX9+6GbpNRGIv xewA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XwsTKshkqhuMiCzmKb8pI6hKcoRjsSMMYZ40RV6elj0=; b=mGO5dv+4mX8W3LYbZIWh2h+iI7JJBNTcWd6R6nTZIOb3JMa2DLo91gwm2bx+Q5sPB9 ye9YRbBETPYO3D2bydlELnC2Jp/NIZGNfH0JP9ClrgHE/kEYDXARYMz1UhapxARKzBdS q49pcWNw1hsER3eKvRs987HT2omnntGmUmnEWFk+eCcwn8kiIWpuYpm1G1AEJaqIHyU2 dpSfrjEMfXCnwxdbXgdJ15M0RxPGBNAFY+KdKLcqitYJdO/6dwqMwSYBPaL/bkoJfsii gW/YEOs7oOL9pczoR+k7yuHpws84n0j+cmHiGX5CjLpgACF6qKy2Dy3DoY/C40n30p+I E+kw== X-Gm-Message-State: ALQs6tBJfSt2JRXt9ReSZ4yXpXrrf+zEaFusGrzFdNXgF0ny0VaM545H rrUaWnjFVzw+XNojuEDTKAX/Mg== X-Google-Smtp-Source: AB8JxZqQ2W6y1OdUD0vRqiXg9MiVfooXweRIEdChe7sY/Qiwxx2SXJbE6JUQmB73tDHdObPpokRhkw== X-Received: by 10.46.135.5 with SMTP id m5mr775665lji.62.1524613259374; Tue, 24 Apr 2018 16:40:59 -0700 (PDT) Received: from localhost.localdomain ([178.121.235.109]) by smtp.gmail.com with ESMTPSA id 66-v6sm3618547lfr.52.2018.04.24.16.40.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 16:40:58 -0700 (PDT) From: Timofey Titovets To: linux-btrfs@vger.kernel.org Cc: Timofey Titovets Subject: [PATCH 4/4] [RESEND] Btrfs: reduce size of struct btrfs_inode Date: Wed, 25 Apr 2018 02:37:17 +0300 Message-Id: <20180424233717.31283-5-nefelim4ag@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180424233717.31283-1-nefelim4ag@gmail.com> References: <20180424233717.31283-1-nefelim4ag@gmail.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently btrfs_inode have size equal 1136 bytes. (On x86_64). struct btrfs_inode store several vars releated to compression code, all states use 1 or 2 bits. Lets declare bitfields for compression releated vars, to reduce sizeof btrfs_inode to 1128 bytes. Signed-off-by: Timofey Titovets --- fs/btrfs/btrfs_inode.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 9eb0c92ee4b4..9d29d7e68757 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h @@ -181,13 +181,13 @@ struct btrfs_inode { /* * Cached values of inode properties */ - unsigned prop_compress; /* per-file compression algorithm */ + unsigned prop_compress : 2; /* per-file compression algorithm */ /* * Force compression on the file using the defrag ioctl, could be * different from prop_compress and takes precedence if set */ - unsigned defrag_compress; - unsigned change_compress; + unsigned defrag_compress : 2; + unsigned change_compress : 1; struct btrfs_delayed_node *delayed_node;