Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17458614ybl; Thu, 2 Jan 2020 05:57:33 -0800 (PST) X-Google-Smtp-Source: APXvYqxJOnBKbR8TTnNnEAvSRq9chzfmqtE7P7q/9mwEh4bfq9lVNkGf077z6gySZmTv45pjauqy X-Received: by 2002:a9d:4d8d:: with SMTP id u13mr89378198otk.299.1577973453389; Thu, 02 Jan 2020 05:57:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577973453; cv=none; d=google.com; s=arc-20160816; b=fpATXqb7nex6EcxSzcOArdbXqa/XPWT+/oOIopL2GcD0kGWrZKMgRckHNuO8gHL67a KeI9z3Ir0c5Cr7ZSNDOJNi809sKKoK6Vo9VwDGXpyw6zsT/SBEfL5Rp7fRcJUNKB6mht snyJE5tLOUrdOPSqJTSQzdJGcSuoWUbk92ugGPRTvVtnROrctD5zu73fnpZmaIDPSLMV yHo2sE9Sl2LgPEp7xM9KyQJY0lwljpD8MDZw/aCz2L6fw9Xnz/jo3YT0O+lKMWrmudVu 2OLMzehSHoQ507HW2S1Csy9VhYHafflgx7AC352GyXLcbLJYzja3sXKucQIkx1ysUGcS GKvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Umw3KabgQc+joAVZVI/kqZfdiIRA+6g2g4xfLJJZ/Ts=; b=0+zywxCIlX1+C285gHS7SFOduvNX6jNhlpMDfkbkoDCWYsFmkAyb8HhVFVsHcqoUg6 qNIl0/HI0gqOT87uRC48vOngCYsjxU4RUVrATtGDMI9Nx3fhEq5AcwVCLXirIWnElNpb VFX0pkhtPkEIlQM+B0pA7U+AA8bAvAte6XCzh63bortLQRlOgI3QY1LS+LB53fR58Gg8 CxtbvRGS17zm+hvF35PEmGAyOKg6BJdwh8C6H2iW27cZ2itW+3kqVEuDHsBk3sCW3UNV IKO4maRgqCucW3yNuefe2dbKi6K2eURy+Hsl2RfFD+7ZI2fz3gqUr++kNIhtWSu7P6Fk TVTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W6MKeho9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d22si26807615otf.256.2020.01.02.05.57.21; Thu, 02 Jan 2020 05:57:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W6MKeho9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728473AbgABNzF (ORCPT + 99 others); Thu, 2 Jan 2020 08:55:05 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:37896 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728342AbgABNzF (ORCPT ); Thu, 2 Jan 2020 08:55:05 -0500 Received: by mail-wm1-f67.google.com with SMTP id u2so5700477wmc.3; Thu, 02 Jan 2020 05:55:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Umw3KabgQc+joAVZVI/kqZfdiIRA+6g2g4xfLJJZ/Ts=; b=W6MKeho9eQynkeDso8Ap8avMGZoSiEZy9PoRcCXamHEpKXKVXeb7UhSzOMr259Bp7d mhf27AUh3BZkAdcmB2YdYYSuBiqE+/cKgmcSNsHgmmKoR7kAfdj+HaE78jc/45raO0h3 bW6yKE+KXVRlEWiBTVftfape34T3lSwfTvNvi0fzy4VuUKFi4ZwFeXzfuhR+LmpSRj3I j34XadXGgRwyxLIrI6cvGRwFts0h9rpEJmlpt1+dWtReAiszQAT4fyIFeEtkOCE3H+4s EjVy4SohDJp5rGoXovhyQVDoLQU0A6+LhVe+ZZC1CHe4eavB/IU8vm6hTLhFIXhv/FAG 50pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Umw3KabgQc+joAVZVI/kqZfdiIRA+6g2g4xfLJJZ/Ts=; b=COVQZHEj3aIHia5BN/yIuFV4gZpgTsd6nwhkvQcz2DN2r+i9ZGaNekM6tzXOdCluH8 06Aq09cHUUuPB/q81Xe8qc1jaSShk9oFNC5KQ2I4TZYpRPWfHKbgy2IBrJR1alOMG6LH gwzVH0v56SYhSmj49b9th6QdDcw6xJfFaEUA0sUNkfHwtd6eHjVPHk6CcFEINE5ELAeX K8Q87q13r/UJ2cOOfOD8y+SQIUoU4zD4RhnRw+CSkVqzpL5ut7JdV34/CEKIKvtCVMjx rDCEul4dPrm2yyJ9GCfcSpeeLSBfvQnkZYioKo7ge3yY7WTa0Mo+QBkgk7cgib7mXI77 a6NQ== X-Gm-Message-State: APjAAAX+1WB2tLpAVT35YfSYOJ07gpRq3K+KVkgr+lTEZiHKzbAdrK9T OUVNML0G8m17+34/VSdBqC8= X-Received: by 2002:a1c:2786:: with SMTP id n128mr14851523wmn.47.1577973303893; Thu, 02 Jan 2020 05:55:03 -0800 (PST) Received: from pali ([2a02:2b88:2:1::5cc6:2f]) by smtp.gmail.com with ESMTPSA id i16sm8689698wmb.36.2020.01.02.05.55.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2020 05:55:03 -0800 (PST) Date: Thu, 2 Jan 2020 14:55:02 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Namjae Jeon Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, gregkh@linuxfoundation.org, valdis.kletnieks@vt.edu, hch@lst.de, sj1557.seo@samsung.com, linkinjeon@gmail.com Subject: Re: [PATCH v9 10/13] exfat: add nls operations Message-ID: <20200102135502.hkey7z45gnprinpp@pali> References: <20200102082036.29643-1-namjae.jeon@samsung.com> <20200102082036.29643-11-namjae.jeon@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200102082036.29643-11-namjae.jeon@samsung.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 02 January 2020 16:20:33 Namjae Jeon wrote: > This adds the implementation of nls operations for exfat. > > Signed-off-by: Namjae Jeon > Signed-off-by: Sungjong Seo > --- > fs/exfat/nls.c | 809 +++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 809 insertions(+) > create mode 100644 fs/exfat/nls.c > > diff --git a/fs/exfat/nls.c b/fs/exfat/nls.c > new file mode 100644 > index 000000000000..af52328e28ff > --- /dev/null > +++ b/fs/exfat/nls.c ... > +int exfat_nls_uni16s_to_vfsname(struct super_block *sb, > + struct exfat_uni_name *uniname, unsigned char *p_cstring, > + int buflen) > +{ > + if (EXFAT_SB(sb)->options.utf8) > + return __exfat_nls_utf16s_to_vfsname(sb, uniname, p_cstring, > + buflen); > + return __exfat_nls_uni16s_to_vfsname(sb, uniname, p_cstring, buflen); > +} Hello, I'm looking at this function and basically it do nothing. Or was it supposed that this function should do something more for UTF-8 encoding? There is one if- statement, but in both branches is executed exactly same code. And executed function just pass same arguments as current callee function. So calls to exfat_nls_uni16s_to_vfsname() can be replaced by direct calls to __exfat_nls_uni16s_to_vfsname(). Or maybe better, rename __exfat_nls_uni16s_to_vfsname() function to exfat_nls_uni16s_to_vfsname(). > +int exfat_nls_vfsname_to_uni16s(struct super_block *sb, > + const unsigned char *p_cstring, const int len, > + struct exfat_uni_name *uniname, int *p_lossy) > +{ > + if (EXFAT_SB(sb)->options.utf8) > + return __exfat_nls_vfsname_to_utf16s(sb, p_cstring, len, > + uniname, p_lossy); > + return __exfat_nls_vfsname_to_uni16s(sb, p_cstring, len, uniname, > + p_lossy); > +} And same for this function. -- Pali Rohár pali.rohar@gmail.com