Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1024375pxf; Wed, 7 Apr 2021 18:01:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziEGnvynT1AV+pziylHGzganb1q0aLCWf36qBfEMtswjOfo/RXTQ/45IF0veUE8jFxTN9U X-Received: by 2002:a17:902:7246:b029:e6:78c4:48d8 with SMTP id c6-20020a1709027246b02900e678c448d8mr5608483pll.18.1617843704910; Wed, 07 Apr 2021 18:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617843704; cv=none; d=google.com; s=arc-20160816; b=0GEwM3pK0RDd5tIxAITysscdyLlmzVeaPbESPjjbNqAVAyLq4RyChUyOc7e8m6ceOo d2Ob16fTQF6nUbLO6b3VtDTOVDZwytutK9tHw5q7EffggcrF0u57epUg9pn/UaPzVj+Y cLViMxWO56QYNw+JfI011zqZi+P4AsBa7+IwxUL2DJ3IkaT7Z+hXmCC9wVip3bZGH2wR oFCxd6gkcABEUkMo9MwzgzF/DJ09IwL74TCLxor6hrC1vErNRgYv6rizOXBa9pJt/bMM IIfS0DNRSTCYhxitu1XWUa2xx5z/efALMI0inI0DEhuzlxJZ25/yFSDry7MMOSlGXtuY R4jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HRdOv8XWEN6pduLbv8Z++q7FZaa+QUJ6ozBiD0S8iuY=; b=ZxB1wXgLh3XJ4d7gRltGqMWAW2LZUTzOGKtPHIXq+xIsbOx8tK8B4xM7obBwmY0i7A poqacwN9PAarMBm+ceWbM+F/hRyTsVSVaRYjAJfR2RH2uL81SupmxRROPqR1Hc0oE7WF fXbxTCenF5Cz63EbRi9xWQ7qyfrOrHgIoerkU044UDmEYyMxHxW6KFcdmZQKIQZZmOkR 0N5wDG2ZLzW11az/I3cSpp9OGX+RyW3KWbhb/6wVGslcoZSwAL+FLapfmkYR/r5qouw7 QaYKDAUhHUW49c3d04BOY5PZb145kaGR8uUWAUf8SKBcLVjPHHEjjw+T4yfpeO8Mv2/m 3vGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f1IAmgDh; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si2327591pju.170.2021.04.07.18.01.32; Wed, 07 Apr 2021 18:01:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f1IAmgDh; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229849AbhDHBBj (ORCPT + 99 others); Wed, 7 Apr 2021 21:01:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:46300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbhDHBBi (ORCPT ); Wed, 7 Apr 2021 21:01:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CDABE6121E; Thu, 8 Apr 2021 01:01:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617843688; bh=4u5tOpeCMncpEEQTHvI1+RnAHtrGNOf7zF8rhQ0eQbI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f1IAmgDh/ajJXxqKR9vXpvbxKyFaWcCycgnCj0Czvr6yiCvIbQQqLEttUcyroC3iz +b+B8zQ14heqrSnyfEi5fUdZyyJmW0vIMazvd2wIwAnoCcpMwd0k+tXBmDgOLi/8IJ +AsOkm5cNi0GdTcNjikrbtPCvU5K/55cv6csvcuPqAtWDIXFB79v9Du4F4WiuO49Go p0wTQekgcBuRylR/AP+Z+ncpt9dg2Ypv9RpIXnG+H3egdTZapV+MDYQLDhZ4ciHjlS BdGYyUCH6GZ0C2BlVAP2EUdTP7SwusqsGPZFVNO8Mpg2L54LBtBbN8FCS3M+Rlytg8 PyJ1mhozAsknA== Date: Wed, 7 Apr 2021 18:01:26 -0700 From: Eric Biggers To: Shreeya Patel Cc: tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, chao@kernel.org, krisman@collabora.com, drosen@google.com, yuchao0@huawei.com, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, kernel@collabora.com, andre.almeida@collabora.com Subject: Re: [PATCH v7 4/4] fs: unicode: Add utf8 module and a unicode layer Message-ID: References: <20210407144845.53266-1-shreeya.patel@collabora.com> <20210407144845.53266-5-shreeya.patel@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210407144845.53266-5-shreeya.patel@collabora.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Apr 07, 2021 at 08:18:45PM +0530, Shreeya Patel wrote: > diff --git a/fs/unicode/Kconfig b/fs/unicode/Kconfig > index 2c27b9a5cd6c..0c69800a2a37 100644 > --- a/fs/unicode/Kconfig > +++ b/fs/unicode/Kconfig > @@ -2,13 +2,31 @@ > # > # UTF-8 normalization > # > +# CONFIG_UNICODE will be automatically enabled if CONFIG_UNICODE_UTF8 > +# is enabled. This config option adds the unicode subsystem layer which loads > +# the UTF-8 module whenever any filesystem needs it. > config UNICODE > - bool "UTF-8 normalization and casefolding support" > + bool > + > +config UNICODE_UTF8 > + tristate "UTF-8 module" > + select UNICODE > help > - Say Y here to enable UTF-8 NFD normalization and NFD+CF casefolding > - support. > + Say M here to enable UTF-8 NFD normalization and NFD+CF casefolding > + support as a loadable module or say Y for building it into the kernel. > + > + utf8data.h_shipped has a large database table which is an > + auto-generated decodification trie for the unicode normalization > + functions and it is not necessary to carry this large table in the > + kernel. Hence, enabling UNICODE_UTF8 as M will allow you to avoid > + carrying this large table into the kernel and module will only be > + loaded whenever required by any filesystem. > + Please note, in this case utf8 module will only be available after > + booting into the compiled kernel. If your filesystem requires it to > + have utf8 during boot time then you should have it built into the > + kernel by saying Y here to avoid boot failure. This help text seems to contradict itself; it says "it is not necessary to carry this large table in the kernel", and then later it says that in some cases it is in fact necessary. It would also be helpful for the help text to mention which filesystems actually support this feature. > diff --git a/fs/unicode/unicode-core.c b/fs/unicode/unicode-core.c > index 730dbaedf593..d9e9e410893d 100644 > --- a/fs/unicode/unicode-core.c > +++ b/fs/unicode/unicode-core.c > @@ -1,228 +1,132 @@ > /* SPDX-License-Identifier: GPL-2.0 */ > #include > #include > -#include > #include > -#include > #include > #include > -#include > +#include > > -#include "utf8n.h" > +DEFINE_SPINLOCK(utf8mod_lock); This spinlock should be 'static'. - Eric