From patchwork Fri Jan 5 18:44:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10146977 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 15C74604AA for ; Fri, 5 Jan 2018 18:58:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0245028537 for ; Fri, 5 Jan 2018 18:58:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB3872893A; Fri, 5 Jan 2018 18:58:06 +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 961F028537 for ; Fri, 5 Jan 2018 18:58:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752550AbeAES50 (ORCPT ); Fri, 5 Jan 2018 13:57:26 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:33477 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752314AbeAES5Z (ORCPT ); Fri, 5 Jan 2018 13:57:25 -0500 Received: by mail-it0-f66.google.com with SMTP id o130so5344628itg.0; Fri, 05 Jan 2018 10:57:24 -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=9gKTCFr3XHQ5Q84D+aFeQ0q8D+TUJ/gOgRNq80FmC/Y=; b=BGwC5+BgPGe38ldjjxQg/Y/NmqxdxshjzVaIFEMo6xnCS0YgKYRF/krxipFXi3gpWD YlqvhBUKFgNr+Kv/dwUYRzHjtwpsFQMYsIZ2E8jMAtnePDDbhl4GVFd8xfUIDhNkm3iD 4RsEMAaTL09rfJjws55C81DkxxsLk5xLEK8CEQ7uJRuT0dj/UCVLa883TTDfAzki2nZX Tw2g3uT7BMKTUkdBrpr2kXjNMJTgTqfl/Urp6M1gZFSd5iF7o4WzkmL3Z89wuApQnv7t aNlq/Jq22esHEBzMlewlMTW74jsKZFbL4p0yUJ0Nvzbtw5F7m2D84kQ15H76N6fuQ528 b4Ig== 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=9gKTCFr3XHQ5Q84D+aFeQ0q8D+TUJ/gOgRNq80FmC/Y=; b=ZELLDRT8pMLVj4TKuk1J/f5hblFvRaczAcwUc3hWusK3OdP0iccLo8XMsB70rsoO36 +7fNo33G2p5ejebFmeUJYCeiZjjnKSN844awnYl+c1fJ15nDulc6oBIYx788zR7HTTW3 E9R8v4cfnwnGlAq20k82xg/VCeV/dyIY7hVbVsZ2dO8qgJ1aOznEuDRqgPI7JVYxhEO6 yds5iWWQehnDeWQQ0MOezGURLWT5IIkselyNT3nDFqQqjNxhAqYQeAhpgkLmZvjjBkzi nCTkqX6nso5FktueUQg9QaLqad8veKLlN4FY8+76AyXuMa3tlyOrmeDag2gUIUj/E/Aq dXpg== X-Gm-Message-State: AKGB3mKv3OyIPKrN+inzMZBeUX946O2MyO7Y1LLVXtzeRMbF0Kbs35fY jqhrauiut1w8WqjgR0rTBCRyvEMx X-Google-Smtp-Source: ACJfBouY0V1bcRcM9BxX/jlioyZbxIiUQf8thftRQV+lSBa7EfyZQdV1R9aMP8o2bToNQM+LEMOn+w== X-Received: by 10.36.37.209 with SMTP id g200mr4370515itg.152.1515178644051; Fri, 05 Jan 2018 10:57:24 -0800 (PST) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.66.175.88]) by smtp.gmail.com with ESMTPSA id j68sm3863899iod.53.2018.01.05.10.57.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Jan 2018 10:57:23 -0800 (PST) From: Eric Biggers To: linux-fscrypt@vger.kernel.org, "Theodore Y . Ts'o" Cc: linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, Eric Biggers Subject: [PATCH v2 01/11] fscrypt: move fscrypt_has_encryption_key() to supp/notsupp headers Date: Fri, 5 Jan 2018 10:44:52 -0800 Message-Id: <20180105184502.48473-2-ebiggers3@gmail.com> X-Mailer: git-send-email 2.16.0.rc0.223.g4a4ac83678-goog In-Reply-To: <20180105184502.48473-1-ebiggers3@gmail.com> References: <20180105184502.48473-1-ebiggers3@gmail.com> Sender: linux-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);