From patchwork Thu Feb 22 23:39:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10236595 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 88C6C60349 for ; Thu, 22 Feb 2018 23:41:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7877A29084 for ; Thu, 22 Feb 2018 23:41:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 771C629091; Thu, 22 Feb 2018 23:41:01 +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 2547F2908B for ; Thu, 22 Feb 2018 23:41:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751317AbeBVXlA (ORCPT ); Thu, 22 Feb 2018 18:41:00 -0500 Received: from mail-io0-f193.google.com ([209.85.223.193]:40280 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751283AbeBVXlA (ORCPT ); Thu, 22 Feb 2018 18:41:00 -0500 Received: by mail-io0-f193.google.com with SMTP id v6so6785867iog.7; Thu, 22 Feb 2018 15:40:59 -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; bh=bb4UJ6jBi94uCaBIFhQBl1KS2JjGw3wzRrqnY+haieA=; b=oJbPaZnzMNdT+P5j3/RRJCCNerXnOoFeuD2I90oDHwda3wS1ZZNA7dZJjB1lWux7aH mPKxngghISXRymCnnheC/3wjHRJmm7NCdX8xOxI54X+wOn6DzUJQ/18c9UXJhv1Lu9Jv Umd/ildAEUJYHqT4PbziAnCRJiut3ECzMegksXWf3+JA2XtTjjcQ9Uj7/l1TWGy3txJ/ 1uK3ysvAfHzG+L+d0C7fzDH9HpwgHydaAz18pDgCevxJQVJFuLwi881ohzwJYdvhbAeZ Ny2I8vAjYQCGTuQ3W/JXBT+MLzer9nQb6oxkJomOx0625ZsJbcImghAcNvVV9+gtW+Se iT3Q== 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; bh=bb4UJ6jBi94uCaBIFhQBl1KS2JjGw3wzRrqnY+haieA=; b=Y/7XhSwMkgU0zdOk+Yqy2oPPN8UwcMciw16cUzW22E7+uvgkPyvDb52eKkpd8GPihH oMbcYbHGgvX9Tf27EpKYv0aVMqbR3HBjhaH6cZ1e8URWXy1Yk2lOtS+++L753O19L1zL yddCGXT1aJA86JeMrAV4zl/zHKkFYAdUAhY5XaMnh5YZ0Ss4SlCCk/x9ekOgCNjxo2cC 9g6yqbOEAjMAU8mL6tQYUcYABOYV/2YJ4OBqcuiwEsY3CUQ+TynPUliHV/3IvuUN7Jeb TI09wcp4ukoXcceSleJhUmPBhms6xhQv+TaKBDwp9NASFpxdM3Mkm/KvTjDrteGUriRQ fXmA== X-Gm-Message-State: APf1xPDItePNEpk916IWpvO8Hwo5TAXG/TBTYxEcz7DZCp8fHGZg9LQa qHCT8dDAVUv6LVW+v1K1ttFhAdza X-Google-Smtp-Source: AG47ELvHWHhCnAT592IFakh1IbSWFrjCsuvc7r7BKr7W3yJozd2RCNG1Bv6FoAQKVBsgS+6rHajxMg== X-Received: by 10.107.148.142 with SMTP id w136mr11084866iod.65.1519342859073; Thu, 22 Feb 2018 15:40:59 -0800 (PST) Received: from ebiggers-linuxstation.kir.corp.google.com ([2620:15c:17:3:dc28:5c82:b905:e8a8]) by smtp.gmail.com with ESMTPSA id i197sm699493ioe.54.2018.02.22.15.40.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Feb 2018 15:40:58 -0800 (PST) From: Eric Biggers To: linux-fscrypt@vger.kernel.org, "Theodore Y . Ts'o" Cc: linux-fsdevel@vger.kernel.org, Eric Biggers Subject: [PATCH] fs, fscrypt: only define ->s_cop when FS_ENCRYPTION is enabled Date: Thu, 22 Feb 2018 15:39:04 -0800 Message-Id: <20180222233904.70985-1-ebiggers3@gmail.com> X-Mailer: git-send-email 2.16.1.291.g4437f3f132-goog 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 2a815560fda0..ae0dae78d1c6 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1361,9 +1361,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;