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: 823434 X-Patchwork-Delegate: richard@nod.at Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AazDpKHG"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="NGbj560Q"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y9qnX3qQcz9t44 for ; Tue, 10 Oct 2017 06:20:00 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=7Y2kcWNmgvZ/a1K8GPTxOTvopeZlB5HlnCGt3y5ttwQ=; b=AazDpKHGJMujq0+QnECJLncusy g/Zq/bFjKcECjPtFv3jMhEX9cccsDWa/7uSP2X48m5Vn5WP5N6TQOtKVZuvQ3dgRDaTh0lg98ISqr OSQOyt5XKeS6Wjb865xZVF3PrONy9DsVKIuXOpbvP3DVfnl6AiWprun307hjpmeZmkkc/cxupmcdv wGzPXqB8s1aRGT2tCYSLKnlWNKaw6Q53d+ewdcJzhMH04/7J5Zp0c7LenMO6Ghco7aCIsTJtwDVUz R9o+uS6cemnKqTsgOTtOb+lFXs6w/AoQEiQWxFnjcrzw5xNC12aDWERiH/JNUp6iRuw+gixQ3jKX1 1TxkCkuw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e1daj-0000qO-3A; Mon, 09 Oct 2017 19:19:53 +0000 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e1daC-0000EM-AG for linux-mtd@lists.infradead.org; Mon, 09 Oct 2017 19:19:28 +0000 Received: by mail-pf0-x241.google.com with SMTP id b85so9514885pfj.1 for ; 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=DVa6z6ZkLjvTzHbY93ki7wQwcPKxwMQlCLqUiAxPI0Ltid+cNk+te7sK78DxbJghK5 ULg4tG3quUA4c8IPDpKyg79wARxIs1J37uwY0cZvtBgQnRGjqUQ2ZXbvG0bu3jx1YaJu zKbwBK7bHj+4GOZ7eka5upvJPHgP1f9kV93/4KsTHGRJo0Xkgo60CAMAZquyXvGvF/y7 CLvyNfraKmXHz7q6nstJrm1p7uuZyWIVTNtksv1MKmowVKtSPUcj2WSKcQLXtxOEvE9v rxX9LtGPHqWchi4RzSRH0CVvMhaLWihgEqTbYmLWRCT8iBQ3RNy0SiUMCOIrmQPqrSPy kCDg== X-Gm-Message-State: AMCzsaV73OB1upE1LEGhLNgOxms7OfKqbhN5iFwp81tl7c2mdisVpbbn 7GFUBkPFB+wKMw6x5dNU/kc= 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" 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171009_121920_677305_0DDEB8C1 X-CRM114-Status: GOOD ( 11.14 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c00:0:0:0:241 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (ebiggers3[at]gmail.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (ebiggers3[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Biggers , linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, Jaegeuk Kim , linux-ext4@vger.kernel.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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);