From patchwork Fri Dec 15 17:42:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10115689 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 1CDB36019C for ; Fri, 15 Dec 2017 17:46:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B0EA29EE1 for ; Fri, 15 Dec 2017 17:46:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F39C42A024; Fri, 15 Dec 2017 17:46:54 +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 A1E5229EE1 for ; Fri, 15 Dec 2017 17:46:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756083AbdLORqy (ORCPT ); Fri, 15 Dec 2017 12:46:54 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:37908 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755851AbdLORqr (ORCPT ); Fri, 15 Dec 2017 12:46:47 -0500 Received: by mail-pg0-f67.google.com with SMTP id f12so6255744pgo.5; Fri, 15 Dec 2017 09:46:47 -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=Ygxq310phw2BXpcROyP7tV4g/v4w1X3ol7j4gOOlUbo=; b=YJjqEXGSvL2Xzi6Eh0irQaR5TLd7iaIe6qNqqhvSq5w1+QlFzv5fNz9PPbAUHovEMa byoX8Q5v2OdoHN3ZQX9d8hBMYg7uyvKhX+lEPEQvniqYDsaefOno7+lnbi34uQezdFM9 LbF4SBUkI7EyGSkkfkOa9Sc9uouoQt8uHTPgVLsSylnUZX25pbHFFFQd9sUXNjNKetGH J5vUNdv7jpxz+8CE4c/VnwOWjIMWAAD1Lt+VGnYgkpnJM/6UrEkTbKwHBDlBNguaIOrk Mno5i8tk8bpKpn6X/r5YyLk2zaXl39/w+1a8U6tduDWbKpCDj8EuzzqhpQLutHTNehQk ohTw== 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=Ygxq310phw2BXpcROyP7tV4g/v4w1X3ol7j4gOOlUbo=; b=Stb2tjg6Fvwa6v3oYiiQLOL0b2FV3kZKFmZuF4DsvbHS8do7uTi8zvIJXn22TKz+U9 8Ovfrz47F49LJQ5hS//HVyPAlADp++2z3MKJxmpTQ/yfSGq49Zk0lLBd/1zLCDZ860Z3 nZMv95Sd/fxcnP1nYrNLtwxr82Q/xWP4dtnCdV+LALiykN9sRBKKKjyw58gSbnNQM8lp fjwxqYp6pwwcPOmJmtEI0irQPAU+k2E3N3+OFJS9JK1o/33hKWpQ98F6biHicbG+NTDF gC9xPJsi1or5zg9MFy5+kmk1jMXerGSPnibXyeCxzNQpiz9Gw2e2x6gd02YQSOTPP3cW 1iMg== X-Gm-Message-State: AKGB3mJpL32CO23LY4m04DlGD/fNH5Rpv3hiAelGzeu26reLXW1OBTjQ YwPCC1rw/Ie9zRCpGu/QdYHedITALk8= X-Google-Smtp-Source: ACJfBoscvP3bZNQYOiLqNTrRsSxW1uDKWPUdKLF++SNTlbMrYuNgOTNxBrHI2ppDuuaa2xpVT9z9WA== X-Received: by 10.159.244.5 with SMTP id x5mr14554075plr.413.1513360006703; Fri, 15 Dec 2017 09:46:46 -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.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Dec 2017 09:46:45 -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 08/24] fscrypt: move fscrypt_is_dot_dotdot() to fs/crypto/fname.c Date: Fri, 15 Dec 2017 09:42:09 -0800 Message-Id: <20171215174225.31583-9-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-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 Only fs/crypto/fname.c cares about treating the "." and ".." filenames specially with regards to encryption, so move fscrypt_is_dot_dotdot() from fscrypt.h to there. Signed-off-by: Eric Biggers --- fs/crypto/fname.c | 11 +++++++++++ include/linux/fscrypt.h | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/crypto/fname.c b/fs/crypto/fname.c index 305541bcd108..b8c5061553b1 100644 --- a/fs/crypto/fname.c +++ b/fs/crypto/fname.c @@ -15,6 +15,17 @@ #include #include "fscrypt_private.h" +static inline bool fscrypt_is_dot_dotdot(const struct qstr *str) +{ + if (str->len == 1 && str->name[0] == '.') + return true; + + if (str->len == 2 && str->name[0] == '.' && str->name[1] == '.') + return true; + + return false; +} + /** * fname_encrypt() - encrypt a filename * diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h index 2e4dce0365cf..3045fc49d3ca 100644 --- a/include/linux/fscrypt.h +++ b/include/linux/fscrypt.h @@ -57,17 +57,6 @@ struct fscrypt_name { /* Maximum value for the third parameter of fscrypt_operations.set_context(). */ #define FSCRYPT_SET_CONTEXT_MAX_SIZE 28 -static inline bool fscrypt_is_dot_dotdot(const struct qstr *str) -{ - if (str->len == 1 && str->name[0] == '.') - return true; - - if (str->len == 2 && str->name[0] == '.' && str->name[1] == '.') - return true; - - return false; -} - #if __FS_HAS_ENCRYPTION #include #else