From patchwork Tue Feb 7 20:42:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9561147 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 E68046047A for ; Tue, 7 Feb 2017 20:53:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D966228236 for ; Tue, 7 Feb 2017 20:53:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE26128443; Tue, 7 Feb 2017 20:53:49 +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=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 6CCCE28236 for ; Tue, 7 Feb 2017 20:53:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932081AbdBGUxU (ORCPT ); Tue, 7 Feb 2017 15:53:20 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33403 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755269AbdBGUxS (ORCPT ); Tue, 7 Feb 2017 15:53:18 -0500 Received: by mail-pf0-f195.google.com with SMTP id e4so9993510pfg.0 for ; Tue, 07 Feb 2017 12:52:44 -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:in-reply-to:references; bh=R+4IGVW/iiqXAv9YtnEZC5rGtAbCvrOjZ27kzT7axzw=; b=I3OVr9drHPIp5M47uWN5YH8xL1DBs/OoCxCRMKxo+950P7OgEe9R4twhJsVuTLq4vS JdJG75i37Iy7uPZ7HuM+BulDAvLNf1WDN7qGK+H/m0hA/tqEd0AATigwCjqgzrx9Abyl ZNbiYi04hAcQRReigEntBIcusZ9z8BTwUDFuzzPP+fQ6ediqAi2jd8S8mHvE9+C0Y9+a AZc3Bf7T1VRoI2co42gjV/KFbx+ti0vEhET1Tlt/O+ckOILp1wrsBEjATAWk6QzTmXzP 0K7NukM2ItOX7fnWvyS89q6vQ8Tn3/++bdOQhsv85uyHY7pSjaJpTh+x7Z5OR+arxTin 0WtA== 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=R+4IGVW/iiqXAv9YtnEZC5rGtAbCvrOjZ27kzT7axzw=; b=AW4ayeg2WJSkA6LaxopbFREyFezq1hWs7YuiMj2ycvdxTwjpuj2zxrzBV0jq+Zvh4m t0Q9fGgRCIO7y1GBkMeJxde7DKoI5UrGjrlcMJ5ibBAfIfkhDb8O3oUCQvF6Wjbchb/N baqjCf5SGQhVPbfGPmoWsLGNyBxWZi/aqXA3sqAYaBDhtG4aJwOV/jxmhS5SrzdImRaj 3jpVocyb0XKuNqVfKR0fBqxlw5295d1gd+hgJA3SYfrdzsDBbnVafd08wQpaaNGyqOYB kwHybbf4qzKQh8LPSS7F3AUE2OxcLzAz5wqXz3LbT67jOkVTzBNCMPsfI4bojeFENbAm 71XQ== X-Gm-Message-State: AIkVDXIp3tkjbIQ1XR5HxIZVjrNiL9hgGxenQ4V7tN4jlPFFDbuu1eqN9TWcUKNgr+Cluw== X-Received: by 10.98.212.23 with SMTP id a23mr22309977pfh.18.1486500222179; Tue, 07 Feb 2017 12:43:42 -0800 (PST) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.119.30.131]) by smtp.gmail.com with ESMTPSA id w16sm13818509pgc.15.2017.02.07.12.43.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Feb 2017 12:43:41 -0800 (PST) From: Eric Biggers To: linux-fsdevel@vger.kernel.org Cc: linux-fscrypt@vger.kernel.org, Theodore Ts'o , Jaegeuk Kim , Richard Weinberger , Eric Biggers Subject: [PATCH v2] fscrypt: constify struct fscrypt_operations Date: Tue, 7 Feb 2017 12:42:10 -0800 Message-Id: <20170207204210.25971-1-ebiggers3@gmail.com> X-Mailer: git-send-email 2.11.0.483.g087da7b7c-goog In-Reply-To: <20170123201646.GA3417@gmail.com> References: <20170123201646.GA3417@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 [v2: fix conflict with .key_prefix change] 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 9d15a6293124..20539c2cd6d8 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1173,7 +1173,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 = { .key_prefix = "ext4:", .get_context = ext4_get_context, .prepare_context = ext4_prepare_context, @@ -1184,7 +1184,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 739192d95e71..24f40197eb00 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1170,7 +1170,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 = { .key_prefix = "f2fs:", .get_context = f2fs_get_context, .set_context = f2fs_set_context, @@ -1179,7 +1179,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 6335abcf98df..382ed428cfd2 100644 --- a/fs/ubifs/crypto.c +++ b/fs/ubifs/crypto.c @@ -77,7 +77,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, .key_prefix = "ubifs:", .get_context = ubifs_crypt_get_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 d9df379bacc6..f0c86f076535 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h @@ -1824,7 +1824,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) {