Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3215451ybl; Sun, 2 Feb 2020 17:53:04 -0800 (PST) X-Google-Smtp-Source: APXvYqwcMepc+oZ+eQLo2MLEMel8xnxkbhOUUphAOIL6Xc7frXceiXcL1RhC2svy6gtp7lisONDD X-Received: by 2002:a9d:7357:: with SMTP id l23mr15539207otk.10.1580694784800; Sun, 02 Feb 2020 17:53:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580694784; cv=none; d=google.com; s=arc-20160816; b=bp1crbNFXuFf5T+f5ri/fQT1K2vw7YuQZflmIWktN/ygoPsQEya0SP5o0QN9NQLrJl NcR8Tu86+xTyY2ShP/ES2SOz238/uK9ydlChZ4cnB+PscOtsURh0g+SVzRN4ENgYBs2h ghf4fMGlLAWz0HvVcXmzCC+un2QGuN9NXa2R4vDmhI2e9kahj2/ENrV5VKTfsUqcEkTm ElAivY/gdC2m9oNgqs5rXCi2M2Iiq4qE7rG6UHSjrZW7qptWtZvEQTsExr4vdUeoRg9A IcXrA/AZWi5hrvQjSI800tj1S/SzUmUWxxoJ+sJ+PnOyReTIiIqF0kPjeNtBYkA7Fd5K eqvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:organization:subject:cc:to:from; bh=nUYYIl4IRRlyjjI0vHcmCONz8SS2vgF0ouje8+gD7Tw=; b=yqTVIt1EhHBddFjyjGD+jqEb9UH+c1jUMgqghZiSOnvbjjGPNEEm2sydNiSxhARUnB otd9nqjzDuUt9VSMcpIvrLK/6HuVNImIowQFFBCMyr+a9iEd8+XdbkwKBcnVt8k+yJbH M9GgI6GPdny4xjCt/Pj7KaUxSDj9hvr9n4i2IZmn6ODR0s0084BMnLmGR6YHyjrtRkmO +g3UWzggLhncpkFkfQbXha/M0rqrHqcDDDGWDcCKkhZ6F0tVv1fJwyjM4MbAkmKfEkS5 YO2nIhNUeqRu3utSNNHeYLS3WyWLo1xT1ftCBlEm9/yRREdYOBNEk7alsCYrVBROM+ov /1/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h28si9119068otg.63.2020.02.02.17.52.43; Sun, 02 Feb 2020 17:53:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727164AbgBCBqI (ORCPT + 99 others); Sun, 2 Feb 2020 20:46:08 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:46746 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726971AbgBCBqI (ORCPT ); Sun, 2 Feb 2020 20:46:08 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 085A328BEFA From: Gabriel Krisman Bertazi To: Daniel Rosenberg Cc: "Theodore Ts'o" , linux-ext4@vger.kernel.org, Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net, Eric Biggers , linux-fscrypt@vger.kernel.org, Alexander Viro , Richard Weinberger , linux-mtd@lists.infradead.org, Andreas Dilger , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v6 1/5] unicode: Add standard casefolded d_ops Organization: Collabora References: <20200128230328.183524-1-drosen@google.com> <20200128230328.183524-2-drosen@google.com> Date: Sun, 02 Feb 2020 20:45:59 -0500 In-Reply-To: <20200128230328.183524-2-drosen@google.com> (Daniel Rosenberg's message of "Tue, 28 Jan 2020 15:03:24 -0800") Message-ID: <85sgjsxx2g.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Daniel Rosenberg writes: > diff --git a/include/linux/unicode.h b/include/linux/unicode.h > index 990aa97d80496..5de313abeaf98 100644 > --- a/include/linux/unicode.h > +++ b/include/linux/unicode.h > @@ -4,6 +4,8 @@ > > #include > #include > +#include > +#include > > struct unicode_map { > const char *charset; > @@ -30,4 +32,19 @@ int utf8_casefold(const struct unicode_map *um, const struct qstr *str, > struct unicode_map *utf8_load(const char *version); > void utf8_unload(struct unicode_map *um); > > +int utf8_ci_d_hash(const struct dentry *dentry, struct qstr *str); > +int utf8_ci_d_compare(const struct dentry *dentry, unsigned int len, > + const char *str, const struct qstr *name); I don't think fs/unicode is the right place for these very specific filesystem functions, just because they happen to use unicode. It is an encoding library, it doesn't care about dentries, nor should know how to handle them. It exposes a simple api to manipulate and convert utf8 strings. I saw change was after the desire to not have these functions polluting the VFS hot path, but that has nothing to do with placing them here. Would libfs be better? or a casefolding library in fs/casefold.c? -- Gabriel Krisman Bertazi