From patchwork Mon Oct 9 19:15:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9994085 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 289C660223 for ; Mon, 9 Oct 2017 19:19:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15F311FF28 for ; Mon, 9 Oct 2017 19:19:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07B79286A9; Mon, 9 Oct 2017 19:19:13 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 B193E286A0 for ; Mon, 9 Oct 2017 19:19:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754787AbdJITTJ (ORCPT ); Mon, 9 Oct 2017 15:19:09 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:32822 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754691AbdJITTE (ORCPT ); Mon, 9 Oct 2017 15:19:04 -0400 Received: by mail-pf0-f195.google.com with SMTP id m28so29746028pfi.0; Mon, 09 Oct 2017 12:19:04 -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=YzfyGHIdmnonI+gZ2/jTPtb4kOhufun9QDlV6w4iL68=; b=NGbj560QcmqhOLIejDmoh91fPJMZ30zfDVUhgydlcQYUiEcnLRj40oWiyR5J4e8rRv 1dBtqoQ47tZN2GginDYC/pP6CAEUQUr/PZ/BCQY8YLHDE2gV+HDeNZoBKLU363L9yBf/ NY+WC42Ow1/PymYgM0p0QbRa9w6e4uCw0sDqmaq6vqwHSEVga0Kw0kcK6l0+RNnfsifb 8CjvLC2r2W75WTqGY+x0xbWnAsMNu3V/E+UAtt4JucTfwNenUqHol/0MoKQf7+ZM4gAA YU9n8tgYtJtJC1UXsbpaJi9+rFiMDWcRoUbBWiB2bE//hb22uUTvzu6XLjZ22hIAau6c Qt7A== 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=YzfyGHIdmnonI+gZ2/jTPtb4kOhufun9QDlV6w4iL68=; b=STYSCIEL7qbriwx3G3vBJfi2cisrFOOSEcWYObblhF2T2KmT//Y6Q36PiuA/2QBuv4 kkgTCZNx8czNSlUS1Hm4YLHMuP00RDliKs8pt/0htoOhcpsAIH8qdG8ZMyRKebm38ory Iw27zfnJJP8yo8t8wR/vMK+1v6ablokY49kk6PzNx9hZ5LTQer1M5OEnPlSx4sdrQsB2 b7/n6z9zL1V4xkM83Iwx/loVPFlAVQ2KXrZhjpo+OSdQ8asUOAt6YCO+6CYZQnmqAvmv Gzf+gU1pmILt875fNSkhurUGYvc+OW08OHUpoTLiio/sBZiQzrXlrMwJ38aQRDd6X+7v e+bQ== X-Gm-Message-State: AMCzsaW+sIc4VSQlq9OHpusGYl0UfI6uPcUZjuPR2jUXZtGFDq7+CL2N kRa3ps4HY7iYMjSck0SaIDhIOigK X-Google-Smtp-Source: AOwi7QD3whx3NJ9Br98bAVQg2VbQ6aAfgXiNmXrEfEUWDgvLfZh2mGN4H2Yn5WxVNhMYZms8LOL2FQ== X-Received: by 10.159.198.2 with SMTP id f2mr9692302plo.288.1507576743834; Mon, 09 Oct 2017 12:19:03 -0700 (PDT) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.66.174.81]) by smtp.gmail.com with ESMTPSA id n29sm17039819pgf.44.2017.10.09.12.19.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Oct 2017 12:19:03 -0700 (PDT) From: Eric Biggers To: linux-fscrypt@vger.kernel.org, "Theodore Y . Ts'o" Cc: Jaegeuk Kim , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, Eric Biggers Subject: [PATCH v2 05/11] fscrypt: remove unneeded empty fscrypt_operations structs Date: Mon, 9 Oct 2017 12:15:38 -0700 Message-Id: <20171009191544.43656-6-ebiggers3@gmail.com> X-Mailer: git-send-email 2.14.2.920.gcf0c67979c-goog In-Reply-To: <20171009191544.43656-1-ebiggers3@gmail.com> References: <20171009191544.43656-1-ebiggers3@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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. Reviewed-by: Chao Yu Acked-by: Dave Chinner 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);