From patchwork Fri Dec 15 17:42:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 849282 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MgvTV3b8"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yyyXy0Mxqz9t2l for ; Sat, 16 Dec 2017 04:46:42 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755730AbdLORql (ORCPT ); Fri, 15 Dec 2017 12:46:41 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:47013 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755655AbdLORqk (ORCPT ); Fri, 15 Dec 2017 12:46:40 -0500 Received: by mail-pf0-f194.google.com with SMTP id c204so6619325pfc.13; Fri, 15 Dec 2017 09:46:39 -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=THxh3EAtruFT2W2szS9Dcenj0DJhedmxZRGUnwGPIXs=; b=MgvTV3b8IRK/uaB9sW0OC4bT8KkgP+g0lTt6JyhjyHw5VMTGvnWJ/kQlHjY680IrXs 11Y5BWOQks1kAgrf5WOdp8eG0hxJuO+8NNhms2x8T4rYPYTXhOpqjIqKPCHXNPCZpZr0 rdyqpHWt6rgUiPU4qYPax5b2GUKmNJHz04IeTp5cL4kI+Dk8u/Z3JCDJ8TjGv7+5pl7M qfCL7NTV5C5MIytu0BRy7V4hKyUfig0NMUWZpstprNVBelsr8Er4e5zkc6DGHerC4BcG WA6fCcuWJSJ8TwoIuJ6iMCNR9KgXbklyYvPs6xIRpXQDs3yUF0Thl4tOIRRkRt2RvsdO IbZQ== 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=THxh3EAtruFT2W2szS9Dcenj0DJhedmxZRGUnwGPIXs=; b=nECToY9BhAMc0uFSogkM1iP9VQwpJ/+dI4vgzjL03rzPUUs+PX40oDsPAqasp93LFR Z27RjJ2b9zwFErH9aeY+UA8w/FCaJsEMajJ0oetcV/+TD4zLHF8u40aiFgaVcDIeO+iL bJB3bf5OMyAQUrw+CPQTi3EvU1yIL0M4HfD9KH3LvQz5F3t22mlC0JN7mMAexx5wBfrC j+qoku1uQGmI1N675JnEEgeUONM1M1nAEwQC2KOvW9NFlT8PDn1T+3o6uNPlz2GIodgl NvYzNsALv00iZ8U2SJM+I0F9AwL/P+Od6FDHoY6Psnqq2g6LQWAgaVeLEsLDlhEOtOzM ALBA== X-Gm-Message-State: AKGB3mJSNbcZ0dnQ9JLITqY3CC9xbV1irDksAdHj/m9eqQ9tUgna4i4v po/MZU42P108B5U5sdB27i7ykjBOZ6w= X-Google-Smtp-Source: ACJfBouCublIqXc6kBYu6GpZ0OEUF/pk4L94UeRJzoP8wF28IlsTVvBNJrU1rDNwvmczn8lp6FGRlg== X-Received: by 10.159.247.14 with SMTP id d14mr14026948pls.274.1513359999152; Fri, 15 Dec 2017 09:46:39 -0800 (PST) Received: from zzz.localdomain (c-67-185-97-198.hsd1.wa.comcast.net. [67.185.97.198]) by smtp.gmail.com with ESMTPSA id j62sm12980149pfc.18.2017.12.15.09.46.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Dec 2017 09:46:38 -0800 (PST) From: Eric Biggers To: linux-fscrypt@vger.kernel.org Cc: "Theodore Y . Ts'o" , Jaegeuk Kim , linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, Eric Biggers Subject: [PATCH 01/24] fscrypt: move fscrypt_has_encryption_key() to supp/notsupp headers Date: Fri, 15 Dec 2017 09:42:02 -0800 Message-Id: <20171215174225.31583-2-ebiggers3@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171215174225.31583-1-ebiggers3@gmail.com> References: <20171215174225.31583-1-ebiggers3@gmail.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Eric Biggers fscrypt_has_encryption_key() is already split into two versions depending on whether the filesystem is being built with encryption support or not. Move them into the appropriate headers. Signed-off-by: Eric Biggers --- include/linux/fscrypt.h | 10 ---------- include/linux/fscrypt_notsupp.h | 5 +++++ include/linux/fscrypt_supp.h | 5 +++++ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h index 08b4b40c5aa8..d1c891b5bd9c 100644 --- a/include/linux/fscrypt.h +++ b/include/linux/fscrypt.h @@ -129,11 +129,6 @@ static inline struct page *fscrypt_control_page(struct page *page) return ((struct fscrypt_ctx *)page_private(page))->w.control_page; } -static inline bool fscrypt_has_encryption_key(const struct inode *inode) -{ - return (inode->i_crypt_info != NULL); -} - #include #else /* !__FS_HAS_ENCRYPTION */ @@ -144,11 +139,6 @@ static inline struct page *fscrypt_control_page(struct page *page) return ERR_PTR(-EINVAL); } -static inline bool fscrypt_has_encryption_key(const struct inode *inode) -{ - return 0; -} - #include #endif /* __FS_HAS_ENCRYPTION */ diff --git a/include/linux/fscrypt_notsupp.h b/include/linux/fscrypt_notsupp.h index 63e58808519a..52e330285457 100644 --- a/include/linux/fscrypt_notsupp.h +++ b/include/linux/fscrypt_notsupp.h @@ -14,6 +14,11 @@ #ifndef _LINUX_FSCRYPT_NOTSUPP_H #define _LINUX_FSCRYPT_NOTSUPP_H +static inline bool fscrypt_has_encryption_key(const struct inode *inode) +{ + return false; +} + /* crypto.c */ static inline struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *inode, gfp_t gfp_flags) diff --git a/include/linux/fscrypt_supp.h b/include/linux/fscrypt_supp.h index cf9e9fc02f0a..79bb8beae018 100644 --- a/include/linux/fscrypt_supp.h +++ b/include/linux/fscrypt_supp.h @@ -11,6 +11,11 @@ #ifndef _LINUX_FSCRYPT_SUPP_H #define _LINUX_FSCRYPT_SUPP_H +static inline bool fscrypt_has_encryption_key(const struct inode *inode) +{ + return (inode->i_crypt_info != NULL); +} + /* crypto.c */ extern struct kmem_cache *fscrypt_info_cachep; extern struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *, gfp_t);