From patchwork Fri Dec 15 17:42:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10115709 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 8B0F06019C for ; Fri, 15 Dec 2017 17:47:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7920B29EE1 for ; Fri, 15 Dec 2017 17:47:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E5262A092; Fri, 15 Dec 2017 17:47:12 +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 10A9829EE1 for ; Fri, 15 Dec 2017 17:47:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755864AbdLORrJ (ORCPT ); Fri, 15 Dec 2017 12:47:09 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:37443 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755929AbdLORrA (ORCPT ); Fri, 15 Dec 2017 12:47:00 -0500 Received: by mail-pg0-f66.google.com with SMTP id y6so6255489pgp.4; Fri, 15 Dec 2017 09:46:59 -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=SO17RDeFg/DO4IA1nWfCsbC8oc/lzZcFEL2XI6jgMwI=; b=cWMn0yPl4KMTaJwN9k1Ia0qN9ZOXYm+L28fVMvnB3GPn81n0PiHyOy7EA8UysauSPi /IKaokesjYlwMn2phOTw0KPyvAIDBpdnWol/ij6Xf/KXxnw8JQWks3aEVSKNxgOkX2m1 P9v8ttb13nkTcXEXADzpa9R098MYQv2kYxi1+7OAf3txUTSYg8zvFWUkZCVi77e4fljL zabM/0h66yKSaQqM8/XMeUavC2UPjTjGMclVSGWjDPKG1BsXYL7+Yyd0w1Up8Z/QsT+t KAlpsYxbORStN9T5OlJxmAuBii6c9bJh3RQTxXSEtmnLnzXclPbTuPCqKhj6TcwI534N OJCQ== 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=SO17RDeFg/DO4IA1nWfCsbC8oc/lzZcFEL2XI6jgMwI=; b=bZ/wybYr929AUdtaLY5wp6aG+9q6jcRilSRbfyjhQY7hWe/CAQyN09tlnkq2Q5bUY6 AWgTPkTaOUEOdWbmMMKCpDXTFVm3WCCqpsBNW+18Y9oG/kr1DLNGgflqhE3N6TKuxL0B UG74GI50NgemWd3KCnRbqLotCBVzWw60zJrBj4HWvdL1HPGIpFvi3U7sSTbV1SiqEMMr tt3BVV3xcq3URa7NWnip76u0WpWXo3TVjGAbQ2t+kPwuUc6s81dOmtQSgsPlKCv7MkfU 7LEDvyyzbWa1pkK2BwxJU05ItEx2Lu4Tr0ZRkarQyw1gGimnNeUz4O93tHTTUt/m4GcB NX1g== X-Gm-Message-State: AKGB3mIRFfqLQtfq5+NYntlkQAywh8TA/TyhFk16kAh1SZlsXttLCMI9 /EufNj/6pMmCqFlCjpdXnzcLk8hKIuo= X-Google-Smtp-Source: ACJfBos2PYhPt1J42O2kQGexeyVfNBhSiICYfEyvDFhqBmDoXDq4mNZtoupnpaqSOJ+TB8kx+km9mw== X-Received: by 10.84.245.138 with SMTP id j10mr14152219pll.281.1513360019202; Fri, 15 Dec 2017 09:46:59 -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.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Dec 2017 09:46:58 -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 19/24] fscrypt: remove fscrypt_fname_usr_to_disk() Date: Fri, 15 Dec 2017 09:42:20 -0800 Message-Id: <20171215174225.31583-20-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 fscrypt_fname_usr_to_disk() sounded very generic but was actually only used to encrypt symlinks. Remove it now that all filesystems have been switched over to fscrypt_encrypt_symlink(). Signed-off-by: Eric Biggers --- fs/crypto/fname.c | 29 ----------------------------- include/linux/fscrypt_notsupp.h | 7 ------- include/linux/fscrypt_supp.h | 2 -- 3 files changed, 38 deletions(-) diff --git a/fs/crypto/fname.c b/fs/crypto/fname.c index 62f13d533439..cae7d1bcc8c5 100644 --- a/fs/crypto/fname.c +++ b/fs/crypto/fname.c @@ -311,35 +311,6 @@ int fscrypt_fname_disk_to_usr(struct inode *inode, } EXPORT_SYMBOL(fscrypt_fname_disk_to_usr); -/** - * fscrypt_fname_usr_to_disk() - converts a filename from user space to disk - * space - * - * The caller must have allocated sufficient memory for the @oname string. - * - * Return: 0 on success, -errno on failure - */ -int fscrypt_fname_usr_to_disk(struct inode *inode, - const struct qstr *iname, - struct fscrypt_str *oname) -{ - if (fscrypt_is_dot_dotdot(iname)) { - oname->name[0] = '.'; - oname->name[iname->len - 1] = '.'; - oname->len = iname->len; - return 0; - } - if (inode->i_crypt_info) - return fname_encrypt(inode, iname, oname); - /* - * Without a proper key, a user is not allowed to modify the filenames - * in a directory. Consequently, a user space name cannot be mapped to - * a disk-space name - */ - return -ENOKEY; -} -EXPORT_SYMBOL(fscrypt_fname_usr_to_disk); - /** * fscrypt_setup_filename() - prepare to search a possibly encrypted directory * @dir: the directory that will be searched diff --git a/include/linux/fscrypt_notsupp.h b/include/linux/fscrypt_notsupp.h index dd106640c6ea..0962f504aa91 100644 --- a/include/linux/fscrypt_notsupp.h +++ b/include/linux/fscrypt_notsupp.h @@ -159,13 +159,6 @@ static inline int fscrypt_fname_disk_to_usr(struct inode *inode, return -EOPNOTSUPP; } -static inline int fscrypt_fname_usr_to_disk(struct inode *inode, - const struct qstr *iname, - struct fscrypt_str *oname) -{ - return -EOPNOTSUPP; -} - static inline bool fscrypt_match_name(const struct fscrypt_name *fname, const u8 *de_name, u32 de_name_len) { diff --git a/include/linux/fscrypt_supp.h b/include/linux/fscrypt_supp.h index dc2babf3f7d3..e00191deb0d6 100644 --- a/include/linux/fscrypt_supp.h +++ b/include/linux/fscrypt_supp.h @@ -113,8 +113,6 @@ extern int fscrypt_fname_alloc_buffer(const struct inode *, u32, extern void fscrypt_fname_free_buffer(struct fscrypt_str *); extern int fscrypt_fname_disk_to_usr(struct inode *, u32, u32, const struct fscrypt_str *, struct fscrypt_str *); -extern int fscrypt_fname_usr_to_disk(struct inode *, const struct qstr *, - struct fscrypt_str *); #define FSCRYPT_FNAME_MAX_UNDIGESTED_SIZE 32