Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19227884rwd; Wed, 28 Jun 2023 06:48:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6doKDNq8AEm9pLv9B9oJ8+LmgFHmDVBMaaVzMv6DR5bBEUbrAfReRjERIDISrgfPnDNv11 X-Received: by 2002:a05:6808:1514:b0:3a1:c907:18b8 with SMTP id u20-20020a056808151400b003a1c90718b8mr9268110oiw.27.1687960108409; Wed, 28 Jun 2023 06:48:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687960108; cv=pass; d=google.com; s=arc-20160816; b=VkOpY3UipQNgWo1feddk7HeoBuS0ABGYrYfalnnysB+m58/Rn4X10LDRxFOF5Q6Ecd tgCdr80+t4q7+01WpzWhN3mB6fr3O1zaa4NO2JT/6gGwZUzpskWjDchIlibX2xsiifC1 6fF6TOIICdlbKkzX1Cos36uz7nu63IJQDnIBhe0AGhTQaDJGYW3BhYKWzL/FtDtROwgI 3okMeINL1/dx31XrMWs17Sh4octOfKW9rmkman5OUINxxDCKAxfn37g879GVCuQfBAwn yS2lwY+3WpVbd7nnTw60tYNZlvH9EwKwpQb9r6UkAgSD3d1N2zQKjTDpy91RAE9SC7Se GtPQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id; bh=umv3tlOcwAKRea9FMCN3hru8uNNmYXLG4rjQkOyr/+0=; fh=CQrzhyTAo/iBl2ZV5Eu/eUsNl6oshQxspNZuBDjQOVQ=; b=P1JLP53XprP/cDVu4eDdDyE04GtPUfd/jH8pGhsKFLGBR7WteU4spNr26LbYTCoio3 jL7W91Yr16xuCQRTVnXP38E+RkbJoQXVsJ45MVpogO5MPjS4XSu4l22T7fne8jb65+by OynZGhs01r3qeu584HW7NXl4IaA/iymmqOiyQGlQIA6aNVLA1ABTuxzXLb0PUK/2FWg/ XUYMgfDf0aWeIenIk4xwfoQSsdxei1g3VW+mT4gkAXsd84CD7k5U6gkpBL2bJYXTsc2f 5YzHhh3P1WFOgd7uldUiXaKmukDZDonZfHFMl1CXJAaS7O8Cp07A0r/tDZneriPTfLeL JiBg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=talpey.com dkim=pass dkdomain=talpey.com dmarc=pass fromdomain=talpey.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x24-20020a17090a8a9800b0024b011026aesi865784pjn.76.2023.06.28.06.48.15; Wed, 28 Jun 2023 06:48:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=talpey.com dkim=pass dkdomain=talpey.com dmarc=pass fromdomain=talpey.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231641AbjF1NQJ (ORCPT + 99 others); Wed, 28 Jun 2023 09:16:09 -0400 Received: from mail-bn8nam11on2041.outbound.protection.outlook.com ([40.107.236.41]:2529 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231698AbjF1NPy (ORCPT ); Wed, 28 Jun 2023 09:15:54 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jXVl/wKe7FOrmrjAWSgDszX/FnsFhfpU+oOVQ9Ms8yqVlWWxtz+fjlLzuuROMD5zDgeEB1mObmsFW4+f41UAzEJ1d0ev608YKgJd8QPPYVwDbYHF8NRBylhq4qs/jYpcUP4ZsDWAhBTgP7HGbm4foX6Hnpu8BgfzNGPa1EjRq8E7y1EWZAP1TuiV1Q0bzH2PCj5y+kbCCv3/1wXYlTSlkiMQTFF+5ot+b5h3B6tfyXWSEUwUZy8p4b9bhuHqWGrJu5f/19m7VgGJhYgfQgIZYsrEfFGG4fhGcfvZDTL4ZYT3eOB1K4Ow+r7vWumQSbSythYzs0J9ShZJr5AyoMg6eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=umv3tlOcwAKRea9FMCN3hru8uNNmYXLG4rjQkOyr/+0=; b=UhLULac7W1o7mw+7qvHAaxX9gR4cXKcfslmfbMtIhiseE6E47bnA7YgnMhtqvigJJA3ufv8w4h8pIQPFceJW3NTeYM6CFGqQOEZkdTpSA45s6TuK8WmuAmUGTMBeap4rMMpXu2y6kGbXllCBHEDPvY0xLi0L7kyFWymDCh0utAcDncb9BI8qtgl6cGEBlqxEgNN6SNyZv6krubuk/PSl6gV0nOB/Ill6/fm2/nbeOAYu8svA4ou3f2u6zF0NF5b44sS9IDjRNSk5ZDTf7iiiYKQ45j2scTG8VFLobnvplF17dIzco0vMfYjo+SnoYNy8f7Nfrm/JBDuB6XFyAWmg0g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=talpey.com; dmarc=pass action=none header.from=talpey.com; dkim=pass header.d=talpey.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=talpey.com; Received: from SN6PR01MB4445.prod.exchangelabs.com (2603:10b6:805:e2::33) by SA1PR01MB6784.prod.exchangelabs.com (2603:10b6:806:1a1::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 13:15:51 +0000 Received: from SN6PR01MB4445.prod.exchangelabs.com ([fe80::17e9:7e30:6603:23bc]) by SN6PR01MB4445.prod.exchangelabs.com ([fe80::17e9:7e30:6603:23bc%5]) with mapi id 15.20.6521.023; Wed, 28 Jun 2023 13:15:51 +0000 Message-ID: <9343462e-6a4a-ca7b-03b8-4855e5a33b72@talpey.com> Date: Wed, 28 Jun 2023 09:15:49 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH 0/3] dedupe smb unicode files Content-Language: en-US To: linux@treblig.org, sfrench@samba.org, linkinjeon@kernel.org, linux-cifs@vger.kernel.org Cc: jfs-discussion@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20230628011439.159678-1-linux@treblig.org> From: Tom Talpey In-Reply-To: <20230628011439.159678-1-linux@treblig.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BL1PR13CA0176.namprd13.prod.outlook.com (2603:10b6:208:2bd::31) To SN6PR01MB4445.prod.exchangelabs.com (2603:10b6:805:e2::33) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR01MB4445:EE_|SA1PR01MB6784:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f1f5a2e-4b2d-47a6-7f9e-08db77d9cb7e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1xfIL8URF8Ef6VReg32icpZma3Sd715dwET+M3lrr4yqAXnFBPRNl0LiFDH0BnFHq7jkN+IHtUvB+5eHziGO67kmS7ryb/v1UO5jlUA54zUWL0OGgsNriNqPwzyS1dBlgxPKnmS8JdqgOrPgayQZIzT6KjnJJ/eBF6JdPe1q8Xrjmd0htVgC39XExruvt4sqJEwpkkpAB3xKjMMszQkUQ0EseCjKwBXYhKXUNCBhPjCGiunTxvqemjIB3knG7PcHcs1YjdWgzSCjhBV1Cv3JuATqV1/9pWuB2+5GDjPJhJkvCzrnbjAz5lxznJmKG+uK1MexJpNoEB3bKbGmOl9t4p7Bt1VNSQlWWH11xl6vzzws9rVm2/pMO5w6pg77k4CDFO1iFw7p4zaOntHkKK8+XdfdK2Qu5noZ55a4guSRoBQ0UiEvqvPRp5mfvVQQ7Tbg74GrwKU4Ds4Na5zcO9mRUD4jzoViSKJX9cLGWn101VYnVymwhcqTFDPZYadScZMTP/cHzoJx+ntzmOj9DzNoqtwGjnupHfTGggL/HUkYsseCcPSAd22Xl0Yi+Q+/poKh+fLXPuvdxGcj1aDHR+cJ79WSEmEyRiuxKS7DyvsZrmx/qru3yTaQu14NFu31JgriisbgI5ylsk4gQBKWonWSeQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR01MB4445.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(136003)(376002)(346002)(39830400003)(451199021)(31686004)(36756003)(53546011)(6506007)(66476007)(5660300002)(86362001)(316002)(4326008)(66556008)(41300700001)(8936002)(38100700002)(31696002)(66946007)(38350700002)(8676002)(6486002)(966005)(6512007)(2906002)(186003)(26005)(478600001)(52116002)(83380400001)(2616005)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aGNrVHEyS05pOXVhUytGRFoveTF0b2RMRDZRejh2cEhKbVM0YzZQSVJ6TFJE?= =?utf-8?B?elhPaldseWMrYXM0Uk1KbnlLdVpZUzI0RlVLTFN6RVpZdkdNS1pOS1U5NFZF?= =?utf-8?B?M1dob1RzaWlTd1RNVUE5cHRFZGNwb0xJc1JUc0hBSk5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RFc3JxYklqM0w4RGh2Z1pkaUw2U1FueGlJNWZYaDZqOEloekwz?= =?utf-8?B?RkQ0R1ZaNXlJVVArY29lRDhHQmgzS1RxRTB6bmc3RW53RkUvaVJoSERvaWlN?= =?utf-8?B?U0h3TVd2YjYrUnFjSG4xZUJLblJWb0Nub1BOQUhiNUdCakRsL1FIdzkxSlJj?= =?utf-8?Q?g9uiznqCG2sSZGjdmtukphLxr?= X-OriginatorOrg: talpey.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f1f5a2e-4b2d-47a6-7f9e-08db77d9cb7e X-MS-Exchange-CrossTenant-AuthSource: SN6PR01MB4445.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 13:15:50.9976 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 2b2dcae7-2555-4add-bc80-48756da031d5 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5uFo9HEswso7UVRFr8qy1bCrjwSFCD7/YeCFPvJpcRFBMbeleMM0V45ABj3qUHjz X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR01MB6784 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/27/2023 9:14 PM, linux@treblig.org wrote: > From: "Dr. David Alan Gilbert" > > The smb client and server code have (mostly) duplicated code > for unicode manipulation, in particular upper case handling. > > Flatten this lot into shared code. > > There's some code that's slightly different between the two, and > I've not attempted to share that - this should be strictly a no > behaviour change set. > > I'd love to also boil out the same code from fs/jfs/ - but that's > a thought for another time (and harder since there's no good test > for it). > > Lightly tested with a module and a monolithic build, and just mounting > itself. > > This dupe was found using PMD: > https://pmd.github.io/pmd/pmd_userdocs_cpd.html > > Dave > > Dr. David Alan Gilbert (3): > fs/smb: Remove unicode 'lower' tables > fs/smb: Swing unicode common code from server->common > fs/smb/client: Use common code in client > > fs/smb/client/cifs_unicode.c | 1 - > fs/smb/client/cifs_unicode.h | 313 +----------------- > fs/smb/client/cifs_uniupr.h | 239 ------------- > fs/smb/common/Makefile | 1 + > .../uniupr.h => common/cifs_unicode_common.c} | 156 +-------- > fs/smb/common/cifs_unicode_common.h | 279 ++++++++++++++++ So far so good, but please drop the "cifs_" prefix from this new file's name, since its contents apply to later smb dialects as well. Tom. > fs/smb/server/unicode.c | 1 - > fs/smb/server/unicode.h | 301 +---------------- > 8 files changed, 298 insertions(+), 993 deletions(-) > delete mode 100644 fs/smb/client/cifs_uniupr.h > rename fs/smb/{server/uniupr.h => common/cifs_unicode_common.c} (50%) > create mode 100644 fs/smb/common/cifs_unicode_common.h >