From patchwork Mon Apr 30 22:51:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10373043 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 81A1760234 for ; Mon, 30 Apr 2018 22:57:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FA6B1FF83 for ; Mon, 30 Apr 2018 22:57:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63A91212DA; Mon, 30 Apr 2018 22:57:09 +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=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, 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 166121FF83 for ; Mon, 30 Apr 2018 22:57:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755288AbeD3W4o (ORCPT ); Mon, 30 Apr 2018 18:56:44 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:37330 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751384AbeD3W4k (ORCPT ); Mon, 30 Apr 2018 18:56:40 -0400 Received: by mail-pg0-f66.google.com with SMTP id a13-v6so7263318pgu.4; Mon, 30 Apr 2018 15:56:40 -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=GEosfGWQuVg7oJ/HbHUvmG3ZXuBEuIzteCd3eQ1w4/8=; b=maal8/Rb/KB8F7rCOuuFoMR4KK6qlZadXB307vGgUijuA/MbnLDxLpXU7swrzxC5CI 87GPkMDd0wZmyxGxHZDnTzMw/r0/TNY5JWccZXZF0rUG4rWZjpnfSKTpV1nogoLyxbLM J6V3BZpHz3oz9Kh6XbYW9LgfFdDTHqUej6zdgLaCNjmo4+dhaBVnGdAB9xtmPZFCbOdP qmxp7h43Zk/JQjxOJ779WRiZR1sclD0WYpHVwMvK++nVaZFc3stxRGbc6NSdulM9C0PF rm9pTtOPpfqUOBJ8vOMIkF3lBPwJ2LlGPLm3xV0YOTqzLtKzyv5/FS/aabynEW1QNLdF WuuQ== 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=GEosfGWQuVg7oJ/HbHUvmG3ZXuBEuIzteCd3eQ1w4/8=; b=rCcpxHytwWbW/JcIuB1SRcDgcuWMcM3d99i2JDghH/wEbnL9vjTU8doeeXrPwSPh9E yQAGbZcOwTa2L80l81T9pC+fbuBKsLidpGD2Xct9RFOYHY/xnL3mJd3sIVhrkIjZbEEB +Ith06ZvjSJrynHaYaFpknXKupIvSLl649g5hjCPO7/k/g7h4/O4k6k7Qv6RuzkKiKpy MoirC2n+VXzjjcP6/1MhqWv3qB6LBEZigjceHETMVf/moh9lMDnwrG1c/iFEG4dKdG0B /v1k+bTLwXj/6p6/HnpA3T5fOBj2fdgL06SSZf5jHf4evdLP+RxS00VA26nACG7KRHu7 SASA== X-Gm-Message-State: ALQs6tBJlAgIOsPyqXnNbblPGxyUB6KwlRo+U2WILCAwyc5ObfIyXGw5 aHxaszRApfOjk8d+jRZ/wESjUaAN X-Google-Smtp-Source: AB8JxZqTnkKbREjHoKDgeLQXzVqvQRxTgwzt7pyj2lt0BiIuKlhJamu8h9AINbCrj2Wi8/r11QbIuA== X-Received: by 2002:a63:69c3:: with SMTP id e186-v6mr11253248pgc.353.1525128999824; Mon, 30 Apr 2018 15:56:39 -0700 (PDT) Received: from ebiggers-linuxstation.kir.corp.google.com ([2620:15c:17:3:dc28:5c82:b905:e8a8]) by smtp.gmail.com with ESMTPSA id b15sm12969305pfi.111.2018.04.30.15.56.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Apr 2018 15:56:39 -0700 (PDT) From: Eric Biggers To: linux-fscrypt@vger.kernel.org, "Theodore Y . Ts'o" Cc: Jaegeuk Kim , linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, Eric Biggers Subject: [PATCH 01/15] fs, fscrypt: only define ->s_cop when FS_ENCRYPTION is enabled Date: Mon, 30 Apr 2018 15:51:35 -0700 Message-Id: <20180430225149.183514-2-ebiggers3@gmail.com> X-Mailer: git-send-email 2.17.0.441.gb46fe60e1d-goog In-Reply-To: <20180430225149.183514-1-ebiggers3@gmail.com> References: <20180430225149.183514-1-ebiggers3@gmail.com> Sender: linux-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers Now that filesystems only set and use their fscrypt_operations when they are built with encryption support, we can remove ->s_cop from 'struct super_block' when FS_ENCRYPTION is disabled. This saves a few bytes on some kernels and also makes it consistent with ->i_crypt_info. Signed-off-by: Eric Biggers --- include/linux/fs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 760d8da1b6c7..8e2460694c3a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1364,9 +1364,9 @@ struct super_block { void *s_security; #endif const struct xattr_handler **s_xattr; - +#if IS_ENABLED(CONFIG_FS_ENCRYPTION) const struct fscrypt_operations *s_cop; - +#endif struct hlist_bl_head s_roots; /* alternate root dentries for NFS */ struct list_head s_mounts; /* list of mounts; _not_ for fs use */ struct block_device *s_bdev;