From patchwork Wed Sep 20 22:45:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9962869 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 A4D176056A for ; Wed, 20 Sep 2017 22:50:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96FD428A28 for ; Wed, 20 Sep 2017 22:50:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C0C32924A; Wed, 20 Sep 2017 22:50:10 +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, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=unavailable 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 40D1029158 for ; Wed, 20 Sep 2017 22:50:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751999AbdITWuH (ORCPT ); Wed, 20 Sep 2017 18:50:07 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:34858 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751799AbdITWq4 (ORCPT ); Wed, 20 Sep 2017 18:46:56 -0400 Received: by mail-pf0-f194.google.com with SMTP id i23so1721218pfi.2; Wed, 20 Sep 2017 15:46:56 -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=MFzqJPTBM9fATpbCj1G1R6q2eqPueC9M9keqxOOH+CI=; b=T1MN2p+QWVqe7J199P+C/wgLIrUGBCcIOGaHif7LdWVwAC/5GkJfn9rDi6kCh9ko1G WgewNp62f1e2n790usAbMfq4PLNlZoMeKuaQWK2Y/L3uO3h3ZAh+11NkiQmxQXsamugi rz7EUV2Vld49iAYMpzc1Df/yHB19iGjGMUtcf+lYIbbHwuSDiQaJ8xFVMcSWzPs4UNBV 9zgA6zoY6RnmzQQg97Ga2O9T1xgBDUqzppIBds6eOfXKBLUG192exMH+ar+ARqFRPRyN cj7rZECyWEBQQsjvo3enZZ0Q3ew7DX2pr4pTjtuPCkF1FdPI26lm9LNR0ljhVNdXGQza kE0g== 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=MFzqJPTBM9fATpbCj1G1R6q2eqPueC9M9keqxOOH+CI=; b=jKana9UJpOjTn5hbPMxrgqioBrw2EKYBiz3ce2xYC6JHKl2QnPVMSvQNoR/DbmGGAE R8IaDqqVFYMEo2BXIDM4L9HMSOiTg9fTyxXsFQVR5RQsp/rmD7rhSDUCRe8IPggTq3+J sOE3WEEyqIX8/uLBss64bfdlyFaQ3aH0/+a8ShJALWYMQspln6hND0A5ONfTXZwd/rec n/0c2eeSJ3vRcqLmQmp8uqoHJ2v90I7zA3EQNJ6UityP3ThsXu9WmnzSxD8oX3ke2dGp AgipdD5X+wbDqaqmQLSTNcLwW1qI1UOvH8bztX6Z2wXA5g6Ksc3Nz9YX3UV/owlzFgcW Y3Mg== X-Gm-Message-State: AHPjjUhsrO24oRpqi1ya5putcuWVkte8ewwgLy2XAqP4eNe/CC/k11Dr xqoSTw5QF76ns9j0s9cDNLSECUz3cdI= X-Google-Smtp-Source: AOwi7QBvaEXywaWbPrbZC2q4FHGeQS7Li62DVLnS06ZS2mDKr0CJJekqsKjGtEx+kBuln+hJ+uFAFQ== X-Received: by 10.159.216.146 with SMTP id s18mr3499414plp.451.1505947615604; Wed, 20 Sep 2017 15:46:55 -0700 (PDT) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.66.174.81]) by smtp.gmail.com with ESMTPSA id j2sm6249pgn.26.2017.09.20.15.46.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Sep 2017 15:46:55 -0700 (PDT) From: Eric Biggers To: linux-fscrypt@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, "Theodore Y . Ts'o" , Jaegeuk Kim , Michael Halcrow , Eric Biggers Subject: [PATCH 04/25] fscrypt: remove unneeded empty fscrypt_operations structs Date: Wed, 20 Sep 2017 15:45:44 -0700 Message-Id: <20170920224605.22030-5-ebiggers3@gmail.com> X-Mailer: git-send-email 2.14.1.821.g8fa685d3b7-goog In-Reply-To: <20170920224605.22030-1-ebiggers3@gmail.com> References: <20170920224605.22030-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 In the case where a filesystem has been configured without encryption support, there is no longer any need to initialize ->s_cop at all, since none of the methods are ever called. Signed-off-by: Eric Biggers --- fs/ext4/super.c | 5 ++--- fs/f2fs/super.c | 5 ++--- fs/ubifs/super.c | 7 ++----- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index bc63cdf194e3..04f3670748e7 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1244,9 +1244,6 @@ static const struct fscrypt_operations ext4_cryptops = { .empty_dir = ext4_empty_dir, .max_namelen = ext4_max_namelen, }; -#else -static const struct fscrypt_operations ext4_cryptops = { -}; #endif #ifdef CONFIG_QUOTA @@ -3998,7 +3995,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sb->s_op = &ext4_sops; sb->s_export_op = &ext4_export_ops; sb->s_xattr = ext4_xattr_handlers; +#ifdef CONFIG_EXT4_FS_ENCRYPTION sb->s_cop = &ext4_cryptops; +#endif #ifdef CONFIG_QUOTA sb->dq_op = &ext4_quota_operations; if (ext4_has_feature_quota(sb)) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 1cb41f711ab8..c1c7183b3527 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1597,9 +1597,6 @@ static const struct fscrypt_operations f2fs_cryptops = { .empty_dir = f2fs_empty_dir, .max_namelen = f2fs_max_namelen, }; -#else -static const struct fscrypt_operations f2fs_cryptops = { -}; #endif static struct inode *f2fs_nfs_get_inode(struct super_block *sb, @@ -2318,7 +2315,9 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) #endif sb->s_op = &f2fs_sops; +#ifdef CONFIG_F2FS_FS_ENCRYPTION sb->s_cop = &f2fs_cryptops; +#endif sb->s_xattr = f2fs_xattr_handlers; sb->s_export_op = &f2fs_export_ops; sb->s_magic = F2FS_SUPER_MAGIC; diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index adaca6088836..7503e7cdf870 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -2007,11 +2007,6 @@ static struct ubifs_info *alloc_ubifs_info(struct ubi_volume_desc *ubi) return c; } -#ifndef CONFIG_UBIFS_FS_ENCRYPTION -const struct fscrypt_operations ubifs_crypt_operations = { -}; -#endif - static int ubifs_fill_super(struct super_block *sb, void *data, int silent) { struct ubifs_info *c = sb->s_fs_info; @@ -2054,7 +2049,9 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent) sb->s_maxbytes = c->max_inode_sz = MAX_LFS_FILESIZE; sb->s_op = &ubifs_super_operations; sb->s_xattr = ubifs_xattr_handlers; +#ifdef CONFIG_UBIFS_FS_ENCRYPTION sb->s_cop = &ubifs_crypt_operations; +#endif mutex_lock(&c->umount_mutex); err = mount_ubifs(c);