From patchwork Thu Jan 5 20:42:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9499685 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 E8AA2606E0 for ; Thu, 5 Jan 2017 20:50:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB4F028401 for ; Thu, 5 Jan 2017 20:50:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CFD1D28472; Thu, 5 Jan 2017 20:50:18 +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 C3EF92846A for ; Thu, 5 Jan 2017 20:50:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938777AbdAEUuL (ORCPT ); Thu, 5 Jan 2017 15:50:11 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:36382 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932874AbdAEUt5 (ORCPT ); Thu, 5 Jan 2017 15:49:57 -0500 Received: by mail-pg0-f67.google.com with SMTP id 75so3496049pgf.3 for ; Thu, 05 Jan 2017 12:49:56 -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=Zl2JvT9kjlxziEp7gQLcGnX3zE4++mvcHx84O3KLhdE=; b=pboTJ+f1EPbw2Avq+PC11u0Nld0ROUCz3MuhKnhq8aFZ0n5W0F52TqUXMzyNfdusHg 5MmOIn/1tgRtnGZkYsKg/8y+Lr1D3gwkUG7gRBcevOnwD8gjIySBUXB2HWXfUgUPJXXT wJgF6hGrJTE41qVMapZMuUkUVF1QWO/AGICildQ6vSwEvbXDHn0PERbXkhG9e/dc+yyB t15hAp0JexIhZ4WVNmdQq1HWol04IJ/Lwhad3T8xW0RXIc6Ry9laaxkrHpEJMgHunVCj q1Dyl0sMeIYfpnXqa8ZTZzQFeJkhFC/F+1uphhSEmV7ZexW18rNEt3BvjrVGeZ0QQrko d0Wg== 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=Zl2JvT9kjlxziEp7gQLcGnX3zE4++mvcHx84O3KLhdE=; b=aAVPZp9AE3aUOcGSkssJQaIKBUFAD92j9uiGpzn72yP6XkegWWvKk/V28quKMBWEEb ia+Gnl9aFBeN9vC3+kg1ykpV/8sBLFz9XOA8t1JQcs1U4HFgVPBh8ObvEljYYjCkwPxr mUSKqPZWNqIe7kTuO1/Cygua9togJYDTkm0cNFb8NvyvD/iyOBFjF+rYn4ajPxAllwVj Et1WTYv7er2aJeB4HKma1ccUaRZsymCKHJvCaDVgRhb57wCrE5xGoNStlBDwYXkjnKLC sUZTFe0HNfzh05BDbH4tT2quT5poeYe8vCvdin9R1RD+8zQ2c5eUgVo7Qs5Yv5zNczqr eszw== X-Gm-Message-State: AIkVDXISML9WdZVlNMSPgGm0vvY+4x1I6jnJ11tayiejPvgs5TuGJe1fqyVZNr2iOKG+OQ== X-Received: by 10.99.4.71 with SMTP id 68mr136031675pge.77.1483649005868; Thu, 05 Jan 2017 12:43:25 -0800 (PST) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.119.30.131]) by smtp.gmail.com with ESMTPSA id s4sm155131292pfb.55.2017.01.05.12.43.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jan 2017 12:43:25 -0800 (PST) From: Eric Biggers To: linux-fsdevel@vger.kernel.org Cc: Theodore Ts'o , Jaegeuk Kim , Richard Weinberger , Eric Biggers Subject: [PATCH] fscrypt: constify struct fscrypt_operations Date: Thu, 5 Jan 2017 12:42:43 -0800 Message-Id: <20170105204243.79135-1-ebiggers3@gmail.com> X-Mailer: git-send-email 2.11.0.390.gc69c2f50cf-goog 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 Signed-off-by: Eric Biggers Reviewed-by: Richard Weinberger --- fs/ext4/super.c | 4 ++-- fs/f2fs/super.c | 4 ++-- fs/ubifs/crypto.c | 2 +- fs/ubifs/super.c | 2 +- fs/ubifs/ubifs.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 66845a08a87a..2358714bbc33 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1179,7 +1179,7 @@ static unsigned ext4_max_namelen(struct inode *inode) EXT4_NAME_LEN; } -static struct fscrypt_operations ext4_cryptops = { +static const struct fscrypt_operations ext4_cryptops = { .get_context = ext4_get_context, .key_prefix = ext4_key_prefix, .prepare_context = ext4_prepare_context, @@ -1190,7 +1190,7 @@ static struct fscrypt_operations ext4_cryptops = { .max_namelen = ext4_max_namelen, }; #else -static struct fscrypt_operations ext4_cryptops = { +static const struct fscrypt_operations ext4_cryptops = { .is_encrypted = ext4_encrypted_inode, }; #endif diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 702638e21c76..30198e5bdf26 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1176,7 +1176,7 @@ static unsigned f2fs_max_namelen(struct inode *inode) inode->i_sb->s_blocksize : F2FS_NAME_LEN; } -static struct fscrypt_operations f2fs_cryptops = { +static const struct fscrypt_operations f2fs_cryptops = { .get_context = f2fs_get_context, .key_prefix = f2fs_key_prefix, .set_context = f2fs_set_context, @@ -1185,7 +1185,7 @@ static struct fscrypt_operations f2fs_cryptops = { .max_namelen = f2fs_max_namelen, }; #else -static struct fscrypt_operations f2fs_cryptops = { +static const struct fscrypt_operations f2fs_cryptops = { .is_encrypted = f2fs_encrypted_inode, }; #endif diff --git a/fs/ubifs/crypto.c b/fs/ubifs/crypto.c index 3402720f2b28..182419b245e7 100644 --- a/fs/ubifs/crypto.c +++ b/fs/ubifs/crypto.c @@ -86,7 +86,7 @@ int ubifs_decrypt(const struct inode *inode, struct ubifs_data_node *dn, return 0; } -struct fscrypt_operations ubifs_crypt_operations = { +const struct fscrypt_operations ubifs_crypt_operations = { .flags = FS_CFLG_OWN_PAGES, .get_context = ubifs_crypt_get_context, .set_context = ubifs_crypt_set_context, diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index e08aa04fc835..b73811bd7676 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -2000,7 +2000,7 @@ static struct ubifs_info *alloc_ubifs_info(struct ubi_volume_desc *ubi) } #ifndef CONFIG_UBIFS_FS_ENCRYPTION -struct fscrypt_operations ubifs_crypt_operations = { +const struct fscrypt_operations ubifs_crypt_operations = { .is_encrypted = __ubifs_crypt_is_encrypted, }; #endif diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index ca72382ce6cc..15f1d1f129b6 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h @@ -1842,7 +1842,7 @@ int ubifs_decrypt(const struct inode *inode, struct ubifs_data_node *dn, unsigned int *out_len, int block); #endif -extern struct fscrypt_operations ubifs_crypt_operations; +extern const struct fscrypt_operations ubifs_crypt_operations; static inline bool __ubifs_crypt_is_encrypted(struct inode *inode) {