Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp4254286ybh; Tue, 17 Mar 2020 15:27:06 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvrChpzXpX5PiEToBNkKFko9ubsyZpU94jB8bRFyAYqBHiAjh26FUuj9tOqdmshNmoo0t13 X-Received: by 2002:a9d:4d02:: with SMTP id n2mr1254052otf.107.1584484026100; Tue, 17 Mar 2020 15:27:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584484026; cv=none; d=google.com; s=arc-20160816; b=fI9PT1uMd6twGbxBZJ7iIAQSIfQl6zESgqDqZs9AV7i8tBgSoe/uoeebO8yd82OUhe dOCsp2Gx5Jl1YtxP/HKXVF264Ibdo/tQjr3tny9Atz7YriBmJynjO/MOGy2/Z+l/Tlhx SEH/W9k7VhbmgVIPVw/IC3yMUKDjaHDfhYHlVrpoqLZhn+Bx0TGaDVpCMGvq4t9jTmGy 0RDVOaG1ISu23qI5TFQqcyW82tewPnn/o+aBEur74Nk+hpcGOMQNtiBluFAiS5zrHOV2 +/i1zDlAW1ri42jfx3vRxfn5poE0Niu9lOQphxWZpIyQHNhx2MaYabY0hDor2+xu59pe s3XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=euG4KVEi59wLKrO8NlwRzGdrvphzZwmiBVRlBmIDxTs=; b=yvtYoDZKjxJ8+b2pA+FIXnVSZP6WB3ZMhaSPToZ/gAecpYWaAZm0fkXlDVcwlYAlqj 9O9B7fK25zAKC/8s+bJHpWP2c+hkxmvbBB0/3wSyHr5PjSTgJEronKkF33xbkc9BuhGn u3A2cSiZqZxVF7PQ5cufhZvs+o9dvnyTPJgsvzI0KuyMWDCcxxCg/WMLKvNculRPBLw5 GQPRqCPpIFJn8SPgQCr/lFnhxyTxB+/DtugjovaGGpcO37zNo8wOGPdo6jQeEFJSiY5m Elx1kixi1OFbuJ3wk4sUFmII1OzZbRB3j+8w83/mH+/t2PTA2w9b/kwWCrYtxwYN1eM4 l/KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hKOtdBSR; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e16si2505932ote.190.2020.03.17.15.26.52; Tue, 17 Mar 2020 15:27:06 -0700 (PDT) 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=@kernel.org header.s=default header.b=hKOtdBSR; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727041AbgCQW02 (ORCPT + 99 others); Tue, 17 Mar 2020 18:26:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:35842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726549AbgCQW02 (ORCPT ); Tue, 17 Mar 2020 18:26:28 -0400 Received: from pali.im (pali.im [31.31.79.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 81C41206EC; Tue, 17 Mar 2020 22:26:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584483987; bh=+JTzPXcPkCyKYx1B4NwENKXSxFboyMHPPJwk0dqBWAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hKOtdBSRfspBsti0dNCifFouGHgJZrHbGryZbBD2IZWHNxSs6q73WIZBN92aYusx7 GY9H4Dk4MNZUI2M6wlAUftjFM9Blhr4It8B2S+crfp2VTURfSSrDHskyeU+DVyLYFa zVFCSSNpNEXLCvJ4GgS8enHTvpq9JqyoT8bnCnT0= Received: by pali.im (Postfix) id BA5CD700; Tue, 17 Mar 2020 23:26:25 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Namjae Jeon , Sungjong Seo , Alexander Viro Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] exfat: Simplify exfat_utf8_d_hash() for code points above U+FFFF Date: Tue, 17 Mar 2020 23:25:52 +0100 Message-Id: <20200317222555.29974-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200317222555.29974-1-pali@kernel.org> References: <20200317222555.29974-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Function partial_name_hash() takes long type value into which can be stored one Unicode code point. Therefore conversion from UTF-32 to UTF-16 is not needed. Signed-off-by: Pali Rohár --- fs/exfat/namei.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c index a8681d91f569..e0ec4ff366f5 100644 --- a/fs/exfat/namei.c +++ b/fs/exfat/namei.c @@ -147,16 +147,10 @@ static int exfat_utf8_d_hash(const struct dentry *dentry, struct qstr *qstr) return charlen; /* - * Convert to UTF-16: code points above U+FFFF are encoded as - * surrogate pairs. * exfat_toupper() works only for code points up to the U+FFFF. */ - if (u > 0xFFFF) { - hash = partial_name_hash(exfat_high_surrogate(u), hash); - hash = partial_name_hash(exfat_low_surrogate(u), hash); - } else { - hash = partial_name_hash(exfat_toupper(sb, u), hash); - } + hash = partial_name_hash(u <= 0xFFFF ? exfat_toupper(sb, u) : u, + hash); } qstr->hash = end_name_hash(hash); -- 2.20.1