From patchwork Tue Dec 19 10:02:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timofey Titovets X-Patchwork-Id: 10122907 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 7A9CA6019C for ; Tue, 19 Dec 2017 10:03:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A432290FB for ; Tue, 19 Dec 2017 10:03:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F6292919E; Tue, 19 Dec 2017 10:03:11 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 0D0E9290FB for ; Tue, 19 Dec 2017 10:03:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933438AbdLSKDI (ORCPT ); Tue, 19 Dec 2017 05:03:08 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:33160 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759693AbdLSKDB (ORCPT ); Tue, 19 Dec 2017 05:03:01 -0500 Received: by mail-wr0-f193.google.com with SMTP id v21so7738011wrc.0 for ; Tue, 19 Dec 2017 02:03:01 -0800 (PST) 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=G9olvzctB0dPrAWAApw/ZMl1Ikkigt6NYzwkzR137NFPgQjF7xHEriOXNJ/ljvs/cs 4gj/dUPHWjxACDa8gOVoyHrQ1bmNZePWKH3NoSAgu+a0X0Tm6HRAZgmiRr7PgTZZJgAl s4N2flHFucrELEnE3/2DEl+Q6VNiL83H7zPqUSHKukOXeDi95HLPxOZHhGLxaEU7cxTQ YP6SL6ev0X0FUWtSv7pwcxMoY1iFYUXPtZEO0ls8X4lHsAUcJtdiQ+VTLPm1cfvJVOXu lDOEMA+iwkDN0MSf/Y3zwrkWjYKz0S8TLrgQct0FKgQNZMRpXn2so+/kkMglXadDLjLl qZuA== 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=cjpZGONyRLx7lJAI2waWuMtPGeea87GtdU0j+fLYu8zX8E+UDvwD+tHfLEQ5exMfhe kncbNBHK+kqYPpuewzo26fXMuNzM2rFgzWEJiO/GD1eswRBMXRveeqhGu2M19mhf2f6n /ANREWsxzm24pg8ETo3t4jtAb9i2OK4iW3hqwSJkqwogXbKC8l3KcPGCGcYxCiF+nfji c6kqr1nyvdLmcwpoK2gogRg5JGUQM5wlb97iF1k+f3kQtF0XlKsw62INP2QgVhNpF8RY YLAu2p5JyUfehecwNGLGb3D0KZUqLPl4UrIQ8zUKyP78XMYypXDJkL0q/xO/WEgLjw6f FjJA== X-Gm-Message-State: AKGB3mL+Gk26HvIoFZ7zGIAwpYOGPkKE0KXZ/FuMe/oWzcqB8HRmped7 4au36GTthOW0tXZsAx3zXQUunA== X-Google-Smtp-Source: ACJfBosV7Kkwtm/y/b3I8GNqhjrtsVY6BFsowZhnd59ambWXkvDGal/9Yv59lqopyDQPdrHEHi3blQ== X-Received: by 10.223.185.79 with SMTP id b15mr4387126wrg.58.1513677780394; Tue, 19 Dec 2017 02:03:00 -0800 (PST) Received: from titovetst-beplan.itransition.corp ([93.171.6.182]) by smtp.gmail.com with ESMTPSA id s70sm1404372wma.37.2017.12.19.02.02.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Dec 2017 02:02:59 -0800 (PST) From: Timofey Titovets To: linux-btrfs@vger.kernel.org Cc: Timofey Titovets Subject: [PATCH 4/4] Btrfs: reduce size of struct btrfs_inode Date: Tue, 19 Dec 2017 13:02:47 +0300 Message-Id: <20171219100247.13880-5-nefelim4ag@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171219100247.13880-1-nefelim4ag@gmail.com> References: <20171219100247.13880-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;