From patchwork Fri Dec 15 17:42:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 849308 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="Oh84cTE6"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gUDYHweH"; 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 3yyych0Jjtz9ryk for ; Sat, 16 Dec 2017 04:49:56 +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=mbL7eZDu5bfBQDUmm5lHtKZN06VJjP9/CBk0uyGivNY=; b=Oh84cTE6iv2wdFQc0LsaRNtikI Gn0pQbCPJVUbEXtQadXXR/7l8BvqzvoJ6aRTn18jhgN3DdQFvhTK93eD3ulyjCJAufLFU7hfxC66S Nk7UKTHc5q2CjvP22AJ8+HbU5h8KJhDPqzUCYh3Gn4CyhxwItiBXdQoiOqwCYrCDil/ouhqsl1jGe JF6HhW3RIr62WPxE/8L4ROsMGr1LlEpHB6jOALux7FecF559HoGuwlSktefWn+XKhA+M4aqnOHgBj Yeb2qEkI/ZRyI+tjde43G811EAMrYwiTWdUSRkjLR5uuAGt/uk4jKjTFUvJUMAebu4Ldml15IjIQC NGfRf8og==; 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 1ePu6f-0000hs-VP; Fri, 15 Dec 2017 17:49:10 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ePu4g-0008Np-N6 for linux-mtd@lists.infradead.org; Fri, 15 Dec 2017 17:47:13 +0000 Received: by mail-pf0-x243.google.com with SMTP id u25so6633597pfg.5 for ; Fri, 15 Dec 2017 09:46:43 -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=rsxzDNudjN80MY7iFZbgphGahp25D0gfAQr8C1E+Ets=; b=gUDYHweHyH/IAmwmamNabgiXg9fFEiHdawj4rFctBsXxfsxN1PADC8GN+J9sTwmNnC YLiCZmwiXxE17BcwdZIA4pn8o3+7ivB8oYvWtxIvIfGMKMiWuyv75UDtSKc1INtECQ08 o0umDyUIttJzSAcYMpnvLaV30hdw/oUDSyMtvN5gUERcliGytPzV5aY2Ni7wTA/bbL4b 8XbQnhU/442nSN7mOkqr56R3d5f5nFdE5kYfj14gswWZFThFc0ykUQkm0AeF82hZJH9C /o5R3vYdkcxGxrKpnNmkvkrzn70aDVuHFXe80jGsNBz7Tuf2EtAl5Po3AoKHBUopF1i8 2khw== 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=rsxzDNudjN80MY7iFZbgphGahp25D0gfAQr8C1E+Ets=; b=NnkFk/WKpfPQt6pEhnHteJBcD88Z8P+zuxFzf3YxDYdkxhy/liBNRnKip0eiHH6k4N Eq4C9lJu62Kt/Hne6MzSEcg/niW87DipVGwcEvs7mD/jPWSBTHf+csdG/f7hJZm/gylM OvxN0waHU0lFUcBkNSlg4x1Dh21/UYzlJnOU1aNrMWe5d8B1NaYUIRs30vTiGdwR1R40 yKsGsIh5po656IkmJi/lNp25PGi/ElhUphZZD/LGUzO3f5iOGAo5iinI7qG5+rwZuQ8J SkpJ2tVlCWlNRdGcmsXjotz0Is8DOFjA2lUmCoCUsLGJoodnmKKxHqED6NPjhdlvdWY7 sDow== X-Gm-Message-State: AKGB3mL5Y7wUrr2HL7NLtsRKTTyk2dtWorN0O79UvYth1b5D1lA4wrU2 Ny5g5abZh/SxSWHg2izxb1Y= X-Google-Smtp-Source: ACJfBos18Fa/qitVkwy5zp2RL9g5vNSaqrQf+NcSYQvu5fT0rrDXHRV9cE9CfskiVXUrMaz+n5/OGw== X-Received: by 10.159.249.9 with SMTP id bf9mr13618297plb.86.1513360000104; Fri, 15 Dec 2017 09:46:40 -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.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Dec 2017 09:46:39 -0800 (PST) From: Eric Biggers To: linux-fscrypt@vger.kernel.org Subject: [PATCH 02/24] fscrypt: move fscrypt_control_page() to supp/notsupp headers Date: Fri, 15 Dec 2017 09:42:03 -0800 Message-Id: <20171215174225.31583-3-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171215_094706_793769_A56AB77D X-CRM114-Status: UNSURE ( 9.58 ) X-CRM114-Notice: Please train this message. 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:243 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (ebiggers3[at]gmail.com) -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) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -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 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: "Theodore Y . Ts'o" , Eric Biggers , linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.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 fscrypt_control_page() 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 | 18 ++---------------- include/linux/fscrypt_notsupp.h | 5 +++++ include/linux/fscrypt_supp.h | 6 ++++++ 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h index d1c891b5bd9c..c23b2f16129a 100644 --- a/include/linux/fscrypt.h +++ b/include/linux/fscrypt.h @@ -123,24 +123,10 @@ static inline bool fscrypt_is_dot_dotdot(const struct qstr *str) } #if __FS_HAS_ENCRYPTION - -static inline struct page *fscrypt_control_page(struct page *page) -{ - return ((struct fscrypt_ctx *)page_private(page))->w.control_page; -} - #include - -#else /* !__FS_HAS_ENCRYPTION */ - -static inline struct page *fscrypt_control_page(struct page *page) -{ - WARN_ON_ONCE(1); - return ERR_PTR(-EINVAL); -} - +#else #include -#endif /* __FS_HAS_ENCRYPTION */ +#endif /** * fscrypt_require_key - require an inode's encryption key diff --git a/include/linux/fscrypt_notsupp.h b/include/linux/fscrypt_notsupp.h index 52e330285457..812dc701a5b3 100644 --- a/include/linux/fscrypt_notsupp.h +++ b/include/linux/fscrypt_notsupp.h @@ -48,6 +48,11 @@ static inline int fscrypt_decrypt_page(const struct inode *inode, return -EOPNOTSUPP; } +static inline struct page *fscrypt_control_page(struct page *page) +{ + WARN_ON_ONCE(1); + return ERR_PTR(-EINVAL); +} static inline void fscrypt_restore_control_page(struct page *page) { diff --git a/include/linux/fscrypt_supp.h b/include/linux/fscrypt_supp.h index 79bb8beae018..ad40780d4653 100644 --- a/include/linux/fscrypt_supp.h +++ b/include/linux/fscrypt_supp.h @@ -25,6 +25,12 @@ extern struct page *fscrypt_encrypt_page(const struct inode *, struct page *, u64, gfp_t); extern int fscrypt_decrypt_page(const struct inode *, struct page *, unsigned int, unsigned int, u64); + +static inline struct page *fscrypt_control_page(struct page *page) +{ + return ((struct fscrypt_ctx *)page_private(page))->w.control_page; +} + extern void fscrypt_restore_control_page(struct page *); extern const struct dentry_operations fscrypt_d_ops;