From patchwork Wed Nov 2 07:11:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuezhang.Mo@sony.com" X-Patchwork-Id: 14047 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3456719wru; Wed, 2 Nov 2022 00:19:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5w4A0g1pixIFt378nogZfnD+fLzLigOE0FuxWQ3Az6xiGj9Ugloq4HxPeqEzEiZ3i/rYUv X-Received: by 2002:a17:907:7e9a:b0:796:7a21:1520 with SMTP id qb26-20020a1709077e9a00b007967a211520mr22451155ejc.236.1667373584609; Wed, 02 Nov 2022 00:19:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667373584; cv=pass; d=google.com; s=arc-20160816; b=z08W4Dj4n6ttESUNhUpeVzFQPU9embIbNXg/HI2bttM3igk//tV9dLBJe7i/2LY3iM 8taUqC+koCv4bsWZblzT/Ays4BllmQ5tLiB2UXrQMKBhcAWfuQEMXCmH8x8YIUVNUMpf yGYyKnMQPVTfXRqstI9ulZqP9wFbeoQNMrCzq69iba/xb8+LPEY/S+eVIFy+Kxv7hXCK cO6o5rS10ND28QyATthI+DF5kPsb55CMm0e3MWlgbXmxSaOO78zWyZt/eJbc8CxDLdd2 yW900bh74oi4taO45QLIFL6eqDUmcoYAb/AzB+Qa26hHje7RuatXBemTy22HHo4JjWyi 6pcA== 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 :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=l2uHTGsMyHlxbrdJ3Hhgv0YxmRF9V6gTmaJe9uNYoxU=; b=wA8R5OCEpBowq3+uan4IOzoyzVyR65RNeVheiq2vPRMETpFGhEFPTipUDY9j4bi0RG xlHIZYn6mRsJZITGAabKk/LcAlGDgmfahIXFQmBAwWdIgrw+r1di3IKIuW3+8oqhH93Q L8WLjjjIoKPbnFLBvXDmwig61pBQ9EdPUq6vUchpjPfZxov7s2CBlhyS+SWjdEZM3TKO iKU+fai24qYfwkDAe35wAxqMmmJZ/4WxWcnAAomr5uGizPfoxGS9FJgy1B5lJO3eR4V7 VA8AISKeKHUbsLe5biGYF5d4bJ0Eom6Q3uBAf01tEDCkMmq7ISEBYY3k3SVn1nkAdxD6 LtVA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sony.com header.s=S1 header.b=DvrIpn5v; arc=pass (i=1 spf=pass spfdomain=sony.com dkim=pass dkdomain=sony.com dmarc=pass fromdomain=sony.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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sony.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g16-20020a1709065d1000b007adadfc97c7si13874643ejt.918.2022.11.02.00.19.20; Wed, 02 Nov 2022 00:19:44 -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; dkim=pass header.i=@sony.com header.s=S1 header.b=DvrIpn5v; arc=pass (i=1 spf=pass spfdomain=sony.com dkim=pass dkdomain=sony.com dmarc=pass fromdomain=sony.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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sony.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230271AbiKBHLq (ORCPT + 99 others); Wed, 2 Nov 2022 03:11:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229598AbiKBHLh (ORCPT ); Wed, 2 Nov 2022 03:11:37 -0400 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D6E3186FE; Wed, 2 Nov 2022 00:11:35 -0700 (PDT) Received: from pps.filterd (m0209323.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2A22tocg015311; Wed, 2 Nov 2022 07:11:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=S1; bh=l2uHTGsMyHlxbrdJ3Hhgv0YxmRF9V6gTmaJe9uNYoxU=; b=DvrIpn5vblQNX7pQ/RZ1lJ+J0E9YaWCok+kkKZ+dmSXn9aA0LMyLzMoW/VH2/1kJnhlE sbOOzXMFaLT0RcFS1Qjnm84rkjbN7vlrzJnJF22+Evegbw9PMp4ca3Mc3e4tQQiDt/0L pTTKm28lrZYyKDClsVVRZAuKhAQLZWjutFPhUVKiUwVvBXhQRjd265TVaxBvga7iAwrX NQmh2Uu+krN43prIo2GApQB6h1weNlxe2MMjiLX7nSVNT79ahS6RbbnZwto9zHd0cMhc hd2YcCvAF/InB1ULmLEG6jkuIIi+Tg0RLfLYZjVcDHK13nvBNCA7V5RQA/466D/LoqA4 kg== Received: from apc01-psa-obe.outbound.protection.outlook.com (mail-psaapc01lp2044.outbound.protection.outlook.com [104.47.26.44]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3kjhf8j0dc-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 02 Nov 2022 07:11:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AD0+Fd02S9auKkzSpn/k08/zrmWTsYzozucjodDQIYUZhL/61Au9K7QukpsMqQqu4QdlyvyVU1zvRTfV5q0A01K49Xg3X6N/4U4+JKQbn6mL0n7BfxEm7NphShHnUp6UsUxuJfvpdtiCzcbt3oCyvkonWLFMMjez5BiF8+1LpVhKMHiHIE5HwgVinRUEXNED9L3YK/ywGm014fx85vZO+tPGiYW6Zf9vmu4viqBvd4hTBVIwDCZo1DW92zvITPf83W2kilr0XeyFVvYankyAgzmc03WykA8v6bANb1qeA+5/syt4Ku0Xy27p1DVZEScpk/Mek34Jc9Vls++rNH4r7A== 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=l2uHTGsMyHlxbrdJ3Hhgv0YxmRF9V6gTmaJe9uNYoxU=; b=A6VJ4uEXm57uCmXHYmI20D4d0qXo11nZdpH7aM/ChHDnEPIp75no+/wgk8dAmifcApaVzdEfaHi1zWvJh+Xq5nmqPqX3SPjfoKpJfMW5GCXI9vDVY274s+967LJIIhK//c/lwU+J9/RLwAHrd5DLZbSKydnwH/C4UFHn9RmBqKNn3JK6/SnEJlddBdxN8FIc2ZgDihx0WXRLjsde4uuEn20Ap9InzSU6c0tkw1rEN3gKD6W76UBIMTs/0R9BupK1M2YIvivB90voUv3ykIFfY6mF2bmERdw0z7xZow9PSRCPT366ZxgP3oEkN4jvNca5S/Lr5soCGVTW4VrO/LrpLg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=sony.com; dmarc=pass action=none header.from=sony.com; dkim=pass header.d=sony.com; arc=none Received: from PUZPR04MB6316.apcprd04.prod.outlook.com (2603:1096:301:fc::7) by KL1PR0401MB6242.apcprd04.prod.outlook.com (2603:1096:820:c2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.20; Wed, 2 Nov 2022 07:11:20 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::708b:1447:3c12:c222]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::708b:1447:3c12:c222%9]) with mapi id 15.20.5769.015; Wed, 2 Nov 2022 07:11:20 +0000 From: "Yuezhang.Mo@sony.com" To: Namjae Jeon , Sungjong Seo CC: linux-kernel , linux-fsdevel , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" Subject: [PATCH v2 1/2] exfat: simplify empty entry hint Thread-Topic: [PATCH v2 1/2] exfat: simplify empty entry hint Thread-Index: AdjuiYCKj4IPGKfeSPGqWj6Mqbkdzw== Date: Wed, 2 Nov 2022 07:11:20 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PUZPR04MB6316:EE_|KL1PR0401MB6242:EE_ x-ms-office365-filtering-correlation-id: 08e83b6e-756b-4af7-88e1-08dabca1718b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 64PnOna9/a52xZL2q9YtD+gyhrWM+q8YIEgRH3WEiCjOxrBUCYEaIRReFa1BlkdkxWphj0K2bmpcc8KKjmbKP4Fmz+WOUfJEX9T+By+YhmI4ouEl2Lf4Hchw+5x5VuJnEwq24tZZ2EJ8Z7AW6DA0pl3efwoa+jbonSeYOt62UxVctaidztL4mcfgIkx8+4XDLCc08W49mOsoiaAdzlDleZytdUKGiBrxLvZFoXC1rLqXO5Zrex7uezykXGhVOizYphX/d9mVhDIbLpPhtaoL2lJ2u1+CPrmAhb3CMLbvQkSD8Ioaq/1FQVV1xFp13hyScUDGnb0Y37GMBDFzq+ax+klKasPAMgkpmLDw4PLR3rqQvP0k/FCB4RqxbRwLtNzmZgpEQ2VLfHw3zVt7XqdrVU/RsARbCbT4lz4xtx0FY+FkVHYyfpRD7w8f6W4NZoeC1pZ2eY22lcvX5fFtE1pIAbvmOPmXby2Y1M+ODWRakw/Nj7lOAZoFHRym60UIvRRSu66MXJ6whdpJEXrgaF9Fmy3f2fCoTt9PyT7dLzFlTDTEmZVGPdmeTFRG8hqKWgXOGEgOWqtCOVVUkkfUZdORgYSZijPB7GXmwjH1JdTG3ZvSyMjJnPcXwZSp25RcbcV9TFwv28omFA/TDDAKk2SMVoHIWB0PfL73OlDqAVagidL1RvLVNDx1VfGmctTDm/lwg8RiDIZA/0vjujNKH80OSRjeKm5oSihobgl8QI3CqmUj8RL2hLCX5h1z6ZkAJaqykpVhGZxFpciWqd61lkLTDg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR04MB6316.apcprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(136003)(366004)(39860400002)(396003)(376002)(451199015)(9686003)(6506007)(186003)(107886003)(316002)(26005)(2906002)(83380400001)(7696005)(55016003)(54906003)(66476007)(478600001)(66446008)(41300700001)(5660300002)(64756008)(76116006)(71200400001)(8936002)(66946007)(4326008)(8676002)(66556008)(52536014)(110136005)(86362001)(33656002)(122000001)(82960400001)(38100700002)(38070700005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?geqQytCNlOpOYxk5X+DoLNnbP/LD?= =?utf-8?q?yyShll2OcBQ4T52vifRXm0UmBMzaxsTK1XcK1a6pKmQczbfsg8qNzUCuNSm88Q1a4?= =?utf-8?q?RLpz2guwhZD2rV9lhhvkHwMRplbfsec5uZNzKjEyGRRyR4wz/ul5KKLQJu+pFCi2z?= =?utf-8?q?05+9+xSm0dyBUJEqX5OHBtIWEPcZezPZBX6bOMD2JHswwNA7THynwLQDr03FoNH6/?= =?utf-8?q?87iDHWfH/MngyFjfcNG8NtWXLrIC3YRJDdp6vMh/0n2+3WViA9/jD5vrluu7+JuvF?= =?utf-8?q?u/yia4u+mYAygYOqXIWXnMNzFbbYW325jhPMwv4ydaCz8ftqKTm8JwGmFNF4naCEV?= =?utf-8?q?6t/+h8NYz7Hjs7PXDwsL0L5c/gHP9EgmzlzbWZILUUT5PNJ1l6zzGVPtm5pIQSkDj?= =?utf-8?q?ycC3Fs/JfvfTIO0dAeOG79fuy4xcKljCgyhE7B60/4nG0CtLvl4SMVRuwIeNpVdht?= =?utf-8?q?0/m58KqDaa0ys2cz0wjm+xuGZzB8V5dIf5kDvzLFi0QWHtacYzlYXaJ1uP30DblE8?= =?utf-8?q?DKdAg4QVh0y/yAvmtZpBa1tGZxdE8eJOF+W1HU+YZjM/i1WcFX0Kv3PxBvmMrXIF+?= =?utf-8?q?Mlbfjem0L9WaBYWhpJV57T48G4mitC9Qez+Xb1hPqJCBdirAc221LHPw6cB/Kg+Ti?= =?utf-8?q?Evau1BUaAeh4ybC70NUew8vVzXPkyBANRRGTI/Rt4g4LZ+PwgBKx+ZfoX5Sv/rzIO?= =?utf-8?q?SWBaMVghtjKCCGpz0t2XbHblMBvZ2BB0BC0cPtqrMhRUyHyrUpp29sGIeRF6+iYSD?= =?utf-8?q?V6vhgdZ/0rPmFYokni6VWqPGsSk7Ir4pkLPNZAMHFdCFP1rsW89qNib7tM0jQWqtI?= =?utf-8?q?PSA6lHlNyn351bmSMkZsRmA0CgFAZD+NrOsxzM2ySKRKaryd5Hacz51Mce0QtH6kb?= =?utf-8?q?fIl7ePTUoPr87nhKsM9qfqhNxsuH7m1+A2FvrUCig1wsKICqdLljGwEc2LhmVnajC?= =?utf-8?q?FufqhPPNKY+RsUZW60yqMofxsnyM97gPgtsqFqVG3TLBJcrbCVtkzC1vIo9kWM/y+?= =?utf-8?q?9YZ4iRqiL6askbYiSJ9rkzsxiWm+hxGGq4DU39+wrVwy31fvYFaVlie9kimwGX4xM?= =?utf-8?q?xSScXGQ5hSDqTWMThu6+QF5UEP3A9M9tISwz3s0Xuyka250QTvgLQWnyoNMtwfYnV?= =?utf-8?q?KyHICK5pSKcmHV9WJwLWBFHYDVFR63kcKAbGRRz/KhdGl/FqjRjfykgE4V37wJnRi?= =?utf-8?q?tH2vWc8ykjOgiI41SnjgNXsepXbRbM6ftRmAXT2pZV1xjqL4Ca0yqtg/r7blBtw4v?= =?utf-8?q?HrXIZbNFn9ypXaX3MqXDfub4EW617MQkmWbSdoR62lZnmFr49pXxzgyBYsE2EsXPf?= =?utf-8?q?6AlDC2vB5HRZbXJHX8uwKARSelBINYs/KH0M0Bt9pZv0ek9Lo4tQ6iEqsCQm0ufqf?= =?utf-8?q?my31VWTQ2ZPsum84CXRyd+O5L+4NjfvISnzNpNg5gzns7Dn21MKQo7IwM+3RS6s6M?= =?utf-8?q?GHclg46DeFyceOiif/NNWBcfrpSfcyWIqHozBX+/2KxT+w9NBjmGDDRM7Hp6bkeNV?= =?utf-8?q?wk7XwrOOKauw?= MIME-Version: 1.0 X-OriginatorOrg: sony.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PUZPR04MB6316.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 08e83b6e-756b-4af7-88e1-08dabca1718b X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Nov 2022 07:11:20.6760 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 66c65d8a-9158-4521-a2d8-664963db48e4 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cRA4Z5DmuCmQ+Zncaml4q2wtDu8op7DpypGciCXaixDF8YLD6nSZEueUBAuoq0xXU2LPosCB7sbnCClgENiUQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0401MB6242 X-Proofpoint-ORIG-GUID: MGnxl7cr5Hs9xEG4IJl2V5VMcN96zIPl X-Proofpoint-GUID: MGnxl7cr5Hs9xEG4IJl2V5VMcN96zIPl X-Sony-Outbound-GUID: MGnxl7cr5Hs9xEG4IJl2V5VMcN96zIPl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-02_04,2022-11-01_02,2022-06-22_01 X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748367923750493418?= X-GMAIL-MSGID: =?utf-8?q?1748367923750493418?= This commit adds exfat_set_empty_hint()/exfat_reset_empty_hint() to reduce code complexity and make code more readable. Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru Reviewed-by: Sungjong Seo --- fs/exfat/dir.c | 58 +++++++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 27 deletions(-) -- 2.25.1 diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c index a27b55ec060a..9f9b8435baca 100644 --- a/fs/exfat/dir.c +++ b/fs/exfat/dir.c @@ -897,6 +897,29 @@ struct exfat_entry_set_cache *exfat_get_dentry_set(struct super_block *sb, return NULL; } +static inline void exfat_reset_empty_hint(struct exfat_hint_femp *hint_femp) +{ + hint_femp->eidx = EXFAT_HINT_NONE; + hint_femp->count = 0; +} + +static inline void exfat_set_empty_hint(struct exfat_inode_info *ei, + struct exfat_hint_femp *candi_empty, struct exfat_chain *clu, + int dentry, int num_entries) +{ + if (ei->hint_femp.eidx == EXFAT_HINT_NONE || + ei->hint_femp.eidx > dentry) { + if (candi_empty->count == 0) { + candi_empty->cur = *clu; + candi_empty->eidx = dentry; + } + + candi_empty->count++; + if (candi_empty->count == num_entries) + ei->hint_femp = *candi_empty; + } +} + enum { DIRENT_STEP_FILE, DIRENT_STEP_STRM, @@ -921,7 +944,7 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei, { int i, rewind = 0, dentry = 0, end_eidx = 0, num_ext = 0, len; int order, step, name_len = 0; - int dentries_per_clu, num_empty = 0; + int dentries_per_clu; unsigned int entry_type; unsigned short *uniname = NULL; struct exfat_chain clu; @@ -939,10 +962,13 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei, end_eidx = dentry; } - candi_empty.eidx = EXFAT_HINT_NONE; + exfat_reset_empty_hint(&ei->hint_femp); + rewind: order = 0; step = DIRENT_STEP_FILE; + exfat_reset_empty_hint(&candi_empty); + while (clu.dir != EXFAT_EOF_CLUSTER) { i = dentry & (dentries_per_clu - 1); for (; i < dentries_per_clu; i++, dentry++) { @@ -962,26 +988,8 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei, entry_type == TYPE_DELETED) { step = DIRENT_STEP_FILE; - num_empty++; - if (candi_empty.eidx == EXFAT_HINT_NONE && - num_empty == 1) { - exfat_chain_set(&candi_empty.cur, - clu.dir, clu.size, clu.flags); - } - - if (candi_empty.eidx == EXFAT_HINT_NONE && - num_empty >= num_entries) { - candi_empty.eidx = - dentry - (num_empty - 1); - WARN_ON(candi_empty.eidx < 0); - candi_empty.count = num_empty; - - if (ei->hint_femp.eidx == - EXFAT_HINT_NONE || - candi_empty.eidx <= - ei->hint_femp.eidx) - ei->hint_femp = candi_empty; - } + exfat_set_empty_hint(ei, &candi_empty, &clu, + dentry, num_entries); brelse(bh); if (entry_type == TYPE_UNUSED) @@ -989,8 +997,7 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei, continue; } - num_empty = 0; - candi_empty.eidx = EXFAT_HINT_NONE; + exfat_reset_empty_hint(&candi_empty); if (entry_type == TYPE_FILE || entry_type == TYPE_DIR) { step = DIRENT_STEP_FILE; @@ -1090,9 +1097,6 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei, rewind = 1; dentry = 0; clu.dir = p_dir->dir; - /* reset empty hint */ - num_empty = 0; - candi_empty.eidx = EXFAT_HINT_NONE; goto rewind; }